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/public/pref_change_registrar.h" | 13 #include "base/prefs/public/pref_change_registrar.h" |
| 14 #include "base/prefs/public/pref_observer.h" |
14 #include "chrome/browser/extensions/extension_install_ui.h" | 15 #include "chrome/browser/extensions/extension_install_ui.h" |
15 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 16 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
16 #include "chrome/browser/extensions/extension_warning_set.h" | 17 #include "chrome/browser/extensions/extension_warning_set.h" |
17 #include "chrome/browser/extensions/requirements_checker.h" | 18 #include "chrome/browser/extensions/requirements_checker.h" |
18 #include "chrome/common/extensions/extension_resource.h" | 19 #include "chrome/common/extensions/extension_resource.h" |
19 #include "content/public/browser/navigation_controller.h" | 20 #include "content/public/browser/navigation_controller.h" |
20 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
23 #include "content/public/browser/web_contents_observer.h" | 24 #include "content/public/browser/web_contents_observer.h" |
(...skipping 28 matching lines...) Expand all Loading... |
52 GURL url; | 53 GURL url; |
53 int render_process_id; | 54 int render_process_id; |
54 int render_view_id; | 55 int render_view_id; |
55 bool incognito; | 56 bool incognito; |
56 }; | 57 }; |
57 | 58 |
58 // Extension Settings UI handler. | 59 // Extension Settings UI handler. |
59 class ExtensionSettingsHandler | 60 class ExtensionSettingsHandler |
60 : public content::WebUIMessageHandler, | 61 : public content::WebUIMessageHandler, |
61 public content::NotificationObserver, | 62 public content::NotificationObserver, |
| 63 public PrefObserver, |
62 public content::WebContentsObserver, | 64 public content::WebContentsObserver, |
63 public ui::SelectFileDialog::Listener, | 65 public ui::SelectFileDialog::Listener, |
64 public ExtensionUninstallDialog::Delegate, | 66 public ExtensionUninstallDialog::Delegate, |
65 public base::SupportsWeakPtr<ExtensionSettingsHandler>{ | 67 public base::SupportsWeakPtr<ExtensionSettingsHandler>{ |
66 public: | 68 public: |
67 ExtensionSettingsHandler(); | 69 ExtensionSettingsHandler(); |
68 virtual ~ExtensionSettingsHandler(); | 70 virtual ~ExtensionSettingsHandler(); |
69 | 71 |
70 static void RegisterUserPrefs(PrefService* prefs); | 72 static void RegisterUserPrefs(PrefService* prefs); |
71 | 73 |
(...skipping 28 matching lines...) Expand all Loading... |
100 int index, void* params) OVERRIDE; | 102 int index, void* params) OVERRIDE; |
101 virtual void MultiFilesSelected( | 103 virtual void MultiFilesSelected( |
102 const std::vector<FilePath>& files, void* params) OVERRIDE; | 104 const std::vector<FilePath>& files, void* params) OVERRIDE; |
103 virtual void FileSelectionCanceled(void* params) OVERRIDE {} | 105 virtual void FileSelectionCanceled(void* params) OVERRIDE {} |
104 | 106 |
105 // content::NotificationObserver implementation. | 107 // content::NotificationObserver implementation. |
106 virtual void Observe(int type, | 108 virtual void Observe(int type, |
107 const content::NotificationSource& source, | 109 const content::NotificationSource& source, |
108 const content::NotificationDetails& details) OVERRIDE; | 110 const content::NotificationDetails& details) OVERRIDE; |
109 | 111 |
| 112 // PrefObserver implementation. |
| 113 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 114 const std::string& pref_name) OVERRIDE; |
| 115 |
110 // ExtensionUninstallDialog::Delegate implementation, used for receiving | 116 // ExtensionUninstallDialog::Delegate implementation, used for receiving |
111 // notification about uninstall confirmation dialog selections. | 117 // notification about uninstall confirmation dialog selections. |
112 virtual void ExtensionUninstallAccepted() OVERRIDE; | 118 virtual void ExtensionUninstallAccepted() OVERRIDE; |
113 virtual void ExtensionUninstallCanceled() OVERRIDE; | 119 virtual void ExtensionUninstallCanceled() OVERRIDE; |
114 | 120 |
115 // Helper method that reloads all unpacked extensions. | 121 // Helper method that reloads all unpacked extensions. |
116 void ReloadUnpackedExtensions(); | 122 void ReloadUnpackedExtensions(); |
117 | 123 |
118 // Callback for "requestExtensionsData" message. | 124 // Callback for "requestExtensionsData" message. |
119 void HandleRequestExtensionsData(const base::ListValue* args); | 125 void HandleRequestExtensionsData(const base::ListValue* args); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 233 |
228 // This will not be empty when a requirements check is in progress. Doing | 234 // This will not be empty when a requirements check is in progress. Doing |
229 // another Check() before the previous one is complete will cause the first | 235 // another Check() before the previous one is complete will cause the first |
230 // one to abort. | 236 // one to abort. |
231 scoped_ptr<extensions::RequirementsChecker> requirements_checker_; | 237 scoped_ptr<extensions::RequirementsChecker> requirements_checker_; |
232 | 238 |
233 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); | 239 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler); |
234 }; | 240 }; |
235 | 241 |
236 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ | 242 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_SETTINGS_HANDLER_H_ |
OLD | NEW |