Index: chrome/browser/extensions/chrome_extensions_browser_client.cc |
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc |
index c66d02366f9fe3ccf28297d9e0556fd024d914d4..1a0d6c741163813261d82f81f9fc780855bef4b0 100644 |
--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc |
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc |
@@ -162,8 +162,16 @@ bool ChromeExtensionsBrowserClient::DeferLoadingBackgroundHosts( |
content::BrowserContext* context) const { |
Profile* profile = static_cast<Profile*>(context); |
+ // Defer forever if current session is a Guest mode session and current |
+ // browser context is *not* off-the-record. Such context is artificial and |
+ // background page shouldn't be created in it. |
+ if (profile->IsGuestSession() && !profile->IsOffTheRecord()) |
+ return true; |
+ |
// The profile may not be valid yet if it is still being initialized. |
// In that case, defer loading, since it depends on an initialized profile. |
+ // Background hosts will be loaded later via NOTIFICATION_PROFILE_CREATED |
+ // in ChromeNotificationObserver. |
// http://crbug.com/222473 |
if (!g_browser_process->profile_manager()->IsValidProfile(profile)) |
return true; |
@@ -172,7 +180,8 @@ bool ChromeExtensionsBrowserClient::DeferLoadingBackgroundHosts( |
return false; |
#else |
// There are no browser windows open and the browser process was |
- // started to show the app launcher. |
+ // started to show the app launcher. Background hosts will be loaded later |
+ // via NOTIFICATION_BROWSER_WINDOW_READY in ChromeNotificationObserver. |
return chrome::GetTotalBrowserCountForProfile(profile) == 0 && |
CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList); |
#endif |
@@ -180,11 +189,8 @@ bool ChromeExtensionsBrowserClient::DeferLoadingBackgroundHosts( |
bool ChromeExtensionsBrowserClient::IsBackgroundPageAllowed( |
content::BrowserContext* context) const { |
- // Returns true if current session is Guest mode session and current |
- // browser context is *not* off-the-record. Such context is artificial and |
- // background page shouldn't be created in it. |
- return !static_cast<Profile*>(context)->IsGuestSession() || |
- context->IsOffTheRecord(); |
+//JAMES remove me |
+ return true; |
} |
scoped_ptr<ExtensionHostDelegate> |