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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1623643002: Fix bug when drawing background tabs in incognito windows with custom themes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 845992736580ac758a36b5adcd9f589d883f409c..d60676d95acbb7b4644d83357e082822c5eec77d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1396,12 +1396,15 @@ int TabStrip::GetBackgroundResourceId(bool* custom_image) const {
// If a custom theme does not provide a replacement tab background, but does
// provide a replacement frame image, HasCustomImage() on the tab background
// ID will return false, but the theme provider will make a custom image from
- // the frame image.
+ // the frame image. Furthermore, since the theme provider will create the
+ // incognito frame image from the normal frame image, in incognito mode we
+ // need to look for a custom incognito _or_ regular frame image.
const bool incognito = controller()->IsIncognito();
const int id = incognito ?
IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND;
const int frame_id = incognito ? IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME;
- *custom_image = tp->HasCustomImage(id) || tp->HasCustomImage(frame_id);
+ *custom_image = tp->HasCustomImage(id) || tp->HasCustomImage(frame_id) ||
+ (incognito && tp->HasCustomImage(IDR_THEME_FRAME));
return id;
}
« 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