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_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/prefs/pref_change_registrar.h" | 13 #include "base/prefs/pref_change_registrar.h" |
14 #include "base/scoped_observer.h" | 14 #include "base/scoped_observer.h" |
15 #include "chrome/browser/extensions/extension_install_prompt.h" | 15 #include "chrome/browser/extensions/extension_install_prompt.h" |
16 #include "chrome/browser/extensions/extension_install_ui.h" | 16 #include "chrome/browser/extensions/extension_install_ui.h" |
17 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 17 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
18 #include "chrome/browser/extensions/extension_warning_service.h" | 18 #include "chrome/browser/extensions/extension_warning_service.h" |
19 #include "chrome/browser/extensions/requirements_checker.h" | 19 #include "chrome/browser/extensions/requirements_checker.h" |
| 20 #include "chrome/browser/managed_mode/scoped_extension_elevation.h" |
20 #include "content/public/browser/navigation_controller.h" | 21 #include "content/public/browser/navigation_controller.h" |
21 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
22 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
23 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
25 #include "content/public/browser/web_ui_message_handler.h" | 26 #include "content/public/browser/web_ui_message_handler.h" |
26 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
27 #include "ui/shell_dialogs/select_file_dialog.h" | 28 #include "ui/shell_dialogs/select_file_dialog.h" |
28 | 29 |
29 class ExtensionService; | 30 class ExtensionService; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Helper method that reloads all unpacked extensions. | 131 // Helper method that reloads all unpacked extensions. |
131 void ReloadUnpackedExtensions(); | 132 void ReloadUnpackedExtensions(); |
132 | 133 |
133 // Callback for "setElevated" message. | 134 // Callback for "setElevated" message. |
134 void ManagedUserSetElevated(const base::ListValue* args); | 135 void ManagedUserSetElevated(const base::ListValue* args); |
135 | 136 |
136 // If the authentication of the managed user was successful, | 137 // If the authentication of the managed user was successful, |
137 // it gives this information back to the UI. | 138 // it gives this information back to the UI. |
138 void PassphraseDialogCallback(bool success); | 139 void PassphraseDialogCallback(bool success); |
139 | 140 |
| 141 // Generates a temporary elevation for a managed user which is bound to the |
| 142 // life-time of the return value. |
| 143 scoped_ptr<ScopedExtensionElevation> GetScopedElevation( |
| 144 std::string extension_id); |
| 145 |
| 146 // Verifies that the management policy allows the user to enable, |
| 147 // disable or uninstall an extension. |
| 148 bool CheckUserMayModifySettings(const extensions::Extension* extension); |
| 149 |
140 // Callback for "requestExtensionsData" message. | 150 // Callback for "requestExtensionsData" message. |
141 void HandleRequestExtensionsData(const base::ListValue* args); | 151 void HandleRequestExtensionsData(const base::ListValue* args); |
142 | 152 |
143 // Callback for "toggleDeveloperMode" message. | 153 // Callback for "toggleDeveloperMode" message. |
144 void HandleToggleDeveloperMode(const base::ListValue* args); | 154 void HandleToggleDeveloperMode(const base::ListValue* args); |
145 | 155 |
146 // Callback for "inspect" message. | 156 // Callback for "inspect" message. |
147 void HandleInspectMessage(const base::ListValue* args); | 157 void HandleInspectMessage(const base::ListValue* args); |
148 | 158 |
149 // Callback for "launch" message. | 159 // Callback for "launch" message. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 scoped_ptr<ExtensionInstallPrompt> prompt_; | 274 scoped_ptr<ExtensionInstallPrompt> prompt_; |
265 | 275 |
266 ScopedObserver<extensions::ExtensionWarningService, | 276 ScopedObserver<extensions::ExtensionWarningService, |
267 extensions::ExtensionWarningService::Observer> | 277 extensions::ExtensionWarningService::Observer> |
268 warning_service_observer_; | 278 warning_service_observer_; |
269 | 279 |
270 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 280 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
271 }; | 281 }; |
272 | 282 |
273 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 283 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
OLD | NEW |