2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h
|
2020-03-04 01:29:39 +01:00
|
|
|
index a6d03eca18db..d84e8615150c 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/public/web/web_view.h
|
|
|
|
+++ third_party/blink/public/web/web_view.h
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -367,6 +367,7 @@ class WebView {
|
2018-04-19 17:44:42 +02:00
|
|
|
|
|
|
|
// Sets whether select popup menus should be rendered by the browser.
|
|
|
|
BLINK_EXPORT static void SetUseExternalPopupMenus(bool);
|
|
|
|
+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0;
|
|
|
|
|
2019-01-17 10:56:52 +01:00
|
|
|
// Cancels and hides the current popup (datetime, select...) if any.
|
|
|
|
virtual void CancelPagePopup() = 0;
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc
|
2020-03-04 01:29:39 +01:00
|
|
|
index 7f58ed742695..2149f7815d57 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/exported/web_view_impl.cc
|
|
|
|
+++ third_party/blink/renderer/core/exported/web_view_impl.cc
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -216,8 +216,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) {
|
2017-09-06 23:40:58 +02:00
|
|
|
g_should_use_external_popup_menus = use_external_popup_menus;
|
|
|
|
}
|
2017-05-31 17:33:30 +02:00
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
-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_;
|
|
|
|
}
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
namespace {
|
2020-02-10 18:10:17 +01:00
|
|
|
@@ -275,6 +280,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client,
|
2019-06-05 16:15:45 +02:00
|
|
|
chrome_client_(MakeGarbageCollected<ChromeClientImpl>(this)),
|
2019-11-12 17:11:44 +01:00
|
|
|
minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)),
|
|
|
|
maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)),
|
2017-04-20 21:28:17 +02:00
|
|
|
+ should_use_external_popup_menus_(g_should_use_external_popup_menus),
|
2019-02-21 01:42:36 +01:00
|
|
|
does_composite_(does_composite),
|
2019-04-16 16:38:48 +02:00
|
|
|
fullscreen_controller_(std::make_unique<FullscreenController>(this)) {
|
2019-02-21 01:42:36 +01:00
|
|
|
if (!AsView().client) {
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h
|
2020-03-04 01:29:39 +01:00
|
|
|
index 710607bd9112..829d2f55d79d 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/exported/web_view_impl.h
|
|
|
|
+++ third_party/blink/renderer/core/exported/web_view_impl.h
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -112,7 +112,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
2018-03-20 21:15:08 +01:00
|
|
|
static HashSet<WebViewImpl*>& AllInstances();
|
2016-10-21 21:52:29 +02:00
|
|
|
// Returns true if popup menus should be rendered by the browser, false if
|
|
|
|
// they should be rendered by WebKit (which is the default).
|
2017-04-20 21:28:17 +02:00
|
|
|
- static bool UseExternalPopupMenus();
|
2018-05-21 14:54:08 +02:00
|
|
|
+ void SetUseExternalPopupMenusThisInstance(bool) override;
|
2017-09-06 23:40:58 +02:00
|
|
|
+ bool UseExternalPopupMenus() const;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2019-10-01 15:55:16 +02:00
|
|
|
// Returns whether frames under this WebView are backed by a compositor.
|
|
|
|
bool does_composite() const { return does_composite_; }
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -610,6 +611,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
2019-02-21 01:42:36 +01:00
|
|
|
float fake_page_scale_animation_page_scale_factor_ = 0.f;
|
|
|
|
bool fake_page_scale_animation_use_anchor_ = false;
|
2016-10-21 21:52:29 +02:00
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
+ bool should_use_external_popup_menus_;
|
2014-07-01 00:30:29 +02:00
|
|
|
+
|
2019-02-21 01:42:36 +01:00
|
|
|
float compositor_device_scale_factor_override_ = 0.f;
|
2017-04-20 21:28:17 +02:00
|
|
|
TransformationMatrix device_emulation_transform_;
|
2017-01-23 18:36:54 +01:00
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
|
2020-03-04 01:29:39 +01:00
|
|
|
index bd1ea48823f0..4b13696f3996 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/page/chrome_client_impl.cc
|
|
|
|
+++ third_party/blink/renderer/core/page/chrome_client_impl.cc
|
2020-03-04 01:29:39 +01:00
|
|
|
@@ -850,7 +850,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
|
2018-05-14 13:24:05 +02:00
|
|
|
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
|
|
|
|
HTMLSelectElement& select) {
|
2017-09-06 23:40:58 +02:00
|
|
|
NotifyPopupOpeningObservers();
|
|
|
|
- if (WebViewImpl::UseExternalPopupMenus())
|
|
|
|
+ if (web_view_->UseExternalPopupMenus())
|
2019-10-01 15:55:16 +02:00
|
|
|
return MakeGarbageCollected<ExternalPopupMenu>(frame, select);
|
2017-09-06 23:40:58 +02:00
|
|
|
|
|
|
|
DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());
|