Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2194)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1943183002: Transfer theme & page background colors between changes of RWHV. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@noflash
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 51d18a0b1a43a10a6ce486dac2d2a40ee032d1b5..ad40aebbd9e63fdcce4c91bfdf52898ad47e5ed5 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1061,6 +1061,16 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
std::unique_ptr<cc::CompositorFrame> frame) {
TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
+ // Override the background color to the current compositor background.
+ // This allows us to, when navigating to a new page, transfer this color
+ // (via code in ContentsWebView) between the current RenderWidgetHost and
+ // the new one, avoiding a flash of the theme color in between.
+ // See crbug.com/470669.
+ // Setting the page's background color here should also have better quality
+ // output in cases when the window's root layer peeks out from the content
+ // layers.
+ SetBackgroundColor(frame->metadata.root_background_color);
+
last_scroll_offset_ = frame->metadata.root_scroll_offset;
if (!frame->delegated_frame_data)
return;

Powered by Google App Engine
This is Rietveld 408576698