| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MANAGEMENT_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | |
| 10 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
| 11 #include "content/common/notification_observer.h" | 10 #include "content/common/notification_observer.h" |
| 12 #include "content/common/notification_registrar.h" | 11 #include "content/common/notification_registrar.h" |
| 13 | 12 |
| 14 class ExtensionService; | 13 class ExtensionService; |
| 15 | 14 |
| 16 class ExtensionManagementFunction : public SyncExtensionFunction { | 15 class ExtensionManagementFunction : public SyncExtensionFunction { |
| 17 protected: | 16 protected: |
| 18 ExtensionService* service(); | 17 ExtensionService* service(); |
| 19 }; | 18 }; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 class UninstallFunction : public ExtensionManagementFunction { | 44 class UninstallFunction : public ExtensionManagementFunction { |
| 46 virtual ~UninstallFunction() {} | 45 virtual ~UninstallFunction() {} |
| 47 virtual bool RunImpl(); | 46 virtual bool RunImpl(); |
| 48 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall"); | 47 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall"); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 class ExtensionManagementEventRouter : public NotificationObserver { | 50 class ExtensionManagementEventRouter : public NotificationObserver { |
| 52 public: | 51 public: |
| 53 // Get the singleton instance of the event router. | |
| 54 static ExtensionManagementEventRouter* GetInstance(); | |
| 55 | |
| 56 // Performs one-time initialization of our singleton. | |
| 57 void Init(); | |
| 58 | |
| 59 private: | |
| 60 friend struct DefaultSingletonTraits<ExtensionManagementEventRouter>; | |
| 61 | |
| 62 ExtensionManagementEventRouter(); | 52 ExtensionManagementEventRouter(); |
| 63 virtual ~ExtensionManagementEventRouter(); | 53 virtual ~ExtensionManagementEventRouter(); |
| 64 | 54 |
| 55 void ObserveProfile(Profile* profile); |
| 56 |
| 57 private: |
| 65 // NotificationObserver implementation. | 58 // NotificationObserver implementation. |
| 66 virtual void Observe(NotificationType type, | 59 virtual void Observe(NotificationType type, |
| 67 const NotificationSource& source, | 60 const NotificationSource& source, |
| 68 const NotificationDetails& details); | 61 const NotificationDetails& details); |
| 69 | 62 |
| 70 NotificationRegistrar registrar_; | 63 NotificationRegistrar registrar_; |
| 71 | 64 |
| 72 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); | 65 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); |
| 73 }; | 66 }; |
| 74 | 67 |
| 75 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ | 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ |
| OLD | NEW |