| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
| 12 #include "chrome/browser/extensions/extension_management.h" | 12 #include "chrome/browser/extensions/extension_management.h" |
| 13 #include "chrome/common/extensions/webstore_install_result.h" | |
| 14 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
| 15 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 18 #include "content/public/browser/web_ui_message_handler.h" | 17 #include "content/public/browser/web_ui_message_handler.h" |
| 19 #include "extensions/browser/extension_prefs_observer.h" | 18 #include "extensions/browser/extension_prefs_observer.h" |
| 20 #include "extensions/browser/warning_service.h" | 19 #include "extensions/browser/warning_service.h" |
| 21 | 20 |
| 22 class ExtensionService; | 21 class ExtensionService; |
| 23 class GURL; | 22 class GURL; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 76 |
| 78 // ExtensionManagement::Observer implementation. | 77 // ExtensionManagement::Observer implementation. |
| 79 void OnExtensionManagementSettingsChanged() override; | 78 void OnExtensionManagementSettingsChanged() override; |
| 80 | 79 |
| 81 // WarningService::Observer implementation. | 80 // WarningService::Observer implementation. |
| 82 void ExtensionWarningsChanged() override; | 81 void ExtensionWarningsChanged() override; |
| 83 | 82 |
| 84 // Helper method that reloads all unpacked extensions. | 83 // Helper method that reloads all unpacked extensions. |
| 85 void ReloadUnpackedExtensions(); | 84 void ReloadUnpackedExtensions(); |
| 86 | 85 |
| 87 // Callback for "extensionSettingsLaunch" message. | |
| 88 void HandleLaunchMessage(const base::ListValue* args); | |
| 89 | |
| 90 // Callback for "extensionSettingsRepair" message. | |
| 91 void HandleRepairMessage(const base::ListValue* args); | |
| 92 | |
| 93 // Callback for "extensionSettingsOptions" message. | |
| 94 void HandleOptionsMessage(const base::ListValue* args); | |
| 95 | |
| 96 // Callback for "extensionSettingsAutoupdate" message. | |
| 97 void HandleAutoUpdateMessage(const base::ListValue* args); | |
| 98 | |
| 99 // Callback for the "extensionSettingsShowPath" message. | |
| 100 void HandleShowPath(const base::ListValue* args); | |
| 101 | |
| 102 // Callback for the "extensionSettingsRegister" message. | 86 // Callback for the "extensionSettingsRegister" message. |
| 103 void HandleRegisterMessage(const base::ListValue* args); | 87 void HandleRegisterMessage(const base::ListValue* args); |
| 104 | 88 |
| 105 // Utility for callbacks that get an extension ID as the sole argument. | |
| 106 // Returns NULL if the extension isn't active. | |
| 107 const Extension* GetActiveExtension(const base::ListValue* args); | |
| 108 | |
| 109 // Forces a UI update if appropriate after a notification is received. | 89 // Forces a UI update if appropriate after a notification is received. |
| 110 void MaybeUpdateAfterNotification(); | 90 void MaybeUpdateAfterNotification(); |
| 111 | 91 |
| 112 // Called when the reinstallation is complete. | |
| 113 void OnReinstallComplete(bool success, | |
| 114 const std::string& error, | |
| 115 webstore_install::Result result); | |
| 116 | |
| 117 // Our model. Outlives us since it's owned by our containing profile. | 92 // Our model. Outlives us since it's owned by our containing profile. |
| 118 ExtensionService* extension_service_; | 93 ExtensionService* extension_service_; |
| 119 | 94 |
| 120 // If true, we will ignore notifications in ::Observe(). This is needed | 95 // If true, we will ignore notifications in ::Observe(). This is needed |
| 121 // to prevent reloading the page when we were the cause of the | 96 // to prevent reloading the page when we were the cause of the |
| 122 // notification. | 97 // notification. |
| 123 bool ignore_notifications_; | 98 bool ignore_notifications_; |
| 124 | 99 |
| 125 // The page may be refreshed in response to a RenderViewHost being destroyed, | 100 // The page may be refreshed in response to a RenderViewHost being destroyed, |
| 126 // but the iteration over RenderViewHosts will include the host because the | 101 // but the iteration over RenderViewHosts will include the host because the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 144 | 119 |
| 145 ScopedObserver<ExtensionManagement, ExtensionManagement::Observer> | 120 ScopedObserver<ExtensionManagement, ExtensionManagement::Observer> |
| 146 extension_management_observer_; | 121 extension_management_observer_; |
| 147 | 122 |
| 148 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 123 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
| 149 }; | 124 }; |
| 150 | 125 |
| 151 } // namespace extensions | 126 } // namespace extensions |
| 152 | 127 |
| 153 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 128 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
| OLD | NEW |