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

Unified Diff: chrome/browser/ui/views/frame/contents_web_view.cc

Issue 1939913002: Use the NTP background color instead of white when there is no other info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « chrome/browser/ui/views/frame/contents_web_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..151823ad34a7d75b21e0648aed23847077a88832 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,14 @@ void ContentsWebView::OnThemeChanged() {
SkColorGetG(ntp_background) * kBackgroundBrightness / 0xFF,
SkColorGetB(ntp_background) * kBackgroundBrightness / 0xFF,
SkColorGetA(ntp_background)));
+
+
+ if (web_contents()) {
+ content::RenderWidgetHostView* rwhv =
+ web_contents()->GetRenderWidgetHostView();
+ if (rwhv)
+ rwhv->SetBackgroundColor(ntp_background);
+ }
}
void ContentsWebView::OnLayerRecreated(ui::Layer* old_layer,
@@ -114,3 +123,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();
+}
« no previous file with comments | « chrome/browser/ui/views/frame/contents_web_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698