OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 6 #define CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // Let all the browser views know that themes have changed. | 165 // Let all the browser views know that themes have changed. |
166 virtual void NotifyThemeChanged(); | 166 virtual void NotifyThemeChanged(); |
167 | 167 |
168 #if defined(OS_MACOSX) | 168 #if defined(OS_MACOSX) |
169 // Let all the browser views know that themes have changed in a platform way. | 169 // Let all the browser views know that themes have changed in a platform way. |
170 virtual void NotifyPlatformThemeChanged(); | 170 virtual void NotifyPlatformThemeChanged(); |
171 #endif // OS_MACOSX | 171 #endif // OS_MACOSX |
172 | 172 |
173 // Clears the platform-specific caches. Do not call directly; it's called | 173 // Clears the platform-specific caches. Do not call directly; it's called |
174 // from ClearCaches(). | 174 // from ClearAllThemeData(). |
175 virtual void FreePlatformCaches(); | 175 virtual void FreePlatformCaches(); |
176 | 176 |
177 Profile* profile() const { return profile_; } | 177 Profile* profile() const { return profile_; } |
178 | 178 |
179 void set_ready() { ready_ = true; } | 179 void set_ready() { ready_ = true; } |
180 | 180 |
181 const CustomThemeSupplier* get_theme_supplier() const { | 181 const CustomThemeSupplier* get_theme_supplier() const { |
182 return theme_supplier_.get(); | 182 return theme_supplier_.get(); |
183 } | 183 } |
184 | 184 |
| 185 // True if the theme service is ready to be used. |
| 186 // TODO(pkotwicz): Add DCHECKS to the theme service's getters once |
| 187 // ThemeSource no longer uses the ThemeService when it is not ready. |
| 188 bool ready_; |
| 189 |
185 private: | 190 private: |
186 friend class theme_service_internal::ThemeServiceTest; | 191 friend class theme_service_internal::ThemeServiceTest; |
187 | 192 |
188 // Replaces the current theme supplier with a new one and calls | 193 // Replaces the current theme supplier with a new one and calls |
189 // StopUsingTheme() or StartUsingTheme() as appropriate. | 194 // StopUsingTheme() or StartUsingTheme() as appropriate. |
190 void SwapThemeSupplier(scoped_refptr<CustomThemeSupplier> theme_supplier); | 195 void SwapThemeSupplier(scoped_refptr<CustomThemeSupplier> theme_supplier); |
191 | 196 |
192 // Migrate the theme to the new theme pack schema by recreating the data pack | 197 // Migrate the theme to the new theme pack schema by recreating the data pack |
193 // from the extension. | 198 // from the extension. |
194 void MigrateTheme(); | 199 void MigrateTheme(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 typedef std::map<int, std::pair<NSColor*, bool> > NSColorMap; | 231 typedef std::map<int, std::pair<NSColor*, bool> > NSColorMap; |
227 mutable NSColorMap nscolor_cache_; | 232 mutable NSColorMap nscolor_cache_; |
228 | 233 |
229 typedef std::map<int, NSGradient*> NSGradientMap; | 234 typedef std::map<int, NSGradient*> NSGradientMap; |
230 mutable NSGradientMap nsgradient_cache_; | 235 mutable NSGradientMap nsgradient_cache_; |
231 #endif | 236 #endif |
232 | 237 |
233 ui::ResourceBundle& rb_; | 238 ui::ResourceBundle& rb_; |
234 Profile* profile_; | 239 Profile* profile_; |
235 | 240 |
236 // True if the theme service is ready to be used. | |
237 // TODO(pkotwicz): Add DCHECKS to the theme service's getters once | |
238 // ThemeSource no longer uses the ThemeService when it is not ready. | |
239 bool ready_; | |
240 | |
241 scoped_refptr<CustomThemeSupplier> theme_supplier_; | 241 scoped_refptr<CustomThemeSupplier> theme_supplier_; |
242 | 242 |
243 // The number of infobars currently displayed. | 243 // The number of infobars currently displayed. |
244 int number_of_infobars_; | 244 int number_of_infobars_; |
245 | 245 |
246 content::NotificationRegistrar registrar_; | 246 content::NotificationRegistrar registrar_; |
247 | 247 |
248 scoped_ptr<ThemeSyncableService> theme_syncable_service_; | 248 scoped_ptr<ThemeSyncableService> theme_syncable_service_; |
249 | 249 |
250 DISALLOW_COPY_AND_ASSIGN(ThemeService); | 250 DISALLOW_COPY_AND_ASSIGN(ThemeService); |
251 }; | 251 }; |
252 | 252 |
253 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 253 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
OLD | NEW |