cef/patch/patches/webkit_popups.patch
2016-07-26 13:28:54 -04:00

77 lines
2.8 KiB
Diff

diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index da897ce..c1d6cf8 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -843,7 +843,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 fcb4d10..dea498b 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -422,6 +422,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebPageVisibilityState visibilit
, m_enableFakePageScaleAnimationForTesting(false)
, m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false)
+ , m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0)
@@ -4108,9 +4109,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 5292560..08e6afe 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -382,7 +382,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 shouldAutoResize() const
{
@@ -678,6 +679,8 @@ private:
float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor;
+ bool m_shouldUseExternalPopupMenus;
+
bool m_doingDragAndDrop;
bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h
index 4f81bb6..66f1b2d 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -437,6 +437,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;