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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 public ErrorConsole::Observer, | 72 public ErrorConsole::Observer, |
73 public ExtensionInstallPrompt::Delegate, | 73 public ExtensionInstallPrompt::Delegate, |
74 public ExtensionManagement::Observer, | 74 public ExtensionManagement::Observer, |
75 public ExtensionPrefsObserver, | 75 public ExtensionPrefsObserver, |
76 public ExtensionRegistryObserver, | 76 public ExtensionRegistryObserver, |
77 public ExtensionUninstallDialog::Delegate, | 77 public ExtensionUninstallDialog::Delegate, |
78 public WarningService::Observer, | 78 public WarningService::Observer, |
79 public base::SupportsWeakPtr<ExtensionSettingsHandler> { | 79 public base::SupportsWeakPtr<ExtensionSettingsHandler> { |
80 public: | 80 public: |
81 ExtensionSettingsHandler(); | 81 ExtensionSettingsHandler(); |
82 virtual ~ExtensionSettingsHandler(); | 82 ~ExtensionSettingsHandler() override; |
83 | 83 |
84 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 84 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
85 | 85 |
86 // Extension Detail JSON Struct for page. |pages| is injected for unit | 86 // Extension Detail JSON Struct for page. |pages| is injected for unit |
87 // testing. | 87 // testing. |
88 // Note: |warning_service| can be NULL in unit tests. | 88 // Note: |warning_service| can be NULL in unit tests. |
89 base::DictionaryValue* CreateExtensionDetailValue( | 89 base::DictionaryValue* CreateExtensionDetailValue( |
90 const Extension* extension, | 90 const Extension* extension, |
91 const std::vector<ExtensionPage>& pages, | 91 const std::vector<ExtensionPage>& pages, |
92 const WarningService* warning_service); | 92 const WarningService* warning_service); |
93 | 93 |
94 void GetLocalizedValues(content::WebUIDataSource* source); | 94 void GetLocalizedValues(content::WebUIDataSource* source); |
95 | 95 |
96 private: | 96 private: |
97 friend class ExtensionUITest; | 97 friend class ExtensionUITest; |
98 friend class BrokerDelegate; | 98 friend class BrokerDelegate; |
99 | 99 |
100 // content::WebContentsObserver implementation. | 100 // content::WebContentsObserver implementation. |
101 virtual void RenderViewDeleted( | 101 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; |
102 content::RenderViewHost* render_view_host) override; | 102 void DidStartNavigationToPendingEntry( |
103 virtual void DidStartNavigationToPendingEntry( | |
104 const GURL& url, | 103 const GURL& url, |
105 content::NavigationController::ReloadType reload_type) override; | 104 content::NavigationController::ReloadType reload_type) override; |
106 | 105 |
107 // Allows injection for testing by friend classes. | 106 // Allows injection for testing by friend classes. |
108 ExtensionSettingsHandler(ExtensionService* service, | 107 ExtensionSettingsHandler(ExtensionService* service, |
109 ManagementPolicy* policy); | 108 ManagementPolicy* policy); |
110 | 109 |
111 // WebUIMessageHandler implementation. | 110 // WebUIMessageHandler implementation. |
112 virtual void RegisterMessages() override; | 111 void RegisterMessages() override; |
113 | 112 |
114 // ErrorConsole::Observer implementation. | 113 // ErrorConsole::Observer implementation. |
115 virtual void OnErrorAdded(const ExtensionError* error) override; | 114 void OnErrorAdded(const ExtensionError* error) override; |
116 | 115 |
117 // content::NotificationObserver implementation. | 116 // content::NotificationObserver implementation. |
118 virtual void Observe(int type, | 117 void Observe(int type, |
119 const content::NotificationSource& source, | 118 const content::NotificationSource& source, |
120 const content::NotificationDetails& details) override; | 119 const content::NotificationDetails& details) override; |
121 | 120 |
122 // ExtensionRegistryObserver implementation. | 121 // ExtensionRegistryObserver implementation. |
123 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 122 void OnExtensionLoaded(content::BrowserContext* browser_context, |
124 const Extension* extension) override; | 123 const Extension* extension) override; |
125 virtual void OnExtensionUnloaded( | 124 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
126 content::BrowserContext* browser_context, | 125 const Extension* extension, |
127 const Extension* extension, | 126 UnloadedExtensionInfo::Reason reason) override; |
128 UnloadedExtensionInfo::Reason reason) override; | 127 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
129 virtual void OnExtensionUninstalled( | 128 const Extension* extension, |
130 content::BrowserContext* browser_context, | 129 extensions::UninstallReason reason) override; |
131 const Extension* extension, | |
132 extensions::UninstallReason reason) override; | |
133 | 130 |
134 // ExtensionPrefsObserver implementation. | 131 // ExtensionPrefsObserver implementation. |
135 virtual void OnExtensionDisableReasonsChanged(const std::string& extension_id, | 132 void OnExtensionDisableReasonsChanged(const std::string& extension_id, |
136 int disable_reasons) override; | 133 int disable_reasons) override; |
137 | 134 |
138 // ExtensionManagement::Observer implementation. | 135 // ExtensionManagement::Observer implementation. |
139 virtual void OnExtensionManagementSettingsChanged() override; | 136 void OnExtensionManagementSettingsChanged() override; |
140 | 137 |
141 // ExtensionUninstallDialog::Delegate implementation, used for receiving | 138 // ExtensionUninstallDialog::Delegate implementation, used for receiving |
142 // notification about uninstall confirmation dialog selections. | 139 // notification about uninstall confirmation dialog selections. |
143 virtual void ExtensionUninstallAccepted() override; | 140 void ExtensionUninstallAccepted() override; |
144 virtual void ExtensionUninstallCanceled() override; | 141 void ExtensionUninstallCanceled() override; |
145 | 142 |
146 // WarningService::Observer implementation. | 143 // WarningService::Observer implementation. |
147 virtual void ExtensionWarningsChanged() override; | 144 void ExtensionWarningsChanged() override; |
148 | 145 |
149 // ExtensionInstallPrompt::Delegate implementation. | 146 // ExtensionInstallPrompt::Delegate implementation. |
150 virtual void InstallUIProceed() override; | 147 void InstallUIProceed() override; |
151 virtual void InstallUIAbort(bool user_initiated) override; | 148 void InstallUIAbort(bool user_initiated) override; |
152 | 149 |
153 // Called after the App Info Dialog has closed. | 150 // Called after the App Info Dialog has closed. |
154 virtual void AppInfoDialogClosed(); | 151 virtual void AppInfoDialogClosed(); |
155 | 152 |
156 // Helper method that reloads all unpacked extensions. | 153 // Helper method that reloads all unpacked extensions. |
157 void ReloadUnpackedExtensions(); | 154 void ReloadUnpackedExtensions(); |
158 | 155 |
159 // Callback for "requestExtensionsData" message. | 156 // Callback for "requestExtensionsData" message. |
160 void HandleRequestExtensionsData(const base::ListValue* args); | 157 void HandleRequestExtensionsData(const base::ListValue* args); |
161 | 158 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // Whether we found any DISABLE_NOT_VERIFIED extensions and want to kick off | 316 // Whether we found any DISABLE_NOT_VERIFIED extensions and want to kick off |
320 // a verification check to try and rescue them. | 317 // a verification check to try and rescue them. |
321 bool should_do_verification_check_; | 318 bool should_do_verification_check_; |
322 | 319 |
323 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 320 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
324 }; | 321 }; |
325 | 322 |
326 } // namespace extensions | 323 } // namespace extensions |
327 | 324 |
328 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 325 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
OLD | NEW |