summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_content_browser_client.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 15:49:08 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 15:49:08 +0000
commit36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8 (patch)
tree2e87bed9b96d30210008b64fde9e90fe7d6a399d /chrome/browser/chrome_content_browser_client.cc
parent2bd51de1a5ffc4514a11c3f18c7e2e5f1b92d728 (diff)
downloadchromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.zip
chromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.tar.gz
chromium_src-36fb2c7c17069ad7b6d767e4c40b8ee29b762cf8.tar.bz2
Get rid of extensions dependency from content\browser.
BUG=76789 Review URL: http://codereview.chromium.org/6693054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_content_browser_client.cc')
-rw-r--r--chrome/browser/chrome_content_browser_client.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 58a63a5..00ac1c9 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -32,4 +32,23 @@ content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() {
return ChromeWebUIFactory::GetInstance();
}
+GURL ChromeContentBrowserClient::GetEffectiveURL(Profile* profile,
+ const GURL& url) {
+ // Get the effective URL for the given actual URL. If the URL is part of an
+ // 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())
+ return url;
+
+ const Extension* extension =
+ profile->GetExtensionService()->GetExtensionByWebExtent(url);
+ if (!extension)
+ return url;
+
+ // If the URL is part of an extension's web extent, convert it to an
+ // extension URL.
+ return extension->GetResourceURL(url.path());
+}
+
} // namespace chrome