2017-01-13 22:35:26 +01:00
|
|
|
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
|
2023-08-09 23:17:17 +02:00
|
|
|
index 628724f3cc5c9..3a26148fac2a7 100644
|
2017-01-13 22:35:26 +01:00
|
|
|
--- content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
|
|
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
|
2022-08-23 03:37:40 +02:00
|
|
|
@@ -6,6 +6,7 @@
|
2022-01-25 21:26:51 +01:00
|
|
|
|
2022-08-23 03:37:40 +02:00
|
|
|
#include <limits>
|
2022-01-25 21:26:51 +01:00
|
|
|
#include <memory>
|
|
|
|
+#include <tuple>
|
|
|
|
#include <set>
|
|
|
|
#include <utility>
|
|
|
|
|
2023-08-09 23:17:17 +02:00
|
|
|
@@ -739,10 +740,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() {
|
2018-05-21 14:54:08 +02:00
|
|
|
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
|
|
|
|
DCHECK(GetBackgroundColor());
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2018-05-21 14:54:08 +02:00
|
|
|
- SkColor color = *GetBackgroundColor();
|
2018-04-19 17:44:42 +02:00
|
|
|
- bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
|
2017-01-13 22:35:26 +01:00
|
|
|
- window_->layer()->SetFillsBoundsOpaquely(opaque);
|
|
|
|
- window_->layer()->SetColor(color);
|
|
|
|
+ if (window_) {
|
2018-05-21 14:54:08 +02:00
|
|
|
+ SkColor color = *GetBackgroundColor();
|
2018-04-19 17:44:42 +02:00
|
|
|
+ bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
|
2017-01-13 22:35:26 +01:00
|
|
|
+ window_->layer()->SetFillsBoundsOpaquely(opaque);
|
|
|
|
+ window_->layer()->SetColor(color);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
2023-08-09 23:17:17 +02:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
|
|
|
@@ -2355,6 +2358,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
2021-01-28 00:13:12 +01:00
|
|
|
// This needs to happen only after |window_| has been initialized using
|
2019-07-16 19:59:21 +02:00
|
|
|
// Init(), because it needs to have the layer.
|
2021-01-28 00:13:12 +01:00
|
|
|
window_->SetEmbedFrameSinkId(frame_sink_id_);
|
2019-07-16 19:59:21 +02:00
|
|
|
+
|
2017-09-05 17:41:34 +02:00
|
|
|
+ // Do this after |window_| is created to avoid crashes on Win10.
|
|
|
|
+ // See https://crbug.com/761389.
|
2020-08-29 00:39:23 +02:00
|
|
|
+ auto web_contents =
|
|
|
|
+ WebContents::FromRenderViewHost(RenderViewHost::From(host_));
|
|
|
|
+ if (web_contents) {
|
2017-09-05 17:41:34 +02:00
|
|
|
+ // TODO(mostynb): actually use prefs. Landing this as a separate CL
|
|
|
|
+ // first to rebaseline some unreliable layout tests.
|
2022-01-25 21:26:51 +01:00
|
|
|
+ std::ignore = web_contents->GetOrCreateWebPreferences();
|
2017-09-05 17:41:34 +02:00
|
|
|
+ }
|
2019-07-16 19:59:21 +02:00
|
|
|
}
|
2017-09-05 17:41:34 +02:00
|
|
|
|
2019-07-16 19:59:21 +02:00
|
|
|
void RenderWidgetHostViewAura::CreateDelegatedFrameHostClient() {
|