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_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> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::set<RenderViewHost*> GetRenderViewHostsForExtension( | 86 std::set<RenderViewHost*> GetRenderViewHostsForExtension( |
87 const std::string& extension_id); | 87 const std::string& extension_id); |
88 | 88 |
89 // Returns true if |host| is managed by this process manager. | 89 // Returns true if |host| is managed by this process manager. |
90 bool HasExtensionHost(ExtensionHost* host) const; | 90 bool HasExtensionHost(ExtensionHost* host) const; |
91 | 91 |
92 // Called when the render reports that the extension is idle (only if | 92 // Called when the render reports that the extension is idle (only if |
93 // lazy background pages are enabled). | 93 // lazy background pages are enabled). |
94 void OnExtensionIdle(const std::string& extension_id); | 94 void OnExtensionIdle(const std::string& extension_id); |
95 | 95 |
| 96 // Dispatch an event to the extension to let it know it was just installed. |
| 97 // TODO(mpcomplete): Temporary until we implement persistent event registry. |
| 98 void DispatchExtensionInstalledEvent(const Extension* extension); |
| 99 |
96 typedef std::set<ExtensionHost*> ExtensionHostSet; | 100 typedef std::set<ExtensionHost*> ExtensionHostSet; |
97 typedef ExtensionHostSet::const_iterator const_iterator; | 101 typedef ExtensionHostSet::const_iterator const_iterator; |
98 const_iterator begin() const { return all_hosts_.begin(); } | 102 const_iterator begin() const { return all_hosts_.begin(); } |
99 const_iterator end() const { return all_hosts_.end(); } | 103 const_iterator end() const { return all_hosts_.end(); } |
100 | 104 |
101 protected: | 105 protected: |
102 explicit ExtensionProcessManager(Profile* profile); | 106 explicit ExtensionProcessManager(Profile* profile); |
103 | 107 |
104 // Called just after |host| is created so it can be registered in our lists. | 108 // Called just after |host| is created so it can be registered in our lists. |
105 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); | 109 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // Close the given |host| iff it's a background page. | 141 // Close the given |host| iff it's a background page. |
138 void CloseBackgroundHost(ExtensionHost* host); | 142 void CloseBackgroundHost(ExtensionHost* host); |
139 | 143 |
140 // Excludes background page. | 144 // Excludes background page. |
141 bool HasVisibleViews(const std::string& extension_id); | 145 bool HasVisibleViews(const std::string& extension_id); |
142 | 146 |
143 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 147 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
144 }; | 148 }; |
145 | 149 |
146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 150 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |