| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/singleton.h" | |
| 10 #include "chrome/browser/extensions/extension_function.h" | 9 #include "chrome/browser/extensions/extension_function.h" |
| 11 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
| 12 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/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 ~UninstallFunction() {} | 45 ~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. | 52 ExtensionManagementEventRouter(); |
| 54 static ExtensionManagementEventRouter* GetInstance(); | 53 virtual ~ExtensionManagementEventRouter(); |
| 55 | 54 |
| 56 // Performs one-time initialization of our singleton. | 55 // Performs one-time initialization. |
| 57 void Init(); | 56 void Init(); |
| 58 | 57 |
| 59 private: | 58 private: |
| 60 friend struct DefaultSingletonTraits<ExtensionManagementEventRouter>; | |
| 61 | |
| 62 ExtensionManagementEventRouter(); | |
| 63 virtual ~ExtensionManagementEventRouter(); | |
| 64 | |
| 65 // NotificationObserver implementation. | 59 // NotificationObserver implementation. |
| 66 virtual void Observe(NotificationType type, | 60 virtual void Observe(NotificationType type, |
| 67 const NotificationSource& source, | 61 const NotificationSource& source, |
| 68 const NotificationDetails& details); | 62 const NotificationDetails& details); |
| 69 | 63 |
| 70 NotificationRegistrar registrar_; | 64 NotificationRegistrar registrar_; |
| 71 | 65 |
| 72 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); | 66 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); |
| 73 }; | 67 }; |
| 74 | 68 |
| 75 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ | 69 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ |
| OLD | NEW |