OLD | NEW |
1 // Copyright (c) 2011 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_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
(...skipping 14 matching lines...) Expand all Loading... |
26 class SiteInstance; | 26 class SiteInstance; |
27 | 27 |
28 // Manages dynamic state of running Chromium extensions. There is one instance | 28 // Manages dynamic state of running Chromium extensions. There is one instance |
29 // of this class per Profile. OTR Profiles have a separate instance that keeps | 29 // of this class per Profile. OTR Profiles have a separate instance that keeps |
30 // track of split-mode extensions only. | 30 // track of split-mode extensions only. |
31 class ExtensionProcessManager : public content::NotificationObserver { | 31 class ExtensionProcessManager : public content::NotificationObserver { |
32 public: | 32 public: |
33 static ExtensionProcessManager* Create(Profile* profile); | 33 static ExtensionProcessManager* Create(Profile* profile); |
34 virtual ~ExtensionProcessManager(); | 34 virtual ~ExtensionProcessManager(); |
35 | 35 |
| 36 ExtensionHost* CreateShellHost(const Extension* extension, const GURL& url); |
| 37 |
36 // Creates a new ExtensionHost with its associated view, grouping it in the | 38 // Creates a new ExtensionHost with its associated view, grouping it in the |
37 // appropriate SiteInstance (and therefore process) based on the URL and | 39 // appropriate SiteInstance (and therefore process) based on the URL and |
38 // profile. | 40 // profile. |
39 virtual ExtensionHost* CreateViewHost(const Extension* extension, | 41 virtual ExtensionHost* CreateViewHost(const Extension* extension, |
40 const GURL& url, | 42 const GURL& url, |
41 Browser* browser, | 43 Browser* browser, |
42 content::ViewType view_type); | 44 content::ViewType view_type); |
43 ExtensionHost* CreateViewHost(const GURL& url, | 45 ExtensionHost* CreateViewHost(const GURL& url, |
44 Browser* browser, | 46 Browser* browser, |
45 content::ViewType view_type); | 47 content::ViewType view_type); |
46 ExtensionHost* CreatePopupHost(const Extension* extension, | 48 ExtensionHost* CreatePopupHost(const Extension* extension, |
47 const GURL& url, | 49 const GURL& url, |
48 Browser* browser); | 50 Browser* browser); |
49 ExtensionHost* CreatePopupHost(const GURL& url, Browser* browser); | 51 ExtensionHost* CreatePopupHost(const GURL& url, Browser* browser); |
50 ExtensionHost* CreateDialogHost(const GURL& url, Browser* browser); | 52 ExtensionHost* CreateDialogHost(const GURL& url, Browser* browser); |
51 ExtensionHost* CreateInfobarHost(const Extension* extension, | 53 ExtensionHost* CreateInfobarHost(const Extension* extension, |
52 const GURL& url, | 54 const GURL& url, |
53 Browser* browser); | 55 Browser* browser); |
54 ExtensionHost* CreateInfobarHost(const GURL& url, | 56 ExtensionHost* CreateInfobarHost(const GURL& url, |
55 Browser* browser); | 57 Browser* browser); |
56 | 58 |
| 59 ExtensionHost* CreateShellHost(const GURL& url, Browser* browser); |
| 60 |
57 // Open the extension's options page. | 61 // Open the extension's options page. |
58 void OpenOptionsPage(const Extension* extension, Browser* browser); | 62 void OpenOptionsPage(const Extension* extension, Browser* browser); |
59 | 63 |
60 // Creates a new UI-less extension instance. Like CreateViewHost, but not | 64 // Creates a new UI-less extension instance. Like CreateViewHost, but not |
61 // displayed anywhere. | 65 // displayed anywhere. |
62 virtual void CreateBackgroundHost(const Extension* extension, | 66 virtual void CreateBackgroundHost(const Extension* extension, |
63 const GURL& url); | 67 const GURL& url); |
64 | 68 |
65 // Gets the ExtensionHost for the background page for an extension, or NULL if | 69 // Gets the ExtensionHost for the background page for an extension, or NULL if |
66 // the extension isn't running or doesn't have a background page. | 70 // the extension isn't running or doesn't have a background page. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Close the given |host| iff it's a background page. | 133 // Close the given |host| iff it's a background page. |
130 void CloseBackgroundHost(ExtensionHost* host); | 134 void CloseBackgroundHost(ExtensionHost* host); |
131 | 135 |
132 // Excludes background page. | 136 // Excludes background page. |
133 bool HasVisibleViews(const std::string& extension_id); | 137 bool HasVisibleViews(const std::string& extension_id); |
134 | 138 |
135 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 139 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
136 }; | 140 }; |
137 | 141 |
138 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 142 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |