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

Unified Diff: chrome/browser/browser_theme_provider.cc

Issue 174562: Fix theme caching on Vista 64 when default theme is installed from the theme ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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/browser_theme_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_theme_provider.cc
===================================================================
--- chrome/browser/browser_theme_provider.cc (revision 24615)
+++ chrome/browser/browser_theme_provider.cc (working copy)
@@ -496,9 +496,11 @@
process_images_ = true;
GenerateFrameColors();
- GenerateFrameImages();
- GenerateTabImages();
- WriteImagesToDisk();
+ if (ShouldTintFrames()) {
+ GenerateFrameImages();
+ GenerateTabImages();
+ WriteImagesToDisk();
+ }
NotifyThemeChanged();
UserMetrics::RecordAction(L"Themes_Installed", profile_);
@@ -924,9 +926,7 @@
frame.reset(NULL);
} else {
// If the theme doesn't specify an image, then apply the tint to
- // the default frame. Note that the default theme provides default
- // bitmaps for all frame types, so this isn't strictly necessary
- // in the case where no tint is provided either.
+ // the default frame.
frame.reset(new SkBitmap(*rb_.GetBitmapNamed(IDR_THEME_FRAME)));
}
@@ -940,6 +940,15 @@
}
}
+bool BrowserThemeProvider::ShouldTintFrames() {
+ return (HasCustomImage(IDR_THEME_FRAME) ||
+ tints_.find(GetTintKey(TINT_BACKGROUND_TAB)) != tints_.end() ||
+ tints_.find(GetTintKey(TINT_FRAME)) != tints_.end() ||
+ tints_.find(GetTintKey(TINT_FRAME_INACTIVE)) != tints_.end() ||
+ tints_.find(GetTintKey(TINT_FRAME_INCOGNITO)) != tints_.end() ||
+ tints_.find(GetTintKey(TINT_FRAME_INCOGNITO_INACTIVE)) != tints_.end());
+}
+
void BrowserThemeProvider::GenerateTabImages() {
GenerateBitmap(IDR_THEME_TAB_BACKGROUND);
GenerateBitmap(IDR_THEME_TAB_BACKGROUND_INCOGNITO);
« no previous file with comments | « chrome/browser/browser_theme_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698