diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp index 48385f8..a11804b 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp @@ -898,7 +898,7 @@ bool ChromeClientImpl::hasOpenedPopup() const { PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { notifyPopupOpeningObservers(); - if (WebViewImpl::useExternalPopupMenus()) + if (m_webView->useExternalPopupMenus()) return new ExternalPopupMenu(frame, select, *m_webView); DCHECK(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp index 365a716..c1519f8 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp @@ -357,6 +357,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, m_enableFakePageScaleAnimationForTesting(false), m_fakePageScaleAnimationPageScaleFactor(0), m_fakePageScaleAnimationUseAnchor(false), + m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus), m_compositorDeviceScaleFactorOverride(0), m_suppressNextKeypressEvent(false), m_imeAcceptEvents(true), @@ -3699,8 +3700,13 @@ void WebViewImpl::mainFrameScrollOffsetChanged() { m_devToolsEmulator->mainFrameScrollOrScaleChanged(); } +void WebViewImpl::setUseExternalPopupMenusThisInstance( + bool useExternalPopupMenus) { + m_shouldUseExternalPopupMenus = useExternalPopupMenus; +} + bool WebViewImpl::useExternalPopupMenus() { - return shouldUseExternalPopupMenus; + return m_shouldUseExternalPopupMenus; } void WebViewImpl::setBackgroundColorOverride(WebColor color) { diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h index f94b695..4828185 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h @@ -369,7 +369,8 @@ class WEB_EXPORT WebViewImpl final // 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); + bool useExternalPopupMenus(); bool shouldAutoResize() const { return m_shouldAutoResize; } @@ -652,6 +653,8 @@ class WEB_EXPORT WebViewImpl final float m_fakePageScaleAnimationPageScaleFactor; bool m_fakePageScaleAnimationUseAnchor; + bool m_shouldUseExternalPopupMenus; + float m_compositorDeviceScaleFactorOverride; TransformationMatrix m_deviceEmulationTransform; diff --git public/web/WebView.h public/web/WebView.h index 92bdf07..1a813a9 100644 --- public/web/WebView.h +++ public/web/WebView.h @@ -402,6 +402,7 @@ class WebView : protected WebWidget { // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void setUseExternalPopupMenus(bool); + virtual void setUseExternalPopupMenusThisInstance(bool) = 0; // Hides any popup (suggestions, selects...) that might be showing. virtual void hidePopups() = 0;