Chromium Code Reviews| Index: chrome/browser/extensions/extension_process_manager.cc |
| diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc |
| index 6b91f335b1ed44b983adf40ef89405e1d7002d14..0fff08f1c6f9f6100f954315699ba05eb0b30639 100644 |
| --- a/chrome/browser/extensions/extension_process_manager.cc |
| +++ b/chrome/browser/extensions/extension_process_manager.cc |
| @@ -7,7 +7,6 @@ |
| #include "chrome/browser/extensions/extension_process_manager.h" |
| #include "chrome/browser/ui/browser_window.h" |
| -#include "content/browser/browsing_instance.h" |
| #include "chrome/browser/extensions/extension_event_router.h" |
| #if defined(OS_MACOSX) |
| #include "chrome/browser/extensions/extension_host_mac.h" |
| @@ -96,7 +95,7 @@ ExtensionProcessManager* ExtensionProcessManager::Create(Profile* profile) { |
| } |
| ExtensionProcessManager::ExtensionProcessManager(Profile* profile) |
| - : browsing_instance_(new BrowsingInstance(profile)) { |
| + : site_instance_(SiteInstance::CreateSiteInstance(profile)) { |
| Profile* original_profile = profile->GetOriginalProfile(); |
| registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
| content::Source<Profile>(original_profile)); |
| @@ -157,7 +156,7 @@ ExtensionHost* ExtensionProcessManager::CreateViewHost( |
| DCHECK(browser || |
| (!browser && view_type == chrome::VIEW_TYPE_EXTENSION_POPUP)); |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
|
Matt Perry
2012/01/17 19:35:09
nit: since you're in here, if you wouldn't mind, c
Jói
2012/01/18 10:29:11
Done.
|
| ExtensionService* service = profile->GetExtensionService(); |
| if (service) { |
| const Extension* extension = |
| @@ -227,7 +226,7 @@ void ExtensionProcessManager::OpenOptionsPage(const Extension* extension, |
| // able to save settings from OTR. |
| if (!browser || browser->profile()->IsOffTheRecord()) { |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
| browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile()); |
| } |
| @@ -283,7 +282,7 @@ void ExtensionProcessManager::UnregisterRenderViewHost( |
| } |
| SiteInstance* ExtensionProcessManager::GetSiteInstanceForURL(const GURL& url) { |
| - return browsing_instance_->GetSiteInstanceForURL(url); |
| + return site_instance_->GetRelatedSiteInstance(url); |
| } |
| bool ExtensionProcessManager::HasExtensionHost(ExtensionHost* host) const { |
| @@ -294,7 +293,7 @@ void ExtensionProcessManager::OnExtensionIdle(const std::string& extension_id) { |
| ExtensionHost* host = GetBackgroundHostForExtension(extension_id); |
| if (host && !HasVisibleViews(extension_id)) { |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
| if (!profile->GetExtensionEventRouter()->HasInFlightEvents(extension_id)) |
| CloseBackgroundHost(host); |
| } |
| @@ -383,7 +382,7 @@ void ExtensionProcessManager::Observe( |
| void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, |
| bool is_background) { |
| - DCHECK_EQ(browsing_instance_->browser_context(), host->profile()); |
| + DCHECK_EQ(site_instance_->GetBrowserContext(), host->profile()); |
| all_hosts_.insert(host); |
| if (is_background) |
| @@ -456,7 +455,7 @@ void IncognitoExtensionProcessManager::CreateBackgroundHost( |
| SiteInstance* IncognitoExtensionProcessManager::GetSiteInstanceForURL( |
| const GURL& url) { |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
| ExtensionService* service = profile->GetExtensionService(); |
| if (service) { |
| const Extension* extension = service->extensions()->GetExtensionOrAppByURL( |
| @@ -471,7 +470,7 @@ bool IncognitoExtensionProcessManager::IsIncognitoEnabled( |
| const Extension* extension) { |
| // Keep in sync with duplicate in extension_info_map.cc. |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
| ExtensionService* service = profile->GetExtensionService(); |
| return service && service->IsIncognitoEnabled(extension->id()); |
| } |
| @@ -489,12 +488,12 @@ void IncognitoExtensionProcessManager::Observe( |
| // incognito window. Watch for new browsers and create the hosts if |
| // it matches our profile. |
| Browser* browser = content::Source<Browser>(source).ptr(); |
| - if (browser->profile() == browsing_instance_->browser_context()) { |
| + if (browser->profile() == site_instance_->GetBrowserContext()) { |
| // On Chrome OS, a login screen is implemented as a browser. |
| // This browser has no extension service. In this case, |
| // service will be NULL. |
| Profile* profile = |
| - Profile::FromBrowserContext(browsing_instance_->browser_context()); |
| + Profile::FromBrowserContext(site_instance_->GetBrowserContext()); |
| ExtensionService* service = profile->GetExtensionService(); |
| if (service && service->is_ready()) |
| CreateBackgroundHostsForProfileStartup(this, service->extensions()); |