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; |