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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual void FreePlatformCaches(); | 178 virtual void FreePlatformCaches(); |
179 | 179 |
180 Profile* profile() const { return profile_; } | 180 Profile* profile() const { return profile_; } |
181 | 181 |
182 void set_ready() { ready_ = true; } | 182 void set_ready() { ready_ = true; } |
183 | 183 |
184 const CustomThemeSupplier* get_theme_supplier() const { | 184 const CustomThemeSupplier* get_theme_supplier() const { |
185 return theme_supplier_.get(); | 185 return theme_supplier_.get(); |
186 } | 186 } |
187 | 187 |
| 188 // True if the theme service is ready to be used. |
| 189 // TODO(pkotwicz): Add DCHECKS to the theme service's getters once |
| 190 // ThemeSource no longer uses the ThemeService when it is not ready. |
| 191 bool ready_; |
| 192 |
188 private: | 193 private: |
189 friend class theme_service_internal::ThemeServiceTest; | 194 friend class theme_service_internal::ThemeServiceTest; |
190 | 195 |
191 // Called when the extension service is ready. | 196 // Called when the extension service is ready. |
192 void OnExtensionServiceReady(); | 197 void OnExtensionServiceReady(); |
193 | 198 |
194 // Migrate the theme to the new theme pack schema by recreating the data pack | 199 // Migrate the theme to the new theme pack schema by recreating the data pack |
195 // from the extension. | 200 // from the extension. |
196 void MigrateTheme(); | 201 void MigrateTheme(); |
197 | 202 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 typedef std::map<int, std::pair<NSColor*, bool> > NSColorMap; | 237 typedef std::map<int, std::pair<NSColor*, bool> > NSColorMap; |
233 mutable NSColorMap nscolor_cache_; | 238 mutable NSColorMap nscolor_cache_; |
234 | 239 |
235 typedef std::map<int, NSGradient*> NSGradientMap; | 240 typedef std::map<int, NSGradient*> NSGradientMap; |
236 mutable NSGradientMap nsgradient_cache_; | 241 mutable NSGradientMap nsgradient_cache_; |
237 #endif | 242 #endif |
238 | 243 |
239 ui::ResourceBundle& rb_; | 244 ui::ResourceBundle& rb_; |
240 Profile* profile_; | 245 Profile* profile_; |
241 | 246 |
242 // True if the theme service is ready to be used. | |
243 // TODO(pkotwicz): Add DCHECKS to the theme service's getters once | |
244 // ThemeSource no longer uses the ThemeService when it is not ready. | |
245 bool ready_; | |
246 | |
247 scoped_refptr<CustomThemeSupplier> theme_supplier_; | 247 scoped_refptr<CustomThemeSupplier> theme_supplier_; |
248 | 248 |
249 // The id of the theme extension which has just been installed but has not | 249 // The id of the theme extension which has just been installed but has not |
250 // been loaded yet. The theme extension with |installed_pending_load_id_| may | 250 // been loaded yet. The theme extension with |installed_pending_load_id_| may |
251 // never be loaded if the install is due to updating a disabled theme. | 251 // never be loaded if the install is due to updating a disabled theme. |
252 // |pending_install_id_| should be set to |kDefaultThemeID| if there are no | 252 // |pending_install_id_| should be set to |kDefaultThemeID| if there are no |
253 // recently installed theme extensions | 253 // recently installed theme extensions |
254 std::string installed_pending_load_id_; | 254 std::string installed_pending_load_id_; |
255 | 255 |
256 // The number of infobars currently displayed. | 256 // The number of infobars currently displayed. |
257 int number_of_infobars_; | 257 int number_of_infobars_; |
258 | 258 |
259 content::NotificationRegistrar registrar_; | 259 content::NotificationRegistrar registrar_; |
260 | 260 |
261 scoped_ptr<ThemeSyncableService> theme_syncable_service_; | 261 scoped_ptr<ThemeSyncableService> theme_syncable_service_; |
262 | 262 |
263 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; | 263 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; |
264 | 264 |
265 DISALLOW_COPY_AND_ASSIGN(ThemeService); | 265 DISALLOW_COPY_AND_ASSIGN(ThemeService); |
266 }; | 266 }; |
267 | 267 |
268 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 268 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
OLD | NEW |