| 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 <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/threading/non_thread_safe.h" | 18 #include "base/sequence_checker.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "chrome/common/features.h" | 20 #include "chrome/common/features.h" |
| 21 #include "components/keyed_service/core/keyed_service.h" | 21 #include "components/keyed_service/core/keyed_service.h" |
| 22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 #include "extensions/features/features.h" | 24 #include "extensions/features/features.h" |
| 25 #include "ui/base/theme_provider.h" | 25 #include "ui/base/theme_provider.h" |
| 26 | 26 |
| 27 class CustomThemeSupplier; | 27 class CustomThemeSupplier; |
| 28 class ThemeSyncableService; | 28 class ThemeSyncableService; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 class ResourceBundle; | 52 class ResourceBundle; |
| 53 } | 53 } |
| 54 | 54 |
| 55 #ifdef __OBJC__ | 55 #ifdef __OBJC__ |
| 56 @class NSString; | 56 @class NSString; |
| 57 // Sent whenever the browser theme changes. Object => NSValue wrapping the | 57 // Sent whenever the browser theme changes. Object => NSValue wrapping the |
| 58 // ThemeService that changed. | 58 // ThemeService that changed. |
| 59 extern "C" NSString* const kBrowserThemeDidChangeNotification; | 59 extern "C" NSString* const kBrowserThemeDidChangeNotification; |
| 60 #endif // __OBJC__ | 60 #endif // __OBJC__ |
| 61 | 61 |
| 62 class ThemeService : public base::NonThreadSafe, | 62 class ThemeService : public content::NotificationObserver, public KeyedService { |
| 63 public content::NotificationObserver, | |
| 64 public KeyedService { | |
| 65 public: | 63 public: |
| 66 // Public constants used in ThemeService and its subclasses: | 64 // Public constants used in ThemeService and its subclasses: |
| 67 static const char kDefaultThemeID[]; | 65 static const char kDefaultThemeID[]; |
| 68 | 66 |
| 69 ThemeService(); | 67 ThemeService(); |
| 70 ~ThemeService() override; | 68 ~ThemeService() override; |
| 71 | 69 |
| 72 virtual void Init(Profile* profile); | 70 virtual void Init(Profile* profile); |
| 73 | 71 |
| 74 // KeyedService: | 72 // KeyedService: |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 std::unique_ptr<ThemeSyncableService> theme_syncable_service_; | 319 std::unique_ptr<ThemeSyncableService> theme_syncable_service_; |
| 322 | 320 |
| 323 #if BUILDFLAG(ENABLE_EXTENSIONS) | 321 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 324 class ThemeObserver; | 322 class ThemeObserver; |
| 325 std::unique_ptr<ThemeObserver> theme_observer_; | 323 std::unique_ptr<ThemeObserver> theme_observer_; |
| 326 #endif | 324 #endif |
| 327 | 325 |
| 328 BrowserThemeProvider original_theme_provider_; | 326 BrowserThemeProvider original_theme_provider_; |
| 329 BrowserThemeProvider incognito_theme_provider_; | 327 BrowserThemeProvider incognito_theme_provider_; |
| 330 | 328 |
| 329 SEQUENCE_CHECKER(sequence_checker_); |
| 330 |
| 331 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; | 331 base::WeakPtrFactory<ThemeService> weak_ptr_factory_; |
| 332 | 332 |
| 333 DISALLOW_COPY_AND_ASSIGN(ThemeService); | 333 DISALLOW_COPY_AND_ASSIGN(ThemeService); |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ | 336 #endif // CHROME_BROWSER_THEMES_THEME_SERVICE_H_ |
| OLD | NEW |