| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // extension as the host. This has the effect of grouping apps together in | 347 // extension as the host. This has the effect of grouping apps together in |
| 348 // a common SiteInstance. | 348 // a common SiteInstance. |
| 349 if (!profile || !profile->GetExtensionService()) | 349 if (!profile || !profile->GetExtensionService()) |
| 350 return url; | 350 return url; |
| 351 | 351 |
| 352 const Extension* extension = | 352 const Extension* extension = |
| 353 profile->GetExtensionService()->GetExtensionByWebExtent(url); | 353 profile->GetExtensionService()->GetExtensionByWebExtent(url); |
| 354 if (!extension) | 354 if (!extension) |
| 355 return url; | 355 return url; |
| 356 | 356 |
| 357 // Bookmark apps do not use the hosted app process model, and should be |
| 358 // treated as normal URLs. |
| 359 if (extension->from_bookmark()) |
| 360 return url; |
| 361 |
| 357 // If the URL is part of an extension's web extent, convert it to an | 362 // If the URL is part of an extension's web extent, convert it to an |
| 358 // extension URL. | 363 // extension URL. |
| 359 return extension->GetResourceURL(url.path()); | 364 return extension->GetResourceURL(url.path()); |
| 360 } | 365 } |
| 361 | 366 |
| 362 bool ChromeContentBrowserClient::ShouldUseProcessPerSite( | 367 bool ChromeContentBrowserClient::ShouldUseProcessPerSite( |
| 363 content::BrowserContext* browser_context, const GURL& effective_url) { | 368 content::BrowserContext* browser_context, const GURL& effective_url) { |
| 364 // Non-extension URLs should generally use process-per-site-instance. | 369 // Non-extension URLs should generally use process-per-site-instance. |
| 365 // Because we expect to use the effective URL, hosted apps URLs should have | 370 // Because we expect to use the effective URL, URLs for hosted apps (apart |
| 366 // an extension scheme by now. | 371 // from bookmark apps) should have an extension scheme by now. |
| 367 if (!effective_url.SchemeIs(chrome::kExtensionScheme)) | 372 if (!effective_url.SchemeIs(chrome::kExtensionScheme)) |
| 368 return false; | 373 return false; |
| 369 | 374 |
| 370 Profile* profile = Profile::FromBrowserContext(browser_context); | 375 Profile* profile = Profile::FromBrowserContext(browser_context); |
| 371 if (!profile || !profile->GetExtensionService()) | 376 if (!profile || !profile->GetExtensionService()) |
| 372 return false; | 377 return false; |
| 373 | 378 |
| 374 const Extension* extension = | 379 const Extension* extension = |
| 375 profile->GetExtensionService()->GetExtensionByURL(effective_url); | 380 profile->GetExtensionService()->GetExtensionByURL(effective_url); |
| 376 if (!extension) | 381 if (!extension) |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 #if defined(USE_NSS) | 1135 #if defined(USE_NSS) |
| 1131 crypto::CryptoModuleBlockingPasswordDelegate* | 1136 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1132 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1137 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1133 const GURL& url) { | 1138 const GURL& url) { |
| 1134 return browser::NewCryptoModuleBlockingDialogDelegate( | 1139 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1135 browser::kCryptoModulePasswordKeygen, url.host()); | 1140 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1136 } | 1141 } |
| 1137 #endif | 1142 #endif |
| 1138 | 1143 |
| 1139 } // namespace chrome | 1144 } // namespace chrome |
| OLD | NEW |