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 | |
100 typedef std::set<ExtensionHost*> ExtensionHostSet; | 96 typedef std::set<ExtensionHost*> ExtensionHostSet; |
101 typedef ExtensionHostSet::const_iterator const_iterator; | 97 typedef ExtensionHostSet::const_iterator const_iterator; |
102 const_iterator begin() const { return all_hosts_.begin(); } | 98 const_iterator begin() const { return all_hosts_.begin(); } |
103 const_iterator end() const { return all_hosts_.end(); } | 99 const_iterator end() const { return all_hosts_.end(); } |
104 | 100 |
105 protected: | 101 protected: |
106 explicit ExtensionProcessManager(Profile* profile); | 102 explicit ExtensionProcessManager(Profile* profile); |
107 | 103 |
108 // Called just after |host| is created so it can be registered in our lists. | 104 // Called just after |host| is created so it can be registered in our lists. |
109 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); | 105 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Close the given |host| iff it's a background page. | 137 // Close the given |host| iff it's a background page. |
142 void CloseBackgroundHost(ExtensionHost* host); | 138 void CloseBackgroundHost(ExtensionHost* host); |
143 | 139 |
144 // Excludes background page. | 140 // Excludes background page. |
145 bool HasVisibleViews(const std::string& extension_id); | 141 bool HasVisibleViews(const std::string& extension_id); |
146 | 142 |
147 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 143 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
148 }; | 144 }; |
149 | 145 |
150 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |