cef/patch/patches/webkit_popups.patch
2018-02-22 13:05:53 -05:00

95 lines
4.2 KiB
Diff

diff --git third_party/WebKit/Source/core/exported/WebViewImpl.cpp third_party/WebKit/Source/core/exported/WebViewImpl.cpp
index d0c5134a2ad6..1434134d4212 100644
--- third_party/WebKit/Source/core/exported/WebViewImpl.cpp
+++ third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -258,8 +258,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 {
@@ -350,6 +355,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
enable_fake_page_scale_animation_for_testing_(false),
fake_page_scale_animation_page_scale_factor_(0),
fake_page_scale_animation_use_anchor_(false),
+ should_use_external_popup_menus_(g_should_use_external_popup_menus),
compositor_device_scale_factor_override_(0),
suppress_next_keypress_event_(false),
ime_accept_events_(true),
diff --git third_party/WebKit/Source/core/exported/WebViewImpl.h third_party/WebKit/Source/core/exported/WebViewImpl.h
index 79a702679fec..babc626a91bf 100644
--- third_party/WebKit/Source/core/exported/WebViewImpl.h
+++ third_party/WebKit/Source/core/exported/WebViewImpl.h
@@ -107,7 +107,8 @@ class CORE_EXPORT WebViewImpl final
static const WebInputEvent* CurrentInputEvent();
// 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() const;
// WebWidget methods:
void Close() override;
@@ -256,7 +257,7 @@ class CORE_EXPORT WebViewImpl final
HitTestResult CoreHitTestResultAt(const WebPoint&);
void InvalidateRect(const IntRect&);
- void SetBaseBackgroundColor(WebColor);
+ void SetBaseBackgroundColor(WebColor) override;
void SetBaseBackgroundColorOverride(WebColor);
void ClearBaseBackgroundColorOverride();
void SetBackgroundColorOverride(WebColor);
@@ -608,6 +609,8 @@ class CORE_EXPORT WebViewImpl final
float fake_page_scale_animation_page_scale_factor_;
bool fake_page_scale_animation_use_anchor_;
+ bool should_use_external_popup_menus_;
+
float compositor_device_scale_factor_override_;
TransformationMatrix device_emulation_transform_;
diff --git third_party/WebKit/Source/core/page/ChromeClientImpl.cpp third_party/WebKit/Source/core/page/ChromeClientImpl.cpp
index 98618289cfab..ec154753a350 100644
--- third_party/WebKit/Source/core/page/ChromeClientImpl.cpp
+++ third_party/WebKit/Source/core/page/ChromeClientImpl.cpp
@@ -774,7 +774,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
return nullptr;
NotifyPopupOpeningObservers();
- if (WebViewImpl::UseExternalPopupMenus())
+ if (web_view_->UseExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *web_view_);
DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());
diff --git third_party/WebKit/public/web/WebView.h third_party/WebKit/public/web/WebView.h
index 8f30d3c30bac..062ae5e643bb 100644
--- third_party/WebKit/public/web/WebView.h
+++ third_party/WebKit/public/web/WebView.h
@@ -360,6 +360,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;
@@ -390,6 +391,8 @@ class WebView : protected WebWidget {
unsigned inactive_background_color,
unsigned inactive_foreground_color) = 0;
+ virtual void SetBaseBackgroundColor(WebColor color) = 0;
+
// Modal dialog support ------------------------------------------------
// Call these methods before and after running a nested, modal event loop