| 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_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "chrome/browser/extensions/extension_install_ui.h" | 12 #include "chrome/browser/extensions/extension_install_ui.h" |
| 13 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 13 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 14 #include "chrome/browser/extensions/extension_warning_set.h" |
| 14 #include "chrome/browser/ui/shell_dialogs.h" | 15 #include "chrome/browser/ui/shell_dialogs.h" |
| 15 #include "chrome/browser/ui/webui/options/options_ui.h" | 16 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 16 #include "chrome/browser/ui/webui/chrome_web_ui.h" | 17 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
| 17 #include "chrome/common/extensions/extension_resource.h" | 18 #include "chrome/common/extensions/extension_resource.h" |
| 18 #include "content/common/notification_observer.h" | 19 #include "content/common/notification_observer.h" |
| 19 #include "content/common/notification_registrar.h" | 20 #include "content/common/notification_registrar.h" |
| 20 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 21 | 22 |
| 22 class Extension; | 23 class Extension; |
| 23 class ExtensionService; | 24 class ExtensionService; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 50 class ExtensionSettingsHandler : public OptionsPageUIHandler, | 51 class ExtensionSettingsHandler : public OptionsPageUIHandler, |
| 51 public SelectFileDialog::Listener, | 52 public SelectFileDialog::Listener, |
| 52 public ExtensionUninstallDialog::Delegate { | 53 public ExtensionUninstallDialog::Delegate { |
| 53 public: | 54 public: |
| 54 ExtensionSettingsHandler(); | 55 ExtensionSettingsHandler(); |
| 55 virtual ~ExtensionSettingsHandler(); | 56 virtual ~ExtensionSettingsHandler(); |
| 56 | 57 |
| 57 static void RegisterUserPrefs(PrefService* prefs); | 58 static void RegisterUserPrefs(PrefService* prefs); |
| 58 | 59 |
| 59 // Extension Detail JSON Struct for page. (static for ease of testing). | 60 // Extension Detail JSON Struct for page. (static for ease of testing). |
| 60 // Note: service can be NULL in unit tests. | 61 // Note: |service| and |warnings| can be NULL in unit tests. |
| 61 static base::DictionaryValue* CreateExtensionDetailValue( | 62 static base::DictionaryValue* CreateExtensionDetailValue( |
| 62 ExtensionService* service, | 63 ExtensionService* service, |
| 63 const Extension* extension, | 64 const Extension* extension, |
| 64 const std::vector<ExtensionPage>& pages, | 65 const std::vector<ExtensionPage>& pages, |
| 66 const ExtensionWarningSet* warnings, |
| 65 bool enabled, | 67 bool enabled, |
| 66 bool terminated); | 68 bool terminated); |
| 67 | 69 |
| 68 // ContentScript JSON Struct for page. (static for ease of testing). | 70 // ContentScript JSON Struct for page. (static for ease of testing). |
| 69 static base::DictionaryValue* CreateContentScriptDetailValue( | 71 static base::DictionaryValue* CreateContentScriptDetailValue( |
| 70 const UserScript& script, | 72 const UserScript& script, |
| 71 const FilePath& extension_path); | 73 const FilePath& extension_path); |
| 72 | 74 |
| 73 // Callback for "requestExtensionsData" message. | 75 // Callback for "requestExtensionsData" message. |
| 74 void HandleRequestExtensionsData(const base::ListValue* args); | 76 void HandleRequestExtensionsData(const base::ListValue* args); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // We want to register for notifications only after we've responded at least | 192 // We want to register for notifications only after we've responded at least |
| 191 // once to the page, otherwise we'd be calling javacsript functions on objects | 193 // once to the page, otherwise we'd be calling javacsript functions on objects |
| 192 // that don't exist yet when notifications come in. This variable makes sure | 194 // that don't exist yet when notifications come in. This variable makes sure |
| 193 // we do so only once. | 195 // we do so only once. |
| 194 bool registered_for_notifications_; | 196 bool registered_for_notifications_; |
| 195 | 197 |
| 196 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 198 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
| 197 }; | 199 }; |
| 198 | 200 |
| 199 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ | 201 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_EXTENSION_SETTINGS_HANDLER_H_ |
| OLD | NEW |