Index: chrome/browser/ui/views/frame/contents_web_view.cc |
diff --git a/chrome/browser/ui/views/frame/contents_web_view.cc b/chrome/browser/ui/views/frame/contents_web_view.cc |
index f77f34515dd190739e49d64309bea88f202821c0..886f3058fe6e1203052601258227767235a03509 100644 |
--- a/chrome/browser/ui/views/frame/contents_web_view.cc |
+++ b/chrome/browser/ui/views/frame/contents_web_view.cc |
@@ -6,6 +6,7 @@ |
#include "chrome/browser/themes/theme_properties.h" |
#include "chrome/browser/ui/views/status_bubble_views.h" |
+#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/web_contents.h" |
#include "ui/base/theme_provider.h" |
#include "ui/compositor/layer_tree_owner.h" |
@@ -64,6 +65,12 @@ void ContentsWebView::OnThemeChanged() { |
SkColorGetG(ntp_background) * kBackgroundBrightness / 0xFF, |
SkColorGetB(ntp_background) * kBackgroundBrightness / 0xFF, |
SkColorGetA(ntp_background))); |
+ |
+ content::RenderWidgetHostView* rwhv = nullptr; |
+ if (web_contents()) |
+ rwhv = web_contents()->GetRenderWidgetHostView(); |
+ if (rwhv) |
sky
2016/05/02 20:04:33
nit: move inside if block on 70 (or early return i
chrishtr
2016/05/02 20:24:02
Done.
|
+ rwhv->SetBackgroundColor(ntp_background); |
} |
void ContentsWebView::OnLayerRecreated(ui::Layer* old_layer, |
@@ -114,3 +121,9 @@ void ContentsWebView::DestroyClonedLayer() { |
SetPaintToLayer(false); |
set_layer_owner_delegate(nullptr); |
} |
+ |
+void ContentsWebView::RenderViewReady() { |
+ // Apply the theme color to be the default background on startup. |
+ OnThemeChanged(); |
+ WebView::RenderViewReady(); |
+} |