[M120 Migration] Enable input picker for chrome 26/307826/6
authorAkshay Kanagali <a.kanagali@partner.samsung.com>
Thu, 29 Feb 2024 07:44:09 +0000 (13:14 +0530)
committerBot Blink <blinkbot@samsung.com>
Wed, 27 Mar 2024 00:46:50 +0000 (00:46 +0000)
1) Color Picker
2) Select Picker
3) Date Picker

This patch introduces runtime flag --use-internal-popup-menu
to switch between internal and external popup implementation
as per Browser preference.

Reference: https://review.tizen.org/gerrit/303101/
           https://review.tizen.org/gerrit/304039/
           https://review.tizen.org/gerrit/306960/

Change-Id: I2ae42054c90d9f33d46c479fd3ee8f5d36dc2667
Signed-off-by: Akshay Kanagali <a.kanagali@partner.samsung.com>
content/browser/renderer_host/render_process_host_impl.cc
content/child/runtime_features.cc
content/renderer/render_thread_impl.cc
third_party/blink/common/switches.cc
third_party/blink/public/common/switches.h
third_party/blink/renderer/core/exported/web_view_impl.cc
third_party/blink/renderer/core/page/chrome_client_impl.cc

index ec8e9ec..d9e145f 100644 (file)
@@ -3564,6 +3564,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
 #endif
 #if BUILDFLAG(IS_EFL)
     autofill::switches::kDisableAutofill,
+    blink::switches::kUseInternalPopupMenu,
 #endif
 #if BUILDFLAG(IS_TIZEN)
     switches::kDiscardableMemoryLimit,
index 42ba66d..ef52962 100644 (file)
@@ -119,8 +119,10 @@ void SetRuntimeFeatureDefaultsForPlatform(
 
 #if BUILDFLAG(IS_EFL)
   // No plan to support complex UI for date/time INPUT types.
-  WebRuntimeFeatures::EnableInputMultipleFieldsUI(false);
-
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          blink::switches::kUseInternalPopupMenu)) {
+    WebRuntimeFeatures::EnableInputMultipleFieldsUI(false);
+  }
   // Small accelerated 2d canvas has tct issues, which are known in
   // upstream version also.
   WebRuntimeFeatures::EnableAcceleratedSmallCanvases(false);
index a77485d..2ea05a9 100644 (file)
@@ -547,6 +547,13 @@ void RenderThreadImpl::Init() {
 
   render_thread = this;
   g_main_task_runner.Get() = base::SingleThreadTaskRunner::GetCurrentDefault();
+#if BUILDFLAG(IS_EFL)
+  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+          blink::switches::kUseInternalPopupMenu)) {
+    blink::WebView::SetUseExternalPopupMenus(false);
+  }
+#endif
+
 
   // Register this object as the main thread.
   ChildProcess::current()->set_main_thread(this);
index a903de0..6ac42ab 100644 (file)
@@ -195,5 +195,9 @@ extern const char kSendMouseEventsDisabledFormControlsPolicy_ForceDisable[] =
 extern const char kSendMouseEventsDisabledFormControlsPolicy_ForceEnable[] =
     "1";
 
+// Enables internal popup menu
+#if BUILDFLAG(IS_EFL)
+const char kUseInternalPopupMenu[] = "use-internal-popup-menu";
+#endif
 }  // namespace switches
 }  // namespace blink
index d2c2b0f..2612806 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_SWITCHES_H_
 #define THIRD_PARTY_BLINK_PUBLIC_COMMON_SWITCHES_H_
 
+#include "build/build_config.h"
 #include "third_party/blink/public/common/common_export.h"
 
 namespace blink {
@@ -75,6 +76,9 @@ BLINK_COMMON_EXPORT extern const char
 BLINK_COMMON_EXPORT extern const char kTouchTextSelectionStrategy[];
 BLINK_COMMON_EXPORT extern const char kTouchTextSelectionStrategy_Character[];
 BLINK_COMMON_EXPORT extern const char kTouchTextSelectionStrategy_Direction[];
+#if BUILDFLAG(IS_EFL)
+BLINK_COMMON_EXPORT extern const char kUseInternalPopupMenu[];
+#endif
 BLINK_COMMON_EXPORT extern const char kWebSQLAccess[];
 
 }  // namespace switches
index 684ef49..b476c64 100644 (file)
@@ -1799,6 +1799,10 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
   web_view_impl->SetIgnoreViewportTagScaleLimits(prefs.force_enable_zoom);
   settings->SetLoadWithOverviewMode(prefs.shrinks_viewport_contents_to_fit);
   settings->SetUsesEncodingDetector(prefs.uses_encoding_detector);
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          blink::switches::kUseInternalPopupMenu)) {
+    RuntimeEnabledFeatures::SetPagePopupEnabled(false);
+  }
 #endif
 
 #if BUILDFLAG(IS_TIZEN)
index bb97131..2e1c196 100644 (file)
@@ -711,12 +711,6 @@ ColorChooser* ChromeClientImpl::OpenColorChooser(
   NotifyPopupOpeningObservers();
   ColorChooserUIController* controller = nullptr;
 
-#if defined(USE_EFL)
-  // EFL port's color picker implementation is based on
-  // ColorChooserUIController, similar to Android's impl.
-  controller =
-      MakeGarbageCollected<ColorChooserUIController>(frame, chooser_client);
-#else
   if (RuntimeEnabledFeatures::PagePopupEnabled()) {
     controller = MakeGarbageCollected<ColorChooserPopupUIController>(
         frame, this, chooser_client);
@@ -727,7 +721,6 @@ ColorChooser* ChromeClientImpl::OpenColorChooser(
     controller =
         MakeGarbageCollected<ColorChooserUIController>(frame, chooser_client);
   }
-#endif
   controller->OpenUI();
   return controller;
 }