Chromium Code Reviews| Index: chrome/browser/themes/theme_service.h |
| diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h |
| index f13e5c1cd8e21f879869a177985db56dcc9e1897..c5f3763218001443c51464f75615d79fbb6d970e 100644 |
| --- a/chrome/browser/themes/theme_service.h |
| +++ b/chrome/browser/themes/theme_service.h |
| @@ -18,6 +18,7 @@ |
| #include "components/keyed_service/core/keyed_service.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| +#include "extensions/browser/extension_registry_observer.h" |
| #include "ui/base/theme_provider.h" |
| class CustomThemeSupplier; |
| @@ -35,6 +36,7 @@ struct HSL; |
| namespace extensions { |
| class Extension; |
| +class ExtensionRegistry; |
| } |
| namespace gfx { |
| @@ -58,6 +60,7 @@ extern "C" NSString* const kBrowserThemeDidChangeNotification; |
| class ThemeService : public base::NonThreadSafe, |
| public content::NotificationObserver, |
| + public extensions::ExtensionRegistryObserver, |
| public KeyedService, |
| public ui::ThemeProvider { |
| public: |
| @@ -75,7 +78,7 @@ class ThemeService : public base::NonThreadSafe, |
| // theme properties out of the theme provider since it's cross platform. |
| virtual gfx::Image GetImageNamed(int id) const; |
| - // Overridden from ui::ThemeProvider: |
| + // ui::ThemeProvider: |
| virtual bool UsingSystemTheme() const OVERRIDE; |
| virtual gfx::ImageSkia* GetImageSkiaNamed(int id) const OVERRIDE; |
| virtual SkColor GetColor(int id) const OVERRIDE; |
| @@ -93,11 +96,29 @@ class ThemeService : public base::NonThreadSafe, |
| virtual NSGradient* GetNSGradient(int id) const OVERRIDE; |
| #endif |
| - // Overridden from content::NotificationObserver: |
| + // content::NotificationObserver: |
| virtual void Observe(int type, |
| const content::NotificationSource& source, |
| const content::NotificationDetails& details) OVERRIDE; |
| + // extensions::ExtensionRegistryObserver: |
| + virtual void OnExtensionLoaded( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension) OVERRIDE; |
| + virtual void OnExtensionUnloaded( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension, |
| + extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| + virtual void OnExtensionWillBeInstalled( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension, |
| + bool is_update, |
| + bool from_ephemeral, |
| + const std::string& old_name) OVERRIDE; |
| + |
| + // KeyedService. |
|
Bernhard Bauer
2014/10/15 13:21:04
Nit: add a colon at the end like the other comment
Jitu( very slow this week)
2014/10/15 14:19:06
Done.
|
| + virtual void Shutdown() OVERRIDE; |
| + |
| // Set the current theme to the theme defined in |extension|. |
| // |extension| must already be added to this profile's |
| // ExtensionService. |
| @@ -245,6 +266,8 @@ class ThemeService : public base::NonThreadSafe, |
| content::NotificationRegistrar registrar_; |
| + extensions::ExtensionRegistry* extension_registry_; |
| + |
| scoped_ptr<ThemeSyncableService> theme_syncable_service_; |
| base::WeakPtrFactory<ThemeService> weak_ptr_factory_; |