cef/patch/patches/webkit_popups.patch

95 lines
4.4 KiB
Diff

diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h
index 3a49f93fe488..b8c84c72188a 100644
--- third_party/blink/public/web/web_view.h
+++ third_party/blink/public/web/web_view.h
@@ -325,6 +325,7 @@ class WebView {
// 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;
@@ -349,6 +350,8 @@ class WebView {
unsigned inactive_background_color,
unsigned inactive_foreground_color) = 0;
+ virtual void SetBaseBackgroundColor(SkColor color) = 0;
+
// Modal dialog support ------------------------------------------------
// Call these methods before and after running a nested, modal event loop
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
index 295828c1f467..24868ae69280 100644
--- third_party/blink/renderer/core/exported/web_view_impl.cc
+++ third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -234,8 +234,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 {
@@ -310,6 +315,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/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
index bcb1519760fe..da720ab3b922 100644
--- third_party/blink/renderer/core/exported/web_view_impl.h
+++ third_party/blink/renderer/core/exported/web_view_impl.h
@@ -107,7 +107,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
static HashSet<WebViewImpl*>& AllInstances();
// 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) override;
+ bool UseExternalPopupMenus() const;
// WebWidget methods:
void SetLayerTreeView(WebLayerTreeView*) override;
@@ -247,7 +248,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
HitTestResult CoreHitTestResultAt(const gfx::Point&);
void InvalidateRect(const IntRect&);
- void SetBaseBackgroundColor(SkColor);
+ void SetBaseBackgroundColor(SkColor) override;
void SetBaseBackgroundColorOverride(SkColor);
void ClearBaseBackgroundColorOverride();
void SetBackgroundColorOverride(SkColor);
@@ -596,6 +597,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
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/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
index 76213af6df93..cab9fbb91ff1 100644
--- third_party/blink/renderer/core/page/chrome_client_impl.cc
+++ third_party/blink/renderer/core/page/chrome_client_impl.cc
@@ -797,7 +797,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
HTMLSelectElement& select) {
NotifyPopupOpeningObservers();
- if (WebViewImpl::UseExternalPopupMenus())
+ if (web_view_->UseExternalPopupMenus())
return new ExternalPopupMenu(frame, select, *web_view_);
DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());