diff --git third_party/blink/common/web_preferences/web_preferences.cc third_party/blink/common/web_preferences/web_preferences.cc index 030a534b2fd1..934abdbc22e6 100644 --- third_party/blink/common/web_preferences/web_preferences.cc +++ third_party/blink/common/web_preferences/web_preferences.cc @@ -149,6 +149,7 @@ WebPreferences::WebPreferences() animation_policy( blink::mojom::ImageAnimationPolicy::kImageAnimationPolicyAllowed), user_gesture_required_for_presentation(true), + base_background_color(0xFFFFFFFF), // Color::kWhite text_tracks_enabled(false), text_track_margin_percentage(0.0f), immersive_mode_enabled(false), diff --git third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc index 945a58c91efa..b5bee8f615ef 100644 --- third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +++ third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc @@ -273,6 +273,7 @@ bool StructTraitsuser_gesture_required_for_presentation = data.user_gesture_required_for_presentation(); + out->base_background_color = data.base_background_color(); out->text_tracks_enabled = data.text_tracks_enabled(); out->text_track_margin_percentage = data.text_track_margin_percentage(); out->immersive_mode_enabled = data.immersive_mode_enabled(); diff --git third_party/blink/public/common/web_preferences/web_preferences.h third_party/blink/public/common/web_preferences/web_preferences.h index e2fb2d1d46d3..0783c9145510 100644 --- third_party/blink/public/common/web_preferences/web_preferences.h +++ third_party/blink/public/common/web_preferences/web_preferences.h @@ -172,6 +172,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { bool user_gesture_required_for_presentation; + uint32_t base_background_color; + bool text_tracks_enabled; // These fields specify the foreground and background color for WebVTT text diff --git third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h index c40048e55b16..1e5843fc33d2 100644 --- third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h @@ -476,6 +476,11 @@ struct BLINK_COMMON_EXPORT StructTraits(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(this)), receiver_(this, @@ -1801,6 +1807,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, RuntimeEnabledFeatures::SetTranslateServiceEnabled( prefs.translate_service_available); + + web_view->SetBaseBackgroundColor(prefs.base_background_color); } void WebViewImpl::ThemeChanged() { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h index 165699ca8d92..d0db1ed1869a 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h @@ -126,7 +126,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& 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_; } @@ -711,6 +712,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, 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; 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 4eddfdf0921a..555fb3a95139 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc @@ -805,7 +805,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); - if (WebViewImpl::UseExternalPopupMenus()) + if (web_view_->UseExternalPopupMenus()) return MakeGarbageCollected(frame, select); DCHECK(RuntimeEnabledFeatures::PagePopupEnabled());