Add IS_TIZEN guard for XWalkExtension 59/290459/4
authorDongHyun Song <dh81.song@samsung.com>
Mon, 27 Mar 2023 00:21:03 +0000 (09:21 +0900)
committerBot Blink <blinkbot@samsung.com>
Mon, 27 Mar 2023 06:12:48 +0000 (06:12 +0000)
XWalkExtension can be enabled with IS_TIZEN and this will
fix build break for the desktop profile.

Change-Id: I0edb4a3c33a42a4637bebce0b3c74cd683f8ccf2
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
content/browser/browser_interface_binders.cc
tizen_src/ewk/efl_integration/content_browser_client_efl.cc
tizen_src/ewk/efl_integration/content_main_delegate_efl.cc
tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc

index 1d3cc71..567d15d 100644 (file)
 #include "content/browser/date_time_chooser_efl.h"
 #endif
 
-#if defined(ENABLE_WRT_JS)
+#if BUILDFLAG(IS_TIZEN)
 #include "tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension_manager.h"
 #endif
 
@@ -1208,7 +1208,7 @@ void PopulateDedicatedWorkerBinders(DedicatedWorkerHost* host,
   map->Add<blink::mojom::QuotaManagerHost>(BindWorkerReceiverForStorageKey(
       &RenderProcessHostImpl::BindQuotaManagerHost, host));
 
-#if defined(ENABLE_WRT_JS)
+#if BUILDFLAG(IS_TIZEN)
   map->Add<wrt::mojom::XWalkExtensionBrowser>(base::BindRepeating(
       &wrt::XWalkExtensionManager::Bind));
 #endif
index e93b875..9810adc 100644 (file)
@@ -24,7 +24,6 @@
 #include "components/error_page/common/localized_error.h"
 #include "components/navigation_interception/intercept_navigation_throttle.h"
 #include "components/password_manager/content/browser/content_password_manager_driver_factory.h"
-#include "components/xwalk_extensions/browser/xwalk_extension_manager.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/navigation_handle.h"
 #include "content/public/browser/render_process_host.h"
@@ -47,6 +46,8 @@
 
 #if BUILDFLAG(IS_TIZEN)
 #include <vconf.h>
+
+#include "components/xwalk_extensions/browser/xwalk_extension_manager.h"
 #endif
 
 #include "private/ewk_notification_private.h"
@@ -652,9 +653,11 @@ void ContentBrowserClientEfl::ExposeInterfacesToRenderer(
           switches::kXWalkExtensionJsonPath)) {
     return;
   }
+#if BUILDFLAG(IS_TIZEN)
   registry->AddInterface(
       base::BindRepeating(&wrt::XWalkExtensionManager::Bind),
       content::GetUIThreadTaskRunner({}));
+#endif
 }
 
 #if BUILDFLAG(IS_TIZEN_TV)
index 7024865..08b3a35 100644 (file)
@@ -8,7 +8,6 @@
 #include "browser/xwalk_extension_browser_efl.h"
 #include "command_line_efl.h"
 #include "common/content_switches_efl.h"
-#include "components/xwalk_extensions/browser/xwalk_extension_manager.h"
 #include "content/browser/gpu/gpu_main_thread_factory.h"
 #include "content/browser/gpu/gpu_process_host.h"
 #include "content/common/locale_efl.h"
 #include "content_browser_client_efl.h"
 #include "renderer/content_renderer_client_efl.h"
 #include "ui/base/resource/resource_bundle.h"
+
+#if BUILDFLAG(IS_TIZEN)
+#include "components/xwalk_extensions/browser/xwalk_extension_manager.h"
+#endif
+
 #if BUILDFLAG(IS_TIZEN_TV)
 #include "content/public/browser/render_process_host.h"
 #include "devtools_port_manager.h"
@@ -94,6 +98,7 @@ void ContentMainDelegateEfl::PreSandboxStartupBrowser() {
   // needed for gpu thread
   content::RegisterGpuMainThreadFactory(CreateInProcessGpuThread);
 
+#if BUILDFLAG(IS_TIZEN)
   // switches::kXWalkExtensionJsonPath SHOULD be set before MainDelegate init.
   auto json_path =
       base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
@@ -105,6 +110,7 @@ void ContentMainDelegateEfl::PreSandboxStartupBrowser() {
     extension_manager->SetDelegate(
         std::make_unique<XWalkExtensionBrowserEfl>());
   }
+#endif
 }
 
 void ContentMainDelegateEfl::PreSandboxStartup() {
index 7342715..c55cca8 100644 (file)
@@ -9,6 +9,8 @@
 
 #if BUILDFLAG(IS_TIZEN)
 #include <vconf/vconf.h>
+
+#include "components/xwalk_extensions/renderer/xwalk_extension_renderer_controller.h"
 #endif
 
 #include "base/command_line.h"
@@ -17,7 +19,6 @@
 #include "common/content_switches_efl.h"
 #include "common/render_messages_ewk.h"
 #include "components/visitedlink/renderer/visitedlink_reader.h"
-#include "components/xwalk_extensions/renderer/xwalk_extension_renderer_controller.h"
 #include "content/common/locale_efl.h"
 #include "content/common/paths_efl.h"
 #include "content/public/common/content_switches.h"
@@ -169,6 +170,7 @@ void ContentRendererClientEfl::RenderThreadStarted() {
   if (!command_line.HasSwitch(switches::kSingleProcess))
     LocaleEfl::Initialize();
 
+#if BUILDFLAG(IS_TIZEN)
   if (command_line.HasSwitch(switches::kXWalkExtensionJsonPath)) {
     wrt::XWalkExtensionRendererController::GetInstance().SetPrivilegeChecker(
         base::BindRepeating([]() -> bool {
@@ -177,6 +179,7 @@ void ContentRendererClientEfl::RenderThreadStarted() {
           return true;
         }));
   }
+#endif
 }
 
 void ContentRendererClientEfl::RenderFrameCreated(content::RenderFrame* render_frame) {
@@ -268,9 +271,10 @@ void ContentRendererClientEfl::DidCreateScriptContext(
     content::RenderFrame* render_frame,
     v8::Handle<v8::Context> context,
     int world_id) {
+#if BUILDFLAG(IS_TIZEN)
   if (ShouldRegisterXWalkExtension(world_id))
     wrt::XWalkExtensionRendererController::DidCreateScriptContext(context);
-
+#endif
   if (!widget_)
     return;
 
@@ -299,9 +303,10 @@ void ContentRendererClientEfl::WillReleaseScriptContext(
     blink::WebFrame* frame,
     v8::Handle<v8::Context> context,
     int world_id) {
+#if BUILDFLAG(IS_TIZEN)
   if (ShouldRegisterXWalkExtension(world_id))
     wrt::XWalkExtensionRendererController::WillReleaseScriptContext(context);
-
+#endif
   if (widget_)
     widget_->StopSession(context);
 }