diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 19:23:38 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-27 19:23:38 +0000 |
commit | 6205c4f2302239185dd2a93c105c18f0dd14af63 (patch) | |
tree | 9281fac0b7e3d7c1819c6b49384fb80b64dd5ab6 /chrome/browser/extensions/extension_process_manager.cc | |
parent | fc0a3b6d4bbacdcf2926200e1f854ba5cc40628d (diff) | |
download | chromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.zip chromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.tar.gz chromium_src-6205c4f2302239185dd2a93c105c18f0dd14af63.tar.bz2 |
Removal of Profile from content part 2.
BUG=76788
TEST=no change visible
Review URL: http://codereview.chromium.org/7480028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_process_manager.cc')
-rw-r--r-- | chrome/browser/extensions/extension_process_manager.cc | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index 1944478..9dc02d4 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -132,8 +132,9 @@ ExtensionHost* ExtensionProcessManager::CreateViewHost( const GURL& url, Browser* browser, ViewType::Type view_type) { // A NULL browser may only be given for pop-up views. DCHECK(browser || (!browser && view_type == ViewType::EXTENSION_POPUP)); - ExtensionService* service = - browsing_instance_->profile()->GetExtensionService(); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + ExtensionService* service = profile->GetExtensionService(); if (service) { const Extension* extension = service->GetExtensionByURL(url); if (extension) @@ -198,8 +199,9 @@ void ExtensionProcessManager::OpenOptionsPage(const Extension* extension, // Force the options page to open in non-OTR window, because it won't be // able to save settings from OTR. if (!browser || browser->profile()->IsOffTheRecord()) { - browser = Browser::GetOrCreateTabbedBrowser( - browsing_instance_->profile()->GetOriginalProfile()); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile()); } browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB, @@ -262,8 +264,9 @@ const Extension* ExtensionProcessManager::GetExtensionForSiteInstance( if (it != extension_ids_.end()) { // Look up the extension by ID, including disabled extensions in case // this gets called while an old process is still around. - ExtensionService* service = - browsing_instance_->profile()->GetExtensionService(); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + ExtensionService* service = profile->GetExtensionService(); return service->GetExtensionById(it->second, false); } @@ -342,7 +345,7 @@ void ExtensionProcessManager::Observe(int type, void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, bool is_background) { - DCHECK_EQ(browsing_instance_->profile(), host->profile()); + DCHECK_EQ(browsing_instance_->browser_context(), host->profile()); all_hosts_.insert(host); if (is_background) @@ -442,8 +445,9 @@ const Extension* IncognitoExtensionProcessManager::GetExtensionForSiteInstance( const Extension* IncognitoExtensionProcessManager::GetExtensionOrAppByURL( const GURL& url) { - ExtensionService* service = - browsing_instance_->profile()->GetExtensionService(); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + ExtensionService* service = profile->GetExtensionService(); if (!service) return NULL; return (url.SchemeIs(chrome::kExtensionScheme)) ? @@ -452,8 +456,9 @@ const Extension* IncognitoExtensionProcessManager::GetExtensionOrAppByURL( bool IncognitoExtensionProcessManager::IsIncognitoEnabled( const Extension* extension) { - ExtensionService* service = - browsing_instance_->profile()->GetExtensionService(); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + ExtensionService* service = profile->GetExtensionService(); return service && service->IsIncognitoEnabled(extension->id()); } @@ -467,12 +472,13 @@ void IncognitoExtensionProcessManager::Observe( // incognito window. Watch for new browsers and create the hosts if // it matches our profile. Browser* browser = Source<Browser>(source).ptr(); - if (browser->profile() == browsing_instance_->profile()) { + if (browser->profile() == browsing_instance_->browser_context()) { // On Chrome OS, a login screen is implemented as a browser. // This browser has no extension service. In this case, // service will be NULL. - ExtensionService* service = - browsing_instance_->profile()->GetExtensionService(); + Profile* profile = + Profile::FromBrowserContext(browsing_instance_->browser_context()); + ExtensionService* service = profile->GetExtensionService(); if (service && service->is_ready()) CreateBackgroundHosts(this, service->extensions()); } |