2021-07-23 18:40:13 +02:00
|
|
|
diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h
|
2023-04-04 20:00:13 +02:00
|
|
|
index 2c3930e849719..12c81c7c0e7e6 100644
|
2021-07-23 18:40:13 +02:00
|
|
|
--- third_party/blink/public/web/web_view.h
|
|
|
|
+++ third_party/blink/public/web/web_view.h
|
2023-04-04 20:00:13 +02:00
|
|
|
@@ -342,6 +342,7 @@ class BLINK_EXPORT WebView {
|
2021-07-23 18:40:13 +02:00
|
|
|
|
|
|
|
// Sets whether select popup menus should be rendered by the browser.
|
2022-09-26 21:30:45 +02:00
|
|
|
static void SetUseExternalPopupMenus(bool);
|
2021-07-23 18:40:13 +02:00
|
|
|
+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0;
|
|
|
|
|
|
|
|
// Cancels and hides the current popup (datetime, select...) if any.
|
|
|
|
virtual void CancelPagePopup() = 0;
|
|
|
|
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
|
2023-04-04 20:00:13 +02:00
|
|
|
index bb5b2ecb90889..6a1a7c47e8c86 100644
|
2021-07-23 18:40:13 +02:00
|
|
|
--- third_party/blink/renderer/core/exported/web_view_impl.cc
|
|
|
|
+++ third_party/blink/renderer/core/exported/web_view_impl.cc
|
2023-02-27 19:52:38 +01:00
|
|
|
@@ -250,8 +250,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) {
|
2021-07-23 18:40:13 +02:00
|
|
|
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 {
|
2023-04-04 20:00:13 +02:00
|
|
|
@@ -567,6 +572,7 @@ WebViewImpl::WebViewImpl(
|
2021-07-23 18:40:13 +02:00
|
|
|
chrome_client_(MakeGarbageCollected<ChromeClientImpl>(this)),
|
|
|
|
minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)),
|
|
|
|
maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)),
|
|
|
|
+ should_use_external_popup_menus_(g_should_use_external_popup_menus),
|
|
|
|
does_composite_(does_composite),
|
|
|
|
fullscreen_controller_(std::make_unique<FullscreenController>(this)),
|
|
|
|
page_base_background_color_(
|
|
|
|
diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
|
2023-04-04 20:00:13 +02:00
|
|
|
index 421ca0b15eea5..4802d65c6dc4f 100644
|
2021-07-23 18:40:13 +02:00
|
|
|
--- third_party/blink/renderer/core/exported/web_view_impl.h
|
|
|
|
+++ third_party/blink/renderer/core/exported/web_view_impl.h
|
2023-04-04 20:00:13 +02:00
|
|
|
@@ -135,7 +135,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
2021-07-23 18:40:13 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
// Returns whether frames under this WebView are backed by a compositor.
|
|
|
|
bool does_composite() const { return does_composite_; }
|
2023-04-04 20:00:13 +02:00
|
|
|
@@ -848,6 +849,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
2021-07-23 18:40:13 +02:00
|
|
|
float fake_page_scale_animation_page_scale_factor_ = 0.f;
|
|
|
|
bool fake_page_scale_animation_use_anchor_ = false;
|
|
|
|
|
|
|
|
+ bool should_use_external_popup_menus_;
|
|
|
|
+
|
|
|
|
float compositor_device_scale_factor_override_ = 0.f;
|
2022-11-15 18:50:53 +01:00
|
|
|
gfx::Transform device_emulation_transform_;
|
2021-07-23 18:40:13 +02:00
|
|
|
|
|
|
|
diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
|
2023-04-04 20:00:13 +02:00
|
|
|
index 89a9e47e85841..fe8754953c060 100644
|
2021-07-23 18:40:13 +02:00
|
|
|
--- third_party/blink/renderer/core/page/chrome_client_impl.cc
|
|
|
|
+++ third_party/blink/renderer/core/page/chrome_client_impl.cc
|
2023-01-30 18:43:54 +01:00
|
|
|
@@ -916,7 +916,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
|
2021-07-23 18:40:13 +02:00
|
|
|
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
|
|
|
|
HTMLSelectElement& select) {
|
|
|
|
NotifyPopupOpeningObservers();
|
|
|
|
- if (WebViewImpl::UseExternalPopupMenus())
|
|
|
|
+ if (web_view_->UseExternalPopupMenus())
|
|
|
|
return MakeGarbageCollected<ExternalPopupMenu>(frame, select);
|
|
|
|
|
|
|
|
DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());
|