Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 8585016: Don't use process isolation for bookmark apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug with old_url. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // extension as the host. This has the effect of grouping apps together in 344 // extension as the host. This has the effect of grouping apps together in
345 // a common SiteInstance. 345 // a common SiteInstance.
346 if (!profile || !profile->GetExtensionService()) 346 if (!profile || !profile->GetExtensionService())
347 return url; 347 return url;
348 348
349 const Extension* extension = 349 const Extension* extension =
350 profile->GetExtensionService()->GetExtensionByWebExtent(url); 350 profile->GetExtensionService()->GetExtensionByWebExtent(url);
351 if (!extension) 351 if (!extension)
352 return url; 352 return url;
353 353
354 // Bookmark apps do not use the hosted app process model, and should be
355 // treated as normal URLs.
356 if (extension->from_bookmark())
357 return url;
358
354 // If the URL is part of an extension's web extent, convert it to an 359 // If the URL is part of an extension's web extent, convert it to an
355 // extension URL. 360 // extension URL.
356 return extension->GetResourceURL(url.path()); 361 return extension->GetResourceURL(url.path());
357 } 362 }
358 363
359 bool ChromeContentBrowserClient::ShouldUseProcessPerSite( 364 bool ChromeContentBrowserClient::ShouldUseProcessPerSite(
360 content::BrowserContext* browser_context, const GURL& effective_url) { 365 content::BrowserContext* browser_context, const GURL& effective_url) {
361 // Non-extension URLs should generally use process-per-site-instance. 366 // Non-extension URLs should generally use process-per-site-instance.
362 // Because we expect to use the effective URL, hosted apps URLs should have 367 // Because we expect to use the effective URL, URLs for hosted apps (apart
363 // an extension scheme by now. 368 // from bookmark apps) should have an extension scheme by now.
364 if (!effective_url.SchemeIs(chrome::kExtensionScheme)) 369 if (!effective_url.SchemeIs(chrome::kExtensionScheme))
365 return false; 370 return false;
366 371
367 Profile* profile = Profile::FromBrowserContext(browser_context); 372 Profile* profile = Profile::FromBrowserContext(browser_context);
368 if (!profile || !profile->GetExtensionService()) 373 if (!profile || !profile->GetExtensionService())
369 return false; 374 return false;
370 375
371 const Extension* extension = 376 const Extension* extension =
372 profile->GetExtensionService()->GetExtensionByURL(effective_url); 377 profile->GetExtensionService()->GetExtensionByURL(effective_url);
373 if (!extension) 378 if (!extension)
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 #if defined(USE_NSS) 1129 #if defined(USE_NSS)
1125 crypto::CryptoModuleBlockingPasswordDelegate* 1130 crypto::CryptoModuleBlockingPasswordDelegate*
1126 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 1131 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
1127 const GURL& url) { 1132 const GURL& url) {
1128 return browser::NewCryptoModuleBlockingDialogDelegate( 1133 return browser::NewCryptoModuleBlockingDialogDelegate(
1129 browser::kCryptoModulePasswordKeygen, url.host()); 1134 browser::kCryptoModulePasswordKeygen, url.host());
1130 } 1135 }
1131 #endif 1136 #endif
1132 1137
1133 } // namespace chrome 1138 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/app_process_apitest.cc » ('j') | chrome/browser/extensions/app_process_apitest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698