| 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_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 9 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| 10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 11 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 11 #include "extensions/browser/extension_registry_observer.h" | 12 #include "extensions/browser/extension_registry_observer.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 class BrowserContext; | 15 class BrowserContext; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace extensions { | 18 namespace extensions { |
| 18 class ExtensionRegistry; | 19 class ExtensionRegistry; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 friend class BrowserContextKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>; | 32 friend class BrowserContextKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>; |
| 32 | 33 |
| 33 // ExtensionRegistryObserver implementation. | 34 // ExtensionRegistryObserver implementation. |
| 34 void OnExtensionLoaded(content::BrowserContext* browser_context, | 35 void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 35 const Extension* extension) override; | 36 const Extension* extension) override; |
| 36 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 37 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 37 const Extension* extension, | 38 const Extension* extension, |
| 38 UnloadedExtensionInfo::Reason reason) override; | 39 UnloadedExtensionInfo::Reason reason) override; |
| 40 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 41 const Extension* extension, |
| 42 UninstallReason reason) override; |
| 43 |
| 44 void OnExtensionSystemReady(content::BrowserContext* context); |
| 39 | 45 |
| 40 // BrowserContextKeyedAPI implementation. | 46 // BrowserContextKeyedAPI implementation. |
| 41 static const char* service_name() { | 47 static const char* service_name() { |
| 42 return "ExtensionWebUIOverrideRegistrar"; | 48 return "ExtensionWebUIOverrideRegistrar"; |
| 43 } | 49 } |
| 50 static const bool kServiceIsNULLWhileTesting = true; |
| 44 | 51 |
| 45 // Listen to extension load, unloaded notifications. | 52 // Listen to extension load, unloaded notifications. |
| 46 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 53 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 47 extension_registry_observer_; | 54 extension_registry_observer_; |
| 48 | 55 |
| 56 base::WeakPtrFactory<ExtensionWebUIOverrideRegistrar> weak_factory_; |
| 57 |
| 49 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIOverrideRegistrar); | 58 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIOverrideRegistrar); |
| 50 }; | 59 }; |
| 51 | 60 |
| 52 } // namespace extensions | 61 } // namespace extensions |
| 53 | 62 |
| 54 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
| OLD | NEW |