Index: extensions/browser/process_manager.h |
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h |
index 664c9420fde504a05d071e6de9a9a232722b57fa..6acc267ca68e2a0711b846db04eb761de754215e 100644 |
--- a/extensions/browser/process_manager.h |
+++ b/extensions/browser/process_manager.h |
@@ -125,6 +125,14 @@ class ProcessManager : public content::NotificationObserver { |
// Ensures background hosts are loaded for a new browser window. |
void OnBrowserWindowReady(); |
+ // Notifies the ProcessManager that a BrowserContext is fully initialized. |
+ // A BrowserContext might be initialized asynchronously (in parallel with |
+ // extension system startup). The ProcessManager needs to know when that |
+ // initialization is complete so it can load deferred background pages. |
+ // (See NOTIFICATION_PROFILE_CREATED in Chrome and IsContextValid() in |
+ // ExtensionsBrowserClient). |
+ void OnBrowserContextValid(content::BrowserContext* context); |
+ |
// Gets the BrowserContext associated with site_instance_ and all other |
// related SiteInstances. |
content::BrowserContext* GetBrowserContext() const; |
@@ -144,6 +152,10 @@ class ProcessManager : public content::NotificationObserver { |
content::BrowserContext* original_context, |
ProcessManager* original_manager); |
+ bool startup_background_hosts_created_for_test() const { |
+ return startup_background_hosts_created_; |
+ } |
+ |
protected: |
// If |context| is incognito pass the master context as |original_context|. |
// Otherwise pass the same context for both. |
@@ -158,9 +170,8 @@ class ProcessManager : public content::NotificationObserver { |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
- // Load all background pages once the profile data is ready and the pages |
- // should be loaded. |
- void CreateBackgroundHostsForProfileStartup(); |
+ // Loads all background pages for a BrowserContext if everything is ready. |
+ void MaybeCreateBackgroundHostsForStartup(); |
content::NotificationRegistrar registrar_; |