[M120 Migration] Build libchromium-impl.so with chrome implementation 91/307791/11 accepted/tizen/unified/20240322.174254 submit/tizen/20240321.160014
authorRohit Kumar <rohit.16@partner.samsung.com>
Wed, 20 Mar 2024 09:18:20 +0000 (14:48 +0530)
committerDae-Hyun Ko <dhyuna.ko@samsung.com>
Thu, 21 Mar 2024 06:27:21 +0000 (06:27 +0000)
This patch builds libchromium-impl.so inlcude chrome implementation and
chrome_tizen as chrome main executable when |--build-chrome| option is
given.
Plus, gbs root and out directory are seperated.

Reference: https://review.tizen.org/gerrit/303499
   https://review.tizen.org/gerrit/306836
           https://review.tizen.org/gerrit/305200

Change-Id: Ie7718fa71ff361932e07eddb2651fcc7a4a3a6c2
Signed-off-by: Rohit Kumar <rohit.16@partner.samsung.com>
30 files changed:
build/config/BUILD.gn
build/config/linux/libffi/BUILD.gn
chrome/BUILD.gn
components/autofill/content/renderer/password_autofill_agent.cc
components/autofill_strings.grdp
components/components_strings.grd
components/omnibox_strings.grdp
components/password_manager_strings.grdp
components/policy_strings.grdp
components/version_ui_strings.grdp
content/browser/browser_interface_binders.cc
content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc
content/browser/renderer_host/render_process_host_impl.cc
device/bluetooth/BUILD.gn
electron/shell/browser/certificate_manager_model.cc
electron/shell/browser/certificate_manager_model.h
headless/BUILD.gn
packaging/chromium-efl.spec
printing/printing_context_linux.cc
services/device/geolocation/location_arbitrator.cc
third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
tizen_src/build/common.sh
tizen_src/build/config/tizen_features.gni
tizen_src/downloadable/ewk_interface_main.cc
tizen_src/ewk/chromium-ewk.filter
tizen_src/ewk/efl_integration/BUILD.gn
tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.cc
tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.h
tools/grit/grit_args.gni
wrt/BUILD.gn

index 6f5ac4f..7b48894 100644 (file)
@@ -221,10 +221,6 @@ config("default_libs") {
       "rt",
     ]
 
-    if (is_tizen && is_clang) {
-      libs += [ "atomic" ]
-      ldflags = [ "-Wl,-rpath=/usr/local/lib/" ]
-    }
   }
 }
 
index 7052491..771170c 100644 (file)
@@ -3,9 +3,6 @@
 # found in the LICENSE file.
 
 import("//build/config/linux/pkg_config.gni")
-if (use_efl) {
-  import("//tizen_src/build/config/tizen_features.gni")
-}
 
 declare_args() {
   # Controls whether the build should use the version of libffi library shipped
@@ -13,8 +10,7 @@ declare_args() {
   # on Linux, libffi must be statically linked to prevent a situation where the
   # runtime version of libffi is different from the build-time version from the
   # sysroot.
-  use_system_libffi =
-      default_toolchain == "//build/toolchain/cros:target" || build_chrome
+  use_system_libffi = default_toolchain == "//build/toolchain/cros:target"
 }
 
 if (use_system_libffi) {
index ea0b7d9..2131b35 100644 (file)
@@ -1457,6 +1457,92 @@ if (is_win) {
     group("chrome_dsym_archive") {
     }
   }
+} else if (is_tizen) {
+  executable("chrome_tizen") {
+    testonly = true
+    deps = [ "//tizen_src/ewk/efl_integration:libchromium-ewk" ]
+    sources = [
+      "app/chrome_exe_main_aura.cc",
+      "app/chrome_exe_resource.h",
+    ]
+    ldflags = [
+      "-pie",
+      "-Wl,--export-dynamic",
+    ]
+    cflags = [ "-fPIC" ]
+    configs += [ "//tizen_src/build/config/tizen:executable_config" ]
+  }
+
+  static_library("chrome_lib") {
+    sources = [ "app/chrome_exe_resource.h" ]
+    defines = []
+    public_deps = []
+    deps = [
+      "//build:chromeos_buildflags",
+      "//printing/buildflags",
+    ]
+    data = [ "$root_out_dir/resources.pak" ]
+    data_deps = []
+
+    sources += [
+      "app/chrome_dll_resource.h",
+      "app/chrome_main.cc",
+      "app/chrome_main_delegate.cc",
+      "app/chrome_main_delegate.h",
+      "app/chrome_main_linux.cc",
+      "app/chrome_main_linux.h",
+    ]
+
+    deps += [
+      # On Linux, link the dependencies (libraries) that make up actual
+      # Chromium functionality directly into the executable.
+      ":dependencies",
+
+      # For configuring PartitionAlloc
+      "//base/allocator:buildflags",
+
+      # For the sampling profiler.
+      "//chrome/common/profiler",
+
+      # Needed to use the master_preferences functions
+      "//chrome/installer/util:with_no_strings",
+      "//content/public/app",
+
+      # For headless mode.
+      "//headless:headless_shell_lib",
+    ]
+
+    public_deps = [ "//chrome/common:buildflags" ]
+
+    if (!is_fuchsia) {
+      public_deps += [
+        ":xdg_mime",  # Needs to be public for installer to consume files.
+      ]
+
+      data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
+    }
+
+    ldflags = []
+
+    if ((is_linux || is_chromeos_lacros) && !is_component_build &&
+        !using_sanitizer) {
+      version_script = "//build/linux/chrome.map"
+      inputs = [ version_script ]
+      ldflags += [ "-Wl,--version-script=" +
+                   rebase_path(version_script, root_build_dir) ]
+    }
+
+    # These files are used by the installer so we need a public dep.
+    public_deps += [ ":packed_resources" ]
+
+    # The step's output are needed at runtime, so we also need a data_dep.
+    data_deps += [ ":packed_resources" ]
+
+    data_deps += [
+      "//chrome/browser/resources/media/mei_preload:component",
+      "//third_party/widevine/cdm",
+    ]
+  }
 }
 
 group("dependencies") {
index 723b3ef..295ac32 100644 (file)
@@ -2372,14 +2372,11 @@ bool PasswordAutofillAgent::SupportAutoLogin() {
   //  org.tizen.browser,  com.samsung.tv.knox-browser
   // Only org.tizen.browser app need AutoLogin behavior according to their spec.
   // The latter just wants Autofill.
-#if defined(BUILD_CHROME)
-  return false;
-#else
+
   const std::string tizen_app_id =
       base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
           switches::kTizenAppId);
   return tizen_app_id == "org.tizen.browser";
-#endif
 }
 #endif
 
index 55754a3..4d331f3 100644 (file)
@@ -23,7 +23,7 @@
     </message>
   </if>
 
-  <if expr="is_android or is_ios or not is_tizen">
+  <if expr="is_android or is_ios or build_chrome">
     <message name="IDS_AUTOFILL_REMOVE_LOCAL_COPY_BUTTON" desc="The label of the button that removes the local copy of a Wallet Credit Card." formatter_data="android_java">
       Remove copy
     </message>
index fb29e4b..5d2e302 100644 (file)
       <part file="autofill_payments_strings.grdp" />
       <part file="autofill_strings.grdp" />
       <part file="bookmark_bar_strings.grdp" />
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <part file="bookmark_component_strings.grdp" />
       </if>
       <part file="blocked_content_strings.grdp" />
       <part file="live_caption_strings.grdp" />
       <part file="components_settings_strings.grdp" />
       <part file="content_creation_strings.grdp" />
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <part file="crash_strings.grdp" />
       </if>
       <part file="dialog_strings.grdp" />
       <part file="dom_distiller_strings.grdp" />
       <part file="enterprise_strings.grdp" />
       <part file="error_page_strings.grdp" />
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <part file="find_in_page_strings.grdp" />
       <part file="history_strings.grdp" />
       <part file="login_dialog_strings.grdp" />
       <part file="ssl_errors_strings.grdp" />
       <part file="subresource_filter_strings.grdp" />
       <part file="supervised_user_strings.grdp" />
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <part file="sync_ui_strings.grdp" />
       </if>
       <part file="translate_strings.grdp" />
         <part file="webxr_strings.grdp" />
       </if>
 
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <!-- Generic terms -->
       <message name="IDS_CANCEL" desc="Used for Cancel on buttons">
         Cancel
       <message name="IDS_OK" desc="Used for OK on buttons">
         OK
       </message>
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <message name="IDS_RELOAD" desc="Used for Reload on buttons">
         Reload
       </message>
       <message name="IDS_UTILITY_PROCESS_JSON_PARSER_NAME" desc="The name of the utility process used for parsing JSON files.">
         JSON Parser
       </message>
-      <if expr="not is_tizen">
+      <if expr="build_chrome">
       <message name="IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON" desc="Title of the restore button in the session crashed view.">
         Restore
       </message>
index bee4840..bba574c 100644 (file)
@@ -32,7 +32,7 @@
       Image you copied
     </message>
   </if>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_SECURE_CONNECTION_EV" desc="Short text shown in the location bar when the connection is secure with an EV cert.">
     <ph name="ORGANIZATION">$1<ex>Paypal Inc.</ex></ph> [<ph name="COUNTRY">$2<ex>US</ex></ph>]
   </message>
@@ -64,7 +64,7 @@
       Search or type URL
     </message>
   </if>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_OMNIBOX_ADDITIONAL_TEXT_DASH_TEMPLATE" desc="The omnibox text when there is both traditional text (i.e., user text + inline autocompletion) and additional text (i.e. the default suggestion's URL when rich autocompleting a title) to display.">
     <ph name="TRADITIONAL_TEXT">$1</ph> - <ph name="ADDITIONAL_TEXT">$2</ph>
   </message>
index 32d04bf..13dd105 100644 (file)
@@ -87,6 +87,8 @@
       Suggest Strong Password…
     </message>
   </if>
+  </if>
+  <if expr="build_chrome">
   <message name="IDS_PASSWORD_MANAGER_EXCEPTIONS_TAB_TITLE" desc="Title for 'Never saved' tab">
     Never saved
   </message>
index 0130f34..29a7fab 100644 (file)
@@ -387,7 +387,7 @@ Additional details:
   <message name="IDS_POLICY_LOAD_POLICIES_DONE" desc="Screen reader message indicates policies have been loaded.">
     Policies is loaded
   </message>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_EXPORT_POLICIES_JSON" desc="Label for the button that exports policies in JSON format.">
     Export to JSON
   </message>
@@ -614,7 +614,7 @@ Additional details:
   <message name="IDS_POLICY_SOURCE_DEVICE_LOCAL_ACCOUNT_OVERRIDE" desc="Indicates that the policy is set programmatically because of an active device-local account session: managed session or Kiosk app (both for ChromeOS only). It could have overridden other sources that set this policy.">
     Device local account override
   </message>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_POLICY_RISK_TAG_FULL_ADMIN_ACCESS" desc="Title of a group/tag whose policies potentially allow the administrator to access all of a user's data.">
     Full Admin Access
   </message>
index 89453a3..b55edca 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <grit-part>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_VERSION_UI_TITLE" desc="Title on the about:version page">
     About Version
   </message>
@@ -11,7 +11,7 @@
   <message name="IDS_VERSION_UI_UNOFFICIAL" desc="unofficial build on the about:version page">
     Developer Build
   </message>
-  <if expr="not is_tizen">
+  <if expr="build_chrome">
   <message name="IDS_VERSION_UI_32BIT" desc="32-bit on the chrome://version page">
     (32-bit)
   </message>
index 9899337..df54bce 100644 (file)
 #include "third_party/blink/public/mojom/badging/badging.mojom.h"
 #endif
 
-#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
-#include "tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension_manager.h"
+#if BUILDFLAG(IS_TIZEN)
+#include "components/xwalk_extensions/browser/xwalk_extension_manager.h"
 #endif
 
 namespace blink {
@@ -1416,7 +1416,7 @@ void PopulateDedicatedWorkerBinders(DedicatedWorkerHost* host,
       host->GetAncestorRenderFrameHostId(),
       RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker,
       host));
-#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
+#if BUILDFLAG(IS_TIZEN)
   map->Add<wrt::mojom::XWalkExtensionBrowser>(base::BindRepeating(
       &wrt::XWalkExtensionManager::Bind));
 #endif
index 6af445d..0e0488e 100644 (file)
@@ -163,7 +163,7 @@ class RenderFrameAudioInputStreamFactory::Core final
       const std::string& raw_output_device_id);
 
 #if BUILDFLAG(IS_TIZEN_TV)
-  void OnMediaStateChanged(uint32_t previous, uint32_t current);
+  void OnMediaStateChanged(uint32_t previous, uint32_t current) final;
   void NotifyMediaStateChanged(uint32_t previous, uint32_t current);
 #endif
 
index 8d834f5..ec8e9ec 100644 (file)
@@ -3569,7 +3569,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
     switches::kDiscardableMemoryLimit,
     switches::kDiscardableMemoryPurgeDelay,
 #endif
-#if BUILDFLAG(IS_TIZEN_TV) && !defined(BUILD_CHROME)
+#if BUILDFLAG(IS_TIZEN_TV)
     switches::kTizenAppId,
     switches::kXWalkExtensionPath,
 #endif
index 978a59f..847c3e9 100644 (file)
@@ -46,7 +46,7 @@ source_set("deprecated_experimental_mojo") {
     "socket.h",
   ]
 
-  if (is_chromeos || is_linux || is_tizen) {
+  if (is_chromeos || is_linux) {
     sources += [
       "bluez/metrics_recorder.cc",
       "bluez/metrics_recorder.h",
index e2c09a5..78cc91b 100644 (file)
@@ -45,6 +45,8 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
 
 }  // namespace
 
+namespace electron {
+
 // CertificateManagerModel is created on the UI thread. It needs a
 // NSSCertDatabase handle (and on ChromeOS it needs to get the TPM status) which
 // needs to be done on the IO thread.
@@ -167,3 +169,5 @@ void CertificateManagerModel::GetCertDBOnIOThread(
   if (cert_db)
     std::move(split_callback.second).Run(cert_db);
 }
+
+}  // namespace electron
index 91f7f3c..a6c2fe8 100644 (file)
@@ -18,6 +18,8 @@ class BrowserContext;
 class ResourceContext;
 }  // namespace content
 
+namespace electron {
+
 // CertificateManagerModel provides the data to be displayed in the certificate
 // manager dialog, and processes changes from the view.
 class CertificateManagerModel {
@@ -114,4 +116,6 @@ class CertificateManagerModel {
   bool is_user_db_available_;
 };
 
+}  // namespace electron
+
 #endif  // ELECTRON_SHELL_BROWSER_CERTIFICATE_MANAGER_MODEL_H_
index 1fc8258..dadca05 100644 (file)
@@ -862,7 +862,7 @@ static_library("headless_shell_lib") {
   ]
   defines = []
 
-  if (!is_component_build) {
+  if (!is_component_build && !build_chrome) {
     sources += [
       "lib/utility/headless_content_utility_client.cc",
       "lib/utility/headless_content_utility_client.h",
index 07a9f5c..ccc8e52 100644 (file)
@@ -537,7 +537,6 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py
   "build_chrome=true" \
 %else
   "build_chrome=false" \
-  "ozone_auto_platforms=false" \
 %endif
 %if "%{?tizen_profile_name}" == "tv"
   "lib_dir_path=\"%{_libdir}\"" \
@@ -548,9 +547,12 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py
 %if 0%{?__enable_ewk_interface}
  "enable_ewk_interface=true" \
 %endif
+  "ozone_auto_platforms=false" \
   "enable_wrt_js=%{macro_to_bool __enable_wrt_js}" \
+%if 0%{?__enable_wrt_js}
   "xwalk_extension_path=\"%{__xwalk_extension_path}\"" \
   "xwalk_extension_service_path=\"%{__xwalk_extension_service_path}\"" \
+%endif
 %if %{__enable_network_camera}
   "enable_network_camera=true" \
 %endif
@@ -579,11 +581,10 @@ ninja %{_smp_mflags} -C "%{OUTPUT_FOLDER}" \
 %if 0%{?__enable_squashfs_image} && "%{?tizen_profile_name}" == "tv"
   chromium-efl-install \
 %endif
-%if %{__build_chrome} == 1
-  content_shell chrome
-%else
-  efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser
+%if 0%{?__build_chrome}
+  chrome_tizen \
 %endif
+  efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser
 
 %if 0%{?_enable_unittests}
 ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" angle_unittests env_chromium_unittests cacheinvalidation_unittests \
@@ -704,22 +705,17 @@ install -m 0644 %{_libdir}/libscl-common.so        "%{buildroot}"%{_libdir}
 %endif
 
 %if %{__build_chrome} == 1
-  install -m 0755 "%{OUTPUT_FOLDER}"/content_shell      "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
-  sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/content_shell#' %{SOURCE1} > "%{buildroot}"%{_bindir}/content_shell
-
-  install -m 0755 "%{OUTPUT_FOLDER}"/chrome "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome
-  sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome
-
+  install -m 0755 "%{OUTPUT_FOLDER}"/chrome_tizen "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome_tizen
+  sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome_tizen#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_tizen
   install -m 0755 "%{OUTPUT_FOLDER}"/chrome_crashpad_handler "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler
   sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_crashpad_handler
-  install -m 0644 "%{OUTPUT_FOLDER}"/ui_resources_100_percent.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
   install -m 0644 "%{OUTPUT_FOLDER}"/locales/*.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/locales
   install -m 0644 "%{OUTPUT_FOLDER}"/chrome_100_percent.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
   install -m 0644 "%{OUTPUT_FOLDER}"/resources.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/
-
-  install -m 0755 "%{OUTPUT_FOLDER}"/libminigbm.so "%{buildroot}"%{_libdir}
 %else
   install -m 0644 "%{OUTPUT_FOLDER}"/locales/efl/*.pak  "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/locales/
+%endif
+
   install -m 0755 "%{OUTPUT_FOLDER}"/libtest_trace_processor.so "%{buildroot}"%{_libdir}
   install -m 0755 "%{OUTPUT_FOLDER}"/efl_webprocess    "%{buildroot}"%{_bindir}/
   %if "%{?profile}" == "tv"
@@ -748,16 +744,15 @@ install -m 0644 %{_libdir}/libscl-common.so        "%{buildroot}"%{_libdir}
     %endif
   %endif
 
-  # org.tizen.chromium-efl Tizen App package
-  install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
-  install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
-  install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
+# org.tizen.chromium-efl Tizen App package
+install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
+install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
+install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/
 
-  %if 0%{?__enable_ewk_interface}
-    install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-impl.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
-  %else
-    install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-ewk.so  "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
-  %endif
+%if 0%{?__enable_ewk_interface}
+  install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-impl.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
+%else
+  install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-ewk.so  "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/
 %endif
 
 install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/themes/
@@ -782,10 +777,7 @@ install -m 0644 "%{OUTPUT_FOLDER}"/tizen-manifest.xml "%{buildroot}"%{_xmldir}/%
   %define tizen_dist_sign 1
 %endif
 
-%if %{__build_chrome} != 1
 install -m 0644 "%{OUTPUT_FOLDER}"/images/*.png    "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/images/
-%endif
-
 install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/themes/
 
 %if "%{?__use_system_icu}" != "1"
@@ -817,12 +809,10 @@ install -m 0644 tizen_src/ewk/efl_integration/public/*.h "%{buildroot}"%{_includ
 install -d "%{buildroot}"%{_includedir}/v8
 install -m 0644 v8/include/*.h "%{buildroot}"%{_includedir}/v8/
 
-%if %{__build_chrome} != 1
-  # The native applications using ewk API from Tizen 2.x have a dependency about libewebkit2.so.
-  # The chromium-efl should support the backward compatibility of the native applications.
-  ln -s %{_libdir}/libchromium-ewk.so %{buildroot}%{_libdir}/libewebkit2.so.0
-  ln -s %{_libdir}/libewebkit2.so.0   %{buildroot}%{_libdir}/libewebkit2.so
-%endif
+# The native applications using ewk API from Tizen 2.x have a dependency about libewebkit2.so.
+# The chromium-efl should support the backward compatibility of the native applications.
+ln -s %{_libdir}/libchromium-ewk.so %{buildroot}%{_libdir}/libewebkit2.so.0
+ln -s %{_libdir}/libewebkit2.so.0   %{buildroot}%{_libdir}/libewebkit2.so
 
 %if 0%{?__make_squashfs_rpm}
   install -d "%{buildroot}"%{CHROMIUM_APP_DIR}/res
@@ -937,6 +927,8 @@ install -m 0755 -p -D %{OUTPUT_FOLDER}/ppapi_unittests %{buildroot}/opt/usr/utc_
       install -m 644 -D $file                                     %{buildroot}%{CHROMIUM_LIB_DIR}/res/locale/${file#%{__wrt_localedir}}
     done
 
+    install -m 0644 %{OUTPUT_FOLDER}/gen/wrt/resources/*.edj      %{buildroot}%{CHROMIUM_LIB_DIR}/res/themes/
+
     install -d %{buildroot}/etc/notstrip/
     install -m 644 packaging/wrt.notstrip                         %{buildroot}/etc/notstrip/wrt.notstrip
     %if 0%{?__generate_tpk}
@@ -1100,15 +1092,11 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
 %if %{__build_chrome} == 1
   %{CHROMIUM_LIB_DIR}/bin/chrome_100_percent.pak
   %{CHROMIUM_LIB_DIR}/bin/resources.pak
-  %{CHROMIUM_LIB_DIR}/bin/ui_resources_100_percent.pak
-  %{CHROMIUM_LIB_DIR}/bin/content_shell
-  %{_bindir}/content_shell
-  %{CHROMIUM_LIB_DIR}/bin/chrome
-  %{_bindir}/chrome
+  %{CHROMIUM_LIB_DIR}/bin/chrome_tizen
+  %{_bindir}/chrome_tizen
   %{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler
   %{_bindir}/chrome_crashpad_handler
-  %{_libdir}/libminigbm.so
-%else
+%endif
   %{CHROMIUM_LIB_DIR}/res/locale/*
   %{_libdir}/libchromium-ewk.so
   %{_libdir}/libtest_trace_processor.so
@@ -1116,33 +1104,37 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
   %if 0%{?__enable_squashfs_image}
     %if "%{?tizen_profile_name}" == "tv"
       %{_bindir}/chromium-efl-install
-      %{_unitdir_user}/chromium-efl-vd.service
-      %{_unitdir_user}/default.target.wants/chromium-efl-vd.service
-      %dir %{CHROMIUM_LIB_UPGRADE_DIR}
-    %else
-      %{_unitdir}/chromium-efl.service
-      %{_unitdir}/multi-user.target.wants/chromium-efl.service
-      %{_unitdir}/chromium-efl-update.service
-      %{_unitdir}/multi-user.target.wants/chromium-efl-update.service
-    %endif
-  %endif
-  %{CHROMIUM_APP_DIR}/bin/efl_webview_app
-  %{CHROMIUM_APP_DIR}/bin/mini_browser
-  %{CHROMIUM_APP_DIR}/bin/ubrowser
-
-  %if "%{?tizen_profile_name}" == "tv"
-    %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{_bindir}/efl_webprocess
-    %{_bindir}/efl_pluginprocess
-  %else
-    %{_bindir}/efl_webprocess
-  %endif
-  %if 0%{?__enable_ewk_interface}
-    %{CHROMIUM_LIB_DIR}/lib/libchromium-impl.so
+    %{_unitdir_user}/chromium-efl-vd.service
+    %{_unitdir_user}/default.target.wants/chromium-efl-vd.service
+    %dir %{CHROMIUM_LIB_UPGRADE_DIR}
   %else
-    %{CHROMIUM_LIB_DIR}/lib/libchromium-ewk.so
+    %{_unitdir}/chromium-efl.service
+    %{_unitdir}/multi-user.target.wants/chromium-efl.service
+    %{_unitdir}/chromium-efl-update.service
+    %{_unitdir}/multi-user.target.wants/chromium-efl-update.service
   %endif
-  %{CHROMIUM_LIB_DIR}/res/images/*.png
 %endif
+%{CHROMIUM_APP_DIR}/bin/efl_webview_app
+%{CHROMIUM_APP_DIR}/bin/mini_browser
+%{CHROMIUM_APP_DIR}/bin/ubrowser
+
+%if "%{?tizen_profile_name}" == "tv"
+  %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{_bindir}/efl_webprocess
+  %{_bindir}/efl_pluginprocess
+%else
+  %{_bindir}/efl_webprocess
+%endif
+
+%if 0%{?__enable_ewk_interface}
+  %{CHROMIUM_LIB_DIR}/lib/libchromium-impl.so
+%else
+  %{CHROMIUM_LIB_DIR}/lib/libchromium-ewk.so
+%endif
+
+%{CHROMIUM_LIB_DIR}/res/images/*.png
+
+%{CHROMIUM_LIB_DIR}/res/themes/*.edj
+%{CHROMIUM_LIB_DIR}/res/locale
 
 %if "%{?__use_system_icu}" != "1"
   %{CHROMIUM_LIB_DIR}/bin/icudtl.dat
@@ -1157,7 +1149,7 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
     %endif
   %else
     %{_bindir}/wrt
-  %endif
+%endif
   %{_bindir}/wrt-client
   %{_sysconfdir}/profile.d/wrt_env.sh
   %if %{__build_chrome} != 1
index 2bb8fbf..73fe985 100644 (file)
@@ -72,7 +72,7 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
 
   ResetSettings();
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN)
   if (!ui::LinuxUi::instance())
     return mojom::ResultCode::kSuccess;
 
@@ -88,7 +88,7 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
 }
 
 gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() {
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN)
   if (ui::LinuxUi::instance())
     return ui::LinuxUi::instance()->GetPdfPaperSize(this);
 #endif
@@ -101,7 +101,7 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings(
   DCHECK(!printer_settings.show_system_dialog);
   DCHECK(!in_print_job_);
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN)
   if (!ui::LinuxUi::instance())
     return mojom::ResultCode::kSuccess;
 
index 6ef49eb..cf3b855 100644 (file)
@@ -198,7 +198,7 @@ LocationArbitrator::NewNetworkLocationProvider(
 
 std::unique_ptr<LocationProvider>
 LocationArbitrator::NewSystemLocationProvider() {
-#if BUILDFLAG(IS_TIZEN) && !defined(BUILD_CHROME)
+#if BUILDFLAG(IS_TIZEN)
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
           switches::kEnableOffscreenRendering)) {
     return device::NewSystemLocationProvider(main_task_runner_,
index a51bb34..a0f074f 100644 (file)
@@ -37,7 +37,7 @@ void DocumentModuleScriptFetcher::Fetch(
   DCHECK(!client_);
   client_ = client;
   expected_module_type_ = expected_module_type;
-#if defined(ENABLE_WRT_JS) && !defined(BUILD_CHROME)
+#if defined(ENABLE_WRT_JS)
   if (wrt::WRTModuleScriptFetcher::Fetch(fetch_params, client))
     return;
 #endif
index c0b3c33..1dd2645 100755 (executable)
@@ -242,6 +242,7 @@ function setupAndExecuteTargetBuild() {
   local LOCAL_BUILD=1
   local RELEASE_BUILD=0
   local MAKE_SQUASHFS_RPM=0
+  local BUILD_CHROME=0
 
   # "|| :" means "or always succeeding built-in command"
   PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" | head -1 || :)
@@ -313,6 +314,7 @@ function setupAndExecuteTargetBuild() {
     --tizen*)
     ;;
     --build-chrome)
+        BUILD_CHROME=1
         ARGS+=(--define "_build_chrome 1")
     ;;
     *)
@@ -388,7 +390,11 @@ function setupAndExecuteTargetBuild() {
   if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then
     CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf"
     if [ "$GBS_ROOT" == "" ]; then
-      GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-${BRANCH^^}"
+      if [ "$BUILD_CHROME" == "1" ]; then
+        GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-CHROME-${BRANCH^^}"
+      else
+        GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-${BRANCH^^}"
+      fi
     else
       GBS_ROOT_OPT="-B $GBS_ROOT"
     fi
index afc058c..c754301 100644 (file)
@@ -76,7 +76,7 @@ declare_args() {
   drm_mapi_aarch_64 = false
 }
 
-if (use_efl && !build_chrome) {
+if (use_efl) {
   tizen_autofill = true
   if (tizen_product_tv) {
     tizen_autofill_fw = true
index cf16835..2857e01 100644 (file)
@@ -470,6 +470,18 @@ int WRTServiceMain(int argc, char** argv) {
 }
 #endif
 
+#if defined(BUILD_CHROME)
+__attribute__((visibility("default"))) int ChromeMain(int argc,
+                                                      const char** argv) {
+  LOG(INFO) << "EWK-INTERFACE : ChromeMain called..";
+  typedef int (*func_ptr_t)(int argc, const char** argv);
+  func_ptr_t fp = reinterpret_cast<func_ptr_t>(ewk_dlsym("ChromeMain"));
+  if (fp)
+    return fp(argc, argv);
+  return 0;
+}
+#endif  // defined(BUILD_CHROME)
+
 #ifdef __cplusplus
 }
 #endif
index 18a1d58..52f4727 100644 (file)
@@ -42,6 +42,8 @@
     WRTServiceMain;
     ime_app_main;
     node_module_register;
+    # CHROMIUM BROWSER
+    ChromeMain;
 
   local: *;
 };
index 2a2f56e..b09d396 100644 (file)
@@ -115,7 +115,9 @@ shared_library("chromium-ewk") {
     "//ui/views:test_support",
     "//v8",
   ]
-
+  if (build_chrome && is_tizen) {
+    deps += [ "//chrome:chrome_lib" ]
+  }
   if (enable_basic_printing) {
     deps += [ "//printing" ]
   }
index 987c2c6..1fd507c 100644 (file)
@@ -21,6 +21,8 @@
 #include "ppapi/proxy/ppapi_messages.h"
 #include "ppapi/shared_impl/var_tracker.h"
 
+namespace pepper {
+
 PepperSharedMemoryMessageFilter::PepperSharedMemoryMessageFilter(
     content::RendererPpapiHost* host)
     : InstanceMessageFilter(host->GetPpapiHost()), host_(host) {}
@@ -63,3 +65,5 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory(
           ->GetVarTracker()
           ->TrackSharedMemoryRegion(instance, std::move(shm), size);
 }
+
+}  // namespace pepper
index c425868..11b224b 100644 (file)
@@ -25,6 +25,8 @@ class SerializedHandle;
 }
 }  // namespace ppapi
 
+namespace pepper {
+
 // Implements the backend for shared memory messages from a plugin process.
 class PepperSharedMemoryMessageFilter
     : public ppapi::host::InstanceMessageFilter {
@@ -48,4 +50,6 @@ class PepperSharedMemoryMessageFilter
   content::RendererPpapiHost* host_;
 };
 
+}  // namespace pepper
+
 #endif  // RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_
index 52f0fc5..eadb5a3 100644 (file)
@@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni")
 import("//build/config/chromeos/ui_mode.gni")
 import("//build/config/devtools.gni")
 import("//build/config/ui.gni")
+import("//tizen_src/build/config/tizen_features.gni")
 
 shared_intermediate_dir = rebase_path(root_gen_dir, root_build_dir)
 devtools_grd_path = "$shared_intermediate_dir/$devtools_grd_location"
@@ -33,6 +34,8 @@ _grit_defines = [
   "toolkit_views=${toolkit_views}",
   "use_aura=${use_aura}",
   "use_ozone=${use_ozone}",
+  "is_tizen=${is_tizen}",
+  "build_chrome=${build_chrome}",
 
   # Mac and iOS want Title Case strings.
   "use_titlecase=${is_apple}",
index 2c97238..b6ba21d 100644 (file)
@@ -388,43 +388,6 @@ static_library("wrt_lib") {
   }
 
   sources = wrt_lib_sources + [
-    "//chrome/browser/app_mode/app_mode_utils.cc",
-    "//chrome/browser/app_mode/app_mode_utils.h",
-    "//chrome/browser/browser_features.cc",
-    "//chrome/browser/browser_features.h",
-    "//chrome/browser/browser_process.cc",
-    "//chrome/browser/browser_process.h",
-    "//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
-    "//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
-    "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
-    "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
-    "//chrome/browser/devtools/devtools_file_system_indexer.cc",
-    "//chrome/browser/devtools/devtools_file_system_indexer.h",
-    "//chrome/browser/icon_loader.cc",
-    "//chrome/browser/icon_loader.h",
-    "//chrome/browser/icon_loader_auralinux.cc",
-    "//chrome/browser/icon_manager.cc",
-    "//chrome/browser/icon_manager.h",
-    "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
-    "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
-    "//chrome/browser/net/proxy_config_monitor.cc",
-    "//chrome/browser/net/proxy_config_monitor.h",
-    "//chrome/browser/net/proxy_service_factory.cc",
-    "//chrome/browser/net/proxy_service_factory.h",
-    "//chrome/browser/process_singleton.h",
-    "//chrome/browser/process_singleton_posix.cc",
-    "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
-    "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h",
-    "//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc",
-    "//chrome/browser/ui/exclusive_access/exclusive_access_manager.h",
-    "//chrome/browser/ui/exclusive_access/fullscreen_controller.cc",
-    "//chrome/browser/ui/exclusive_access/fullscreen_controller.h",
-    "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc",
-    "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h",
-    "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc",
-    "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
-    "//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
-    "//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
     "//electron/shell/browser/certificate_manager_model.cc",
     "//electron/shell/browser/certificate_manager_model.h",
     "//electron/shell/browser/lib/power_observer_linux.cc",
@@ -432,6 +395,47 @@ static_library("wrt_lib") {
     "//electron/shell/common/node_bindings_linux.cc",
   ]
   sources += rebase_path(electron_override_sources, ".", "overrides/electron")
+  if (!build_chrome) {
+    sources += [
+      "//chrome/browser/app_mode/app_mode_utils.cc",
+      "//chrome/browser/app_mode/app_mode_utils.h",
+      "//chrome/browser/browser_features.cc",
+      "//chrome/browser/browser_features.h",
+      "//chrome/browser/browser_process.cc",
+      "//chrome/browser/browser_process.h",
+      "//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
+      "//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
+      "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
+      "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h",
+      "//chrome/browser/devtools/devtools_file_system_indexer.cc",
+      "//chrome/browser/devtools/devtools_file_system_indexer.h",
+      "//chrome/browser/icon_loader.cc",
+      "//chrome/browser/icon_loader.h",
+      "//chrome/browser/icon_loader_auralinux.cc",
+      "//chrome/browser/icon_manager.cc",
+      "//chrome/browser/icon_manager.h",
+      "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
+      "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
+      "//chrome/browser/net/proxy_config_monitor.cc",
+      "//chrome/browser/net/proxy_config_monitor.h",
+      "//chrome/browser/net/proxy_service_factory.cc",
+      "//chrome/browser/net/proxy_service_factory.h",
+      "//chrome/browser/process_singleton.h",
+      "//chrome/browser/process_singleton_posix.cc",
+      "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
+      "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h",
+      "//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc",
+      "//chrome/browser/ui/exclusive_access/exclusive_access_manager.h",
+      "//chrome/browser/ui/exclusive_access/fullscreen_controller.cc",
+      "//chrome/browser/ui/exclusive_access/fullscreen_controller.h",
+      "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc",
+      "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h",
+      "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc",
+      "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
+      "//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
+      "//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
+    ]
+  }
   if (tizen_product_tv) {
     sources += wrt_lib_sources_tv
   } else {
@@ -480,10 +484,12 @@ static_library("wrt_lib") {
     ]
     sources += wrt_lib_sources_chrome_extensions
   } else {
-    sources += wrt_lib_sources_without_chrome_extensions
+    if (!build_chrome) {
+      sources += wrt_lib_sources_without_chrome_extensions
+    }
   }
 
-  if (enable_printing) {
+  if (enable_printing && !build_chrome) {
     deps += [
       "//chrome/services/printing:lib",
       "//chrome/services/printing/public/mojom",
@@ -518,6 +524,7 @@ static_library("wrt_lib") {
       "//electron/shell/renderer/printing/print_render_frame_helper_delegate.cc",
       "//electron/shell/renderer/printing/print_render_frame_helper_delegate.h",
     ]
+
     if (enable_oop_printing) {
       sources += [
         "//chrome/browser/printing/print_backend_service_manager.cc",
@@ -533,6 +540,14 @@ static_library("wrt_lib") {
       ]
     }
   }
+  else {
+   sources += [
+      "//electron/shell/browser/printing/print_view_manager_electron.cc",
+      "//electron/shell/browser/printing/print_view_manager_electron.h",
+      "//electron/shell/renderer/printing/print_render_frame_helper_delegate.cc",
+      "//electron/shell/renderer/printing/print_render_frame_helper_delegate.h",
+    ]
+}
 
   unused_electron_sources = [
     "shell/browser/api/electron_api_desktop_capturer.cc",