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

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

Issue 2872663002: Avoid DCHECK when installing a theme with non-opaque NTP bg color. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | 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 fab9246b5a424ba911b62f66af0d71ec09b88176..57f200477772ff0b52508f349b7010fd37e45ba3 100644
--- a/chrome/browser/ui/views/frame/contents_web_view.cc
+++ b/chrome/browser/ui/views/frame/contents_web_view.cc
@@ -58,8 +58,9 @@ void ContentsWebView::OnThemeChanged() {
// view is sized specially for fullscreen tab capture. See WebView header
// file comments for more details.
const int kBackgroundBrightness = 0x33; // 20%
- const SkColor ntp_background =
- theme->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND);
+ // Make sure the background is opaque.
+ const SkColor ntp_background = color_utils::GetResultingPaintColor(
+ theme->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND), SK_ColorWHITE);
set_background(views::Background::CreateSolidBackground(
SkColorGetR(ntp_background) * kBackgroundBrightness / 0xFF,
SkColorGetG(ntp_background) * kBackgroundBrightness / 0xFF,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698