2021-03-15 22:43:25 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Samuel Attard <sattard@slack-corp.com>
|
|
|
|
Date: Mon, 8 Mar 2021 16:27:39 -0800
|
2021-05-03 13:28:14 +00:00
|
|
|
Subject: extend ApplyWebPreferences with Electron-specific logic
|
2021-03-15 22:43:25 +00:00
|
|
|
|
|
|
|
background_color can be updated at runtime, as such we need to apply the
|
|
|
|
new background color to the WebView in the ApplyPreferences method.
|
|
|
|
There is no current way to attach an observer to these prefs so patching
|
|
|
|
is our only option.
|
|
|
|
|
|
|
|
Ideally we could add an embedder observer pattern here but that can be
|
|
|
|
done in future work.
|
|
|
|
|
|
|
|
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
2022-07-20 11:03:34 +00:00
|
|
|
index 9151815e6bf33a3a6980f8337f578dc90e458696..664b8c2b0a3eb5da577a6ac9d70cafff4702a622 100644
|
2021-03-15 22:43:25 +00:00
|
|
|
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
|
|
|
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
2022-06-01 06:12:47 +00:00
|
|
|
@@ -161,6 +161,7 @@
|
2021-03-15 22:43:25 +00:00
|
|
|
#include "third_party/blink/renderer/core/timing/window_performance.h"
|
|
|
|
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
|
2022-04-12 11:19:14 +00:00
|
|
|
#include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h"
|
2021-03-15 22:43:25 +00:00
|
|
|
+#include "third_party/blink/renderer/platform/graphics/color.h"
|
|
|
|
#include "third_party/blink/renderer/platform/graphics/image.h"
|
|
|
|
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
|
|
|
|
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
|
2022-07-13 21:26:16 +00:00
|
|
|
@@ -1781,6 +1782,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_MAC)
|
2021-06-18 07:05:18 +00:00
|
|
|
web_view_impl->SetMaximumLegibleScale(
|
|
|
|
prefs.default_maximum_page_scale_factor);
|
|
|
|
+ SetUseExternalPopupMenus(!prefs.offscreen);
|
|
|
|
#endif
|
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_WIN)
|