OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_EXTENSIONS_EXTENSIONS_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 11 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
12 #include "chrome/browser/dom_ui/dom_ui.h" | 12 #include "chrome/browser/dom_ui/dom_ui.h" |
13 #include "chrome/browser/extensions/pack_extension_job.h" | 13 #include "chrome/browser/extensions/pack_extension_job.h" |
14 #include "chrome/browser/shell_dialogs.h" | 14 #include "chrome/browser/shell_dialogs.h" |
15 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
19 class DictionaryValue; | 19 class DictionaryValue; |
20 class Extension; | 20 class Extension; |
21 class ExtensionsService; | 21 class ExtensionsService; |
22 class FilePath; | 22 class FilePath; |
| 23 class PrefService; |
23 class UserScript; | 24 class UserScript; |
24 class Value; | 25 class Value; |
25 | 26 |
26 // Information about a page running in an extension, for example a toolstrip, | 27 // Information about a page running in an extension, for example a toolstrip, |
27 // a background page, or a tab contents. | 28 // a background page, or a tab contents. |
28 struct ExtensionPage { | 29 struct ExtensionPage { |
29 ExtensionPage(const GURL& url, int render_process_id, int render_view_id) | 30 ExtensionPage(const GURL& url, int render_process_id, int render_view_id) |
30 : url(url), render_process_id(render_process_id), | 31 : url(url), render_process_id(render_process_id), |
31 render_view_id(render_view_id) {} | 32 render_view_id(render_view_id) {} |
32 GURL url; | 33 GURL url; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // ExtensionPackJob::Client | 77 // ExtensionPackJob::Client |
77 virtual void OnPackSuccess(const FilePath& crx_file, | 78 virtual void OnPackSuccess(const FilePath& crx_file, |
78 const FilePath& key_file); | 79 const FilePath& key_file); |
79 | 80 |
80 virtual void OnPackFailure(const std::wstring& message); | 81 virtual void OnPackFailure(const std::wstring& message); |
81 | 82 |
82 private: | 83 private: |
83 // Callback for "requestExtensionsData" message. | 84 // Callback for "requestExtensionsData" message. |
84 void HandleRequestExtensionsData(const Value* value); | 85 void HandleRequestExtensionsData(const Value* value); |
85 | 86 |
| 87 // Callback for "toggleDeveloperMode" message. |
| 88 void HandleToggleDeveloperMode(const Value* value); |
| 89 |
86 // Callback for "inspect" message. | 90 // Callback for "inspect" message. |
87 void HandleInspectMessage(const Value* value); | 91 void HandleInspectMessage(const Value* value); |
88 | 92 |
89 // Callback for "reload" message. | 93 // Callback for "reload" message. |
90 void HandleReloadMessage(const Value* value); | 94 void HandleReloadMessage(const Value* value); |
91 | 95 |
92 // Callback for "enable" message. | 96 // Callback for "enable" message. |
93 void HandleEnableMessage(const Value* value); | 97 void HandleEnableMessage(const Value* value); |
94 | 98 |
95 // Callback for "uninstall" message. | 99 // Callback for "uninstall" message. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 150 |
147 DISALLOW_COPY_AND_ASSIGN(ExtensionsDOMHandler); | 151 DISALLOW_COPY_AND_ASSIGN(ExtensionsDOMHandler); |
148 }; | 152 }; |
149 | 153 |
150 class ExtensionsUI : public DOMUI { | 154 class ExtensionsUI : public DOMUI { |
151 public: | 155 public: |
152 explicit ExtensionsUI(TabContents* contents); | 156 explicit ExtensionsUI(TabContents* contents); |
153 | 157 |
154 static RefCountedMemory* GetFaviconResourceBytes(); | 158 static RefCountedMemory* GetFaviconResourceBytes(); |
155 | 159 |
| 160 static void RegisterUserPrefs(PrefService* prefs); |
| 161 |
156 private: | 162 private: |
157 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); | 163 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); |
158 }; | 164 }; |
159 | 165 |
160 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ | 166 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
OLD | NEW |