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_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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
11 #include "chrome/browser/extensions/extension_install_ui.h" | 11 #include "chrome/browser/extensions/extension_install_prompt.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
14 | 14 |
15 class ExtensionService; | 15 class ExtensionService; |
16 | 16 |
17 class ExtensionManagementFunction : public SyncExtensionFunction { | 17 class ExtensionManagementFunction : public SyncExtensionFunction { |
18 protected: | 18 protected: |
19 virtual ~ExtensionManagementFunction() {} | 19 virtual ~ExtensionManagementFunction() {} |
20 | 20 |
21 ExtensionService* service(); | 21 ExtensionService* service(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 DECLARE_EXTENSION_FUNCTION_NAME("management.launchApp"); | 82 DECLARE_EXTENSION_FUNCTION_NAME("management.launchApp"); |
83 | 83 |
84 protected: | 84 protected: |
85 virtual ~LaunchAppFunction() {} | 85 virtual ~LaunchAppFunction() {} |
86 | 86 |
87 // ExtensionFunction: | 87 // ExtensionFunction: |
88 virtual bool RunImpl() OVERRIDE; | 88 virtual bool RunImpl() OVERRIDE; |
89 }; | 89 }; |
90 | 90 |
91 class SetEnabledFunction : public AsyncExtensionManagementFunction, | 91 class SetEnabledFunction : public AsyncExtensionManagementFunction, |
92 public ExtensionInstallUI::Delegate { | 92 public ExtensionInstallPrompt::Delegate { |
93 public: | 93 public: |
94 DECLARE_EXTENSION_FUNCTION_NAME("management.setEnabled"); | 94 DECLARE_EXTENSION_FUNCTION_NAME("management.setEnabled"); |
95 | 95 |
96 SetEnabledFunction(); | 96 SetEnabledFunction(); |
97 | 97 |
98 protected: | 98 protected: |
99 virtual ~SetEnabledFunction(); | 99 virtual ~SetEnabledFunction(); |
100 | 100 |
101 // ExtensionFunction: | 101 // ExtensionFunction: |
102 virtual bool RunImpl() OVERRIDE; | 102 virtual bool RunImpl() OVERRIDE; |
103 | 103 |
104 // ExtensionInstalUI::Delegate. | 104 // ExtensionInstalUI::Delegate. |
105 virtual void InstallUIProceed() OVERRIDE; | 105 virtual void InstallUIProceed() OVERRIDE; |
106 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 106 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
107 | 107 |
108 private: | 108 private: |
109 std::string extension_id_; | 109 std::string extension_id_; |
110 | 110 |
111 // Used for prompting to re-enable items with permissions escalation updates. | 111 // Used for prompting to re-enable items with permissions escalation updates. |
112 scoped_ptr<ExtensionInstallUI> install_ui_; | 112 scoped_ptr<ExtensionInstallPrompt> install_ui_; |
Yoyo Zhou
2012/05/23 23:17:49
nit: rename this variable
Jay Civelli
2012/05/30 20:20:35
Done.
| |
113 }; | 113 }; |
114 | 114 |
115 class UninstallFunction : public ExtensionManagementFunction { | 115 class UninstallFunction : public ExtensionManagementFunction { |
116 public: | 116 public: |
117 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall"); | 117 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall"); |
118 | 118 |
119 protected: | 119 protected: |
120 virtual ~UninstallFunction() {} | 120 virtual ~UninstallFunction() {} |
121 | 121 |
122 // ExtensionFunction: | 122 // ExtensionFunction: |
(...skipping 14 matching lines...) Expand all Loading... | |
137 const content::NotificationDetails& details) OVERRIDE; | 137 const content::NotificationDetails& details) OVERRIDE; |
138 | 138 |
139 content::NotificationRegistrar registrar_; | 139 content::NotificationRegistrar registrar_; |
140 | 140 |
141 Profile* profile_; | 141 Profile* profile_; |
142 | 142 |
143 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); | 143 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); |
144 }; | 144 }; |
145 | 145 |
146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ | 146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ |
OLD | NEW |