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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void CloseLazyBackgroundPageNow(const std::string& extension_id, | 188 void CloseLazyBackgroundPageNow(const std::string& extension_id, |
189 int sequence_id); | 189 int sequence_id); |
190 | 190 |
191 // Potentially registers a RenderViewHost, if it is associated with an | 191 // Potentially registers a RenderViewHost, if it is associated with an |
192 // extension. Does nothing if this is not an extension renderer. | 192 // extension. Does nothing if this is not an extension renderer. |
193 void RegisterRenderViewHost(content::RenderViewHost* render_view_host); | 193 void RegisterRenderViewHost(content::RenderViewHost* render_view_host); |
194 | 194 |
195 // Clears background page data for this extension. | 195 // Clears background page data for this extension. |
196 void ClearBackgroundPageData(const std::string& extension_id); | 196 void ClearBackgroundPageData(const std::string& extension_id); |
197 | 197 |
| 198 // Returns true if loading background pages should be deferred. This is |
| 199 // true if there are no browser windows open and the browser process was |
| 200 // started to show the app launcher. |
| 201 bool DeferLoadingBackgroundHosts() const; |
| 202 |
198 // Contains all active extension-related RenderViewHost instances for all | 203 // Contains all active extension-related RenderViewHost instances for all |
199 // extensions. We also keep a cache of the host's view type, because that | 204 // extensions. We also keep a cache of the host's view type, because that |
200 // information is not accessible at registration/deregistration time. | 205 // information is not accessible at registration/deregistration time. |
201 ExtensionRenderViews all_extension_views_; | 206 ExtensionRenderViews all_extension_views_; |
202 | 207 |
203 BackgroundPageDataMap background_page_data_; | 208 BackgroundPageDataMap background_page_data_; |
204 | 209 |
205 // The time to delay between an extension becoming idle and | 210 // The time to delay between an extension becoming idle and |
206 // sending a ShouldSuspend message; read from command-line switch. | 211 // sending a ShouldSuspend message; read from command-line switch. |
207 base::TimeDelta event_page_idle_time_; | 212 base::TimeDelta event_page_idle_time_; |
208 | 213 |
209 // The time to delay between sending a ShouldSuspend message and | 214 // The time to delay between sending a ShouldSuspend message and |
210 // sending a Suspend message; read from command-line switch. | 215 // sending a Suspend message; read from command-line switch. |
211 base::TimeDelta event_page_suspending_time_; | 216 base::TimeDelta event_page_suspending_time_; |
212 | 217 |
213 base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_; | 218 base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_; |
214 | 219 |
215 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 220 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
216 }; | 221 }; |
217 | 222 |
218 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 223 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |