cef/patch/patches/webkit_popups.patch

76 lines
2.9 KiB
Diff

diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index f1a79c4..021a083 100644
--- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp
@@ -892,7 +892,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 6c8ca56..3f0d9a8 100644
--- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp
@@ -405,6 +405,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
m_enableFakePageScaleAnimationForTesting(false),
m_fakePageScaleAnimationPageScaleFactor(0),
m_fakePageScaleAnimationUseAnchor(false),
+ m_shouldUseExternalPopupMenus(shouldUseExternalPopupMenus),
m_doingDragAndDrop(false),
m_ignoreInputEvents(false),
m_compositorDeviceScaleFactorOverride(0),
@@ -4246,8 +4247,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::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index 238b096..c4feb3b 100644
--- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h
@@ -379,7 +379,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; }
@@ -684,6 +685,8 @@ class WEB_EXPORT WebViewImpl final
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 d877ff0..edfc975 100644
--- public/web/WebView.h
+++ public/web/WebView.h
@@ -440,6 +440,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;