| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/browser/navigation_controller.h" | 21 #include "content/public/browser/navigation_controller.h" |
| 22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
| 25 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
| 26 #include "content/public/browser/web_ui_message_handler.h" | 26 #include "content/public/browser/web_ui_message_handler.h" |
| 27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
| 28 #include "ui/shell_dialogs/select_file_dialog.h" | 28 #include "ui/shell_dialogs/select_file_dialog.h" |
| 29 | 29 |
| 30 class ExtensionService; | 30 class ExtensionService; |
| 31 class PrefRegistrySyncable; | |
| 32 | 31 |
| 33 namespace base { | 32 namespace base { |
| 34 class DictionaryValue; | 33 class DictionaryValue; |
| 35 class FilePath; | 34 class FilePath; |
| 36 class ListValue; | 35 class ListValue; |
| 37 } | 36 } |
| 38 | 37 |
| 39 namespace content { | 38 namespace content { |
| 40 class WebUIDataSource; | 39 class WebUIDataSource; |
| 41 } | 40 } |
| 42 | 41 |
| 43 namespace extensions { | 42 namespace extensions { |
| 44 class Extension; | 43 class Extension; |
| 45 class ExtensionHost; | 44 class ExtensionHost; |
| 46 class ManagementPolicy; | 45 class ManagementPolicy; |
| 47 } | 46 } |
| 48 | 47 |
| 48 namespace user_prefs { |
| 49 class PrefRegistrySyncable; |
| 50 } |
| 51 |
| 49 // Information about a page running in an extension, for example a popup bubble, | 52 // Information about a page running in an extension, for example a popup bubble, |
| 50 // a background page, or a tab contents. | 53 // a background page, or a tab contents. |
| 51 struct ExtensionPage { | 54 struct ExtensionPage { |
| 52 ExtensionPage(const GURL& url, int render_process_id, int render_view_id, | 55 ExtensionPage(const GURL& url, int render_process_id, int render_view_id, |
| 53 bool incognito) | 56 bool incognito) |
| 54 : url(url), | 57 : url(url), |
| 55 render_process_id(render_process_id), | 58 render_process_id(render_process_id), |
| 56 render_view_id(render_view_id), | 59 render_view_id(render_view_id), |
| 57 incognito(incognito) {} | 60 incognito(incognito) {} |
| 58 GURL url; | 61 GURL url; |
| 59 int render_process_id; | 62 int render_process_id; |
| 60 int render_view_id; | 63 int render_view_id; |
| 61 bool incognito; | 64 bool incognito; |
| 62 }; | 65 }; |
| 63 | 66 |
| 64 // Extension Settings UI handler. | 67 // Extension Settings UI handler. |
| 65 class ExtensionSettingsHandler | 68 class ExtensionSettingsHandler |
| 66 : public content::WebUIMessageHandler, | 69 : public content::WebUIMessageHandler, |
| 67 public content::NotificationObserver, | 70 public content::NotificationObserver, |
| 68 public content::WebContentsObserver, | 71 public content::WebContentsObserver, |
| 69 public ui::SelectFileDialog::Listener, | 72 public ui::SelectFileDialog::Listener, |
| 70 public ExtensionInstallPrompt::Delegate, | 73 public ExtensionInstallPrompt::Delegate, |
| 71 public ExtensionUninstallDialog::Delegate, | 74 public ExtensionUninstallDialog::Delegate, |
| 72 public extensions::ExtensionWarningService::Observer, | 75 public extensions::ExtensionWarningService::Observer, |
| 73 public base::SupportsWeakPtr<ExtensionSettingsHandler> { | 76 public base::SupportsWeakPtr<ExtensionSettingsHandler> { |
| 74 public: | 77 public: |
| 75 ExtensionSettingsHandler(); | 78 ExtensionSettingsHandler(); |
| 76 virtual ~ExtensionSettingsHandler(); | 79 virtual ~ExtensionSettingsHandler(); |
| 77 | 80 |
| 78 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 81 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 79 | 82 |
| 80 // Extension Detail JSON Struct for page. |pages| is injected for unit | 83 // Extension Detail JSON Struct for page. |pages| is injected for unit |
| 81 // testing. | 84 // testing. |
| 82 // Note: |warning_service| can be NULL in unit tests. | 85 // Note: |warning_service| can be NULL in unit tests. |
| 83 base::DictionaryValue* CreateExtensionDetailValue( | 86 base::DictionaryValue* CreateExtensionDetailValue( |
| 84 const extensions::Extension* extension, | 87 const extensions::Extension* extension, |
| 85 const std::vector<ExtensionPage>& pages, | 88 const std::vector<ExtensionPage>& pages, |
| 86 const extensions::ExtensionWarningService* warning_service); | 89 const extensions::ExtensionWarningService* warning_service); |
| 87 | 90 |
| 88 void GetLocalizedValues(content::WebUIDataSource* source); | 91 void GetLocalizedValues(content::WebUIDataSource* source); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 scoped_ptr<ExtensionInstallPrompt> prompt_; | 281 scoped_ptr<ExtensionInstallPrompt> prompt_; |
| 279 | 282 |
| 280 ScopedObserver<extensions::ExtensionWarningService, | 283 ScopedObserver<extensions::ExtensionWarningService, |
| 281 extensions::ExtensionWarningService::Observer> | 284 extensions::ExtensionWarningService::Observer> |
| 282 warning_service_observer_; | 285 warning_service_observer_; |
| 283 | 286 |
| 284 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 287 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
| 285 }; | 288 }; |
| 286 | 289 |
| 287 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 290 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
| OLD | NEW |