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

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

Issue 2466413009: Propagate view background color when changing visible web contents. (Closed)
Patch Set: none Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/renderer_host/render_widget_host_view_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2ed1c42890ba53f5e6532d609fc8b23a61006c17..9d0d19e8ce679bfecf89444937bbf517980a00a7 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -756,6 +756,8 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const {
}
void RenderWidgetHostViewAura::SetBackgroundColor(SkColor color) {
+ if (color == background_color())
+ return;
RenderWidgetHostViewBase::SetBackgroundColor(color);
bool opaque = GetBackgroundOpaque();
host_->SetBackgroundOpaque(opaque);
@@ -906,6 +908,12 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
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 to
+ // that page. This allows us to pass this background color to new views on
+ // navigation.
+ SetBackgroundColor(frame.metadata.root_background_color);
+
last_scroll_offset_ = frame.metadata.root_scroll_offset;
if (frame.render_pass_list.empty())
return;
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/renderer_host/render_widget_host_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698