| Index: chrome/browser/chrome_content_browser_client.cc
|
| ===================================================================
|
| --- chrome/browser/chrome_content_browser_client.cc (revision 80243)
|
| +++ chrome/browser/chrome_content_browser_client.cc (working copy)
|
| @@ -32,4 +32,23 @@
|
| 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
|
|
|