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

Unified Diff: chrome/browser/browser_theme_provider.cc

Issue 173638: Merge 24830 - If a preferences file references a theme which is from an old v... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/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 | « 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/browser_theme_provider.cc
===================================================================
--- chrome/browser/browser_theme_provider.cc (revision 24974)
+++ chrome/browser/browser_theme_provider.cc (working copy)
@@ -1125,9 +1125,7 @@
}
void BrowserThemeProvider::LoadThemePrefs() {
- // Images were already processed when theme was set.
process_images_ = false;
-
PrefService* prefs = profile_->GetPrefs();
// TODO(glen): Figure out if any custom prefs were loaded, and if so
@@ -1143,9 +1141,27 @@
SetTintData(prefs->GetMutableDictionary(prefs::kCurrentThemeTints));
SetDisplayPropertyData(
prefs->GetMutableDictionary(prefs::kCurrentThemeDisplayProperties));
+
+ // If we're not loading the frame from the cached image dir, we are using
+ // an old preferences file, or the processed images were not saved
+ // correctly. Force image reprocessing and caching.
+ if (images_.count(IDR_THEME_FRAME) > 0) {
+#if defined(OS_WIN)
+ FilePath cache_path = FilePath(UTF8ToWide(images_[IDR_THEME_FRAME]));
+#else
+ FilePath cache_path = FilePath(images_[IDR_THEME_FRAME]);
+#endif
+ process_images_ = !file_util::ContainsPath(image_dir_, cache_path);
+ }
+
GenerateFrameColors();
GenerateFrameImages();
GenerateTabImages();
+ if (process_images_) {
+ WriteImagesToDisk();
+ UserMetrics::RecordAction(L"Migrated noncached to cached theme.",
+ profile_);
+ }
UserMetrics::RecordAction(L"Themes_loaded", profile_);
}
}
Property changes on: chrome\browser\browser_theme_provider.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/browser_theme_provider.cc:r24830
« 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