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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" |
15 #include "content/public/common/view_type.h" | 16 #include "content/public/common/view_type.h" |
16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
18 | 19 |
19 class Browser; | 20 class Browser; |
20 class Extension; | 21 class Extension; |
21 class ExtensionHost; | 22 class ExtensionHost; |
22 class GURL; | 23 class GURL; |
23 class Profile; | 24 class Profile; |
24 | 25 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 176 |
176 // Close the given |host| iff it's a background page. | 177 // Close the given |host| iff it's a background page. |
177 void CloseBackgroundHost(ExtensionHost* host); | 178 void CloseBackgroundHost(ExtensionHost* host); |
178 | 179 |
179 // Ensure browser object is not null except for certain situations. | 180 // Ensure browser object is not null except for certain situations. |
180 void EnsureBrowserWhenRequired(Browser* browser, | 181 void EnsureBrowserWhenRequired(Browser* browser, |
181 content::ViewType view_type); | 182 content::ViewType view_type); |
182 | 183 |
183 // These are called when the extension transitions between idle and active. | 184 // These are called when the extension transitions between idle and active. |
184 // They control the process of closing the background page when idle. | 185 // They control the process of closing the background page when idle. |
185 void OnLazyBackgroundPageIdle(const std::string& extension_id); | 186 void OnLazyBackgroundPageIdle(const std::string& extension_id, |
| 187 int close_sequence_id); |
186 void OnLazyBackgroundPageActive(const std::string& extension_id); | 188 void OnLazyBackgroundPageActive(const std::string& extension_id); |
187 | 189 |
188 // Updates a potentially-registered RenderViewHost once it has been | 190 // Updates a potentially-registered RenderViewHost once it has been |
189 // associated with a WebContents. This allows us to gather information that | 191 // associated with a WebContents. This allows us to gather information that |
190 // was not available when the host was first registered. | 192 // was not available when the host was first registered. |
191 void UpdateRegisteredRenderView(content::RenderViewHost* render_view_host); | 193 void UpdateRegisteredRenderView(content::RenderViewHost* render_view_host); |
192 | 194 |
193 BackgroundPageDataMap background_page_data_; | 195 BackgroundPageDataMap background_page_data_; |
194 | 196 |
| 197 base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_; |
| 198 |
195 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 199 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
196 }; | 200 }; |
197 | 201 |
198 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 202 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |