diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp index e1fd006..fa9486b 100644 --- Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp @@ -768,7 +768,7 @@ bool ChromeClientImpl::hasOpenedPopup() const PassRefPtrWillBeRawPtr ChromeClientImpl::openPopupMenu(LocalFrame& frame, PopupMenuClient* client) { notifyPopupOpeningObservers(); - if (WebViewImpl::useExternalPopupMenus()) + if (m_webView->useExternalPopupMenus()) return adoptRefWillBeNoop(new ExternalPopupMenu(frame, client, *m_webView)); ASSERT(RuntimeEnabledFeatures::pagePopupEnabled()); diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp index 9a4161a..cf68085 100644 --- Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp @@ -397,6 +397,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationUseAnchor(false) , m_contextMenuAllowed(false) + , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus) , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) , m_compositorDeviceScaleFactorOverride(0) @@ -3946,9 +3947,14 @@ void WebViewImpl::pageScaleFactorChanged() m_client->pageScaleFactorChanged(); } +void WebViewImpl::setUseExternalPopupMenusThisInstance(bool useExternalPopupMenus) +{ + m_shouldUseExternalPopupMenus = useExternalPopupMenus; +} + bool WebViewImpl::useExternalPopupMenus() { - return shouldUseExternalPopupMenus; + return m_shouldUseExternalPopupMenus; } void WebViewImpl::startDragging(LocalFrame* frame, diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h index f222ca0..51478ce 100644 --- Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h @@ -390,7 +390,8 @@ public: // 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 contextMenuAllowed() const { @@ -677,6 +678,8 @@ private: bool m_contextMenuAllowed; + bool m_shouldUseExternalPopupMenus; + bool m_doingDragAndDrop; bool m_ignoreInputEvents; diff --git public/web/WebView.h public/web/WebView.h index 4046206..fd01e64 100644 --- public/web/WebView.h +++ public/web/WebView.h @@ -387,6 +387,7 @@ public: // 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;