diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h index 36d767e51b2f..4425dfeaa786 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h @@ -358,6 +358,7 @@ class WebView { // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void SetUseExternalPopupMenus(bool); + virtual void SetUseExternalPopupMenusThisInstance(bool) = 0; // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc index 92529f378bb2..7ec3894f996c 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -234,8 +234,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { g_should_use_external_popup_menus = use_external_popup_menus; } -bool WebViewImpl::UseExternalPopupMenus() { - return g_should_use_external_popup_menus; +void WebViewImpl::SetUseExternalPopupMenusThisInstance( + bool use_external_popup_menus) { + should_use_external_popup_menus_ = use_external_popup_menus; +} + +bool WebViewImpl::UseExternalPopupMenus() const { + return should_use_external_popup_menus_; } namespace { @@ -297,6 +302,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, chrome_client_(ChromeClientImpl::Create(this)), minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)), + should_use_external_popup_menus_(g_should_use_external_popup_menus), does_composite_(does_composite), fullscreen_controller_(std::make_unique(this)) { if (!AsView().client) { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h index d161ab3cf8af..6b655c488a0a 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h @@ -106,7 +106,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). - static bool UseExternalPopupMenus(); + void SetUseExternalPopupMenusThisInstance(bool) override; + bool UseExternalPopupMenus() const; // WebView methods: void DidAttachLocalMainFrame(WebWidgetClient*) override; @@ -616,6 +617,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; + bool should_use_external_popup_menus_; + float compositor_device_scale_factor_override_ = 0.f; TransformationMatrix device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc index c9e907264bfe..4b4395144ba5 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc @@ -823,7 +823,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); - if (WebViewImpl::UseExternalPopupMenus()) + if (web_view_->UseExternalPopupMenus()) return MakeGarbageCollected(frame, select, *web_view_); DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());