Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index cd5048a8ea4eb4818d9fdd23d217ff365a616363..89f2b6d22ff2757d323c8b31fd7f6ee0344349e9 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -640,10 +640,12 @@ GURL ChromeContentBrowserClient::GetEffectiveURL( |
// installed app, the effective URL is an extension URL with the ID of that |
// extension as the host. This has the effect of grouping apps together in |
// a common SiteInstance. |
- if (!profile || !profile->GetExtensionService()) |
+ ExtensionService* extension_service = |
sky
2012/11/20 21:04:55
Does ::Get(profile) deal with NULL? If passed NULL
Miranda Callahan
2012/11/20 21:36:10
Done. Also removed from 674 and 1808.
|
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
+ if (!profile || !extension_service) |
return url; |
- const Extension* extension = profile->GetExtensionService()->extensions()-> |
+ const Extension* extension = extension_service->extensions()-> |
GetHostedAppByURL(ExtensionURLInfo(url)); |
if (!extension) |
return url; |
@@ -667,10 +669,12 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite( |
return false; |
Profile* profile = Profile::FromBrowserContext(browser_context); |
- if (!profile || !profile->GetExtensionService()) |
+ ExtensionService* extension_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
+ if (!profile || !extension_service) |
return false; |
- const Extension* extension = profile->GetExtensionService()->extensions()-> |
+ const Extension* extension = extension_service->extensions()-> |
GetExtensionOrAppByURL(ExtensionURLInfo(effective_url)); |
if (!extension) |
return false; |
@@ -701,7 +705,8 @@ bool ChromeContentBrowserClient::IsSuitableHost( |
const GURL& site_url) { |
Profile* profile = |
Profile::FromBrowserContext(process_host->GetBrowserContext()); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
extensions::ProcessMap* process_map = service->process_map(); |
// Don't allow the Task Manager to share a process with anything else. |
@@ -748,7 +753,8 @@ bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost( |
return false; |
Profile* profile = Profile::FromBrowserContext(browser_context); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
if (!service) |
return false; |
@@ -794,7 +800,8 @@ void ChromeContentBrowserClient::SiteInstanceGotProcess( |
Profile* profile = Profile::FromBrowserContext( |
site_instance->GetBrowserContext()); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
if (!service) |
return; |
@@ -823,7 +830,8 @@ void ChromeContentBrowserClient::SiteInstanceDeleting( |
Profile* profile = Profile::FromBrowserContext( |
site_instance->GetBrowserContext()); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
if (!service) |
return; |
@@ -920,9 +928,10 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
if (process) { |
Profile* profile = Profile::FromBrowserContext( |
process->GetBrowserContext()); |
- if (profile->GetExtensionService()) { |
- extensions::ProcessMap* process_map = |
- profile->GetExtensionService()->process_map(); |
+ ExtensionService* extension_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
+ if (extension_service) { |
+ extensions::ProcessMap* process_map = extension_service->process_map(); |
if (process_map && process_map->Contains(process->GetID())) |
command_line->AppendSwitch(switches::kExtensionProcess); |
} |
@@ -1363,7 +1372,8 @@ void ChromeContentBrowserClient::RequestDesktopNotificationPermission( |
// extension has the 'notify' permission. (If the extension does not have the |
// permission, the user will still be prompted.) |
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
const Extension* extension = !service ? NULL : |
service->extensions()->GetExtensionOrAppByURL(ExtensionURLInfo( |
source_origin)); |
@@ -1653,7 +1663,8 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs( |
WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
chrome::ViewType view_type = chrome::GetViewType(web_contents); |
- ExtensionService* service = profile->GetExtensionService(); |
+ ExtensionService* service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
if (service) { |
const GURL& url = rvh->GetSiteInstance()->GetSiteURL(); |
const Extension* extension = service->extensions()->GetByID(url.host()); |
@@ -1792,8 +1803,10 @@ bool ChromeContentBrowserClient::AllowPepperSocketAPI( |
Profile* profile = Profile::FromBrowserContext(browser_context); |
const Extension* extension = NULL; |
- if (profile && profile->GetExtensionService()) { |
- extension = profile->GetExtensionService()->extensions()-> |
+ ExtensionService* extension_service = |
+ extensions::ExtensionSystem::Get(profile)->extension_service(); |
+ if (profile && extension_service) { |
+ extension = extension_service->extensions()-> |
GetExtensionOrAppByURL(ExtensionURLInfo(url)); |
} |