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

Unified Diff: chrome/browser/themes/theme_service.cc

Issue 22578004: Check if theme is ready. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 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/themes/theme_service.h ('k') | chrome/browser/ui/gtk/gtk_theme_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 5d29378caf12e60e9a2eaf2da2a9d577ff4dfc3e..5038dff43fda6cc10bde33a201bdca4723832f23 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -74,9 +74,9 @@ void WritePackToDiskCallback(BrowserThemePack* pack,
} // namespace
ThemeService::ThemeService()
- : rb_(ResourceBundle::GetSharedInstance()),
+ : ready_(false),
+ rb_(ResourceBundle::GetSharedInstance()),
profile_(NULL),
- ready_(false),
number_of_infobars_(0) {
}
@@ -273,10 +273,8 @@ void ThemeService::UseDefaultTheme() {
SetManagedUserTheme();
return;
}
- if (ready_) {
- ClearAllThemeData();
- NotifyThemeChanged();
- }
+ ClearAllThemeData();
+ NotifyThemeChanged();
}
void ThemeService::SetNativeTheme() {
@@ -308,6 +306,9 @@ color_utils::HSL ThemeService::GetTint(int id) const {
}
void ThemeService::ClearAllThemeData() {
+ if (!ready_)
+ return;
+
SwapThemeSupplier(NULL);
// Clear our image cache.
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/ui/gtk/gtk_theme_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698