extend_apply_webpreferences.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Samuel Attard <[email protected]>
  3. Date: Mon, 8 Mar 2021 16:27:39 -0800
  4. Subject: extend ApplyWebPreferences with Electron-specific logic
  5. background_color can be updated at runtime, as such we need to apply the
  6. new background color to the WebView in the ApplyPreferences method.
  7. There is no current way to attach an observer to these prefs so patching
  8. is our only option.
  9. Ideally we could add an embedder observer pattern here but that can be
  10. done in future work.
  11. diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
  12. index bf141e3d121736ac38ae918cbe8400ee92325824..72fddbeb82f8b662381a10e7e01d4a54be15db9b 100644
  13. --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
  14. +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
  15. @@ -169,6 +169,7 @@
  16. #include "third_party/blink/renderer/core/view_transition/view_transition_supplement.h"
  17. #include "third_party/blink/renderer/platform/fonts/font_cache.h"
  18. #include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h"
  19. +#include "third_party/blink/renderer/platform/graphics/color.h"
  20. #include "third_party/blink/renderer/platform/graphics/image.h"
  21. #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
  22. #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
  23. @@ -1866,6 +1867,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
  24. #if BUILDFLAG(IS_MAC)
  25. web_view_impl->SetMaximumLegibleScale(
  26. prefs.default_maximum_page_scale_factor);
  27. + SetUseExternalPopupMenus(!prefs.offscreen);
  28. #endif
  29. #if BUILDFLAG(IS_WIN)