| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class ExtensionsService; | 25 class ExtensionsService; |
| 26 class FilePath; | 26 class FilePath; |
| 27 class ListValue; | 27 class ListValue; |
| 28 class PrefService; | 28 class PrefService; |
| 29 class RenderProcessHost; | 29 class RenderProcessHost; |
| 30 class UserScript; | 30 class UserScript; |
| 31 | 31 |
| 32 // Information about a page running in an extension, for example a toolstrip, | 32 // Information about a page running in an extension, for example a toolstrip, |
| 33 // a background page, or a tab contents. | 33 // a background page, or a tab contents. |
| 34 struct ExtensionPage { | 34 struct ExtensionPage { |
| 35 ExtensionPage(const GURL& url, int render_process_id, int render_view_id) | 35 ExtensionPage(const GURL& url, int render_process_id, int render_view_id, |
| 36 bool incognito) |
| 36 : url(url), render_process_id(render_process_id), | 37 : url(url), render_process_id(render_process_id), |
| 37 render_view_id(render_view_id) {} | 38 render_view_id(render_view_id), incognito(incognito) {} |
| 38 GURL url; | 39 GURL url; |
| 39 int render_process_id; | 40 int render_process_id; |
| 40 int render_view_id; | 41 int render_view_id; |
| 42 bool incognito; |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource { | 45 class ExtensionsUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 44 public: | 46 public: |
| 45 ExtensionsUIHTMLSource(); | 47 ExtensionsUIHTMLSource(); |
| 46 | 48 |
| 47 // Called when the network layer has requested a resource underneath | 49 // Called when the network layer has requested a resource underneath |
| 48 // the path we registered. | 50 // the path we registered. |
| 49 virtual void StartDataRequest(const std::string& path, | 51 virtual void StartDataRequest(const std::string& path, |
| 50 bool is_off_the_record, | 52 bool is_off_the_record, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 NOTREACHED(); | 191 NOTREACHED(); |
| 190 } | 192 } |
| 191 virtual void FileSelectionCanceled(void* params) {} | 193 virtual void FileSelectionCanceled(void* params) {} |
| 192 | 194 |
| 193 // NotificationObserver | 195 // NotificationObserver |
| 194 virtual void Observe(NotificationType type, | 196 virtual void Observe(NotificationType type, |
| 195 const NotificationSource& source, | 197 const NotificationSource& source, |
| 196 const NotificationDetails& details); | 198 const NotificationDetails& details); |
| 197 | 199 |
| 198 // Helper that lists the current active html pages for an extension. | 200 // Helper that lists the current active html pages for an extension. |
| 199 std::vector<ExtensionPage> GetActivePagesForExtension( | 201 std::vector<ExtensionPage> GetActivePagesForExtension(Extension* extension); |
| 202 void GetActivePagesForExtensionProcess( |
| 200 RenderProcessHost* process, | 203 RenderProcessHost* process, |
| 201 Extension* extension); | 204 Extension* extension, |
| 205 std::vector<ExtensionPage> *result); |
| 202 | 206 |
| 203 // Returns the best icon to display in the UI for an extension, or an empty | 207 // Returns the best icon to display in the UI for an extension, or an empty |
| 204 // ExtensionResource if no good icon exists. | 208 // ExtensionResource if no good icon exists. |
| 205 ExtensionResource PickExtensionIcon(Extension* extension); | 209 ExtensionResource PickExtensionIcon(Extension* extension); |
| 206 | 210 |
| 207 // Loads the extension resources into the json data, then calls OnIconsLoaded. | 211 // Loads the extension resources into the json data, then calls OnIconsLoaded. |
| 208 // Takes ownership of |icons|. | 212 // Takes ownership of |icons|. |
| 209 // Called on the file thread. | 213 // Called on the file thread. |
| 210 void LoadExtensionIcons(std::vector<ExtensionResource>* icons, | 214 void LoadExtensionIcons(std::vector<ExtensionResource>* icons, |
| 211 DictionaryValue* json_data); | 215 DictionaryValue* json_data); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 266 |
| 263 static RefCountedMemory* GetFaviconResourceBytes(); | 267 static RefCountedMemory* GetFaviconResourceBytes(); |
| 264 | 268 |
| 265 static void RegisterUserPrefs(PrefService* prefs); | 269 static void RegisterUserPrefs(PrefService* prefs); |
| 266 | 270 |
| 267 private: | 271 private: |
| 268 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); | 272 DISALLOW_COPY_AND_ASSIGN(ExtensionsUI); |
| 269 }; | 273 }; |
| 270 | 274 |
| 271 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ | 275 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_UI_H_ |
| OLD | NEW |