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

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 7448012: Create the correct SiteInstance when restoring tabs that belong to apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style. Created 9 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 6075d7310c39790ed7329463d50a5308af2ad63d..ff2645e3f1a666ec6ffef17ca971ea4931f86727 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -12,15 +12,14 @@
#include "chrome/browser/extensions/extension_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tabs/tab_strip_model.h"
+#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/ui/status_bubble.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/browser/ui/webui/chrome_web_ui_factory.h"
#include "chrome/browser/web_applications/web_app.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_url_handler.h"
@@ -29,33 +28,6 @@
namespace {
-// Returns an appropriate SiteInstance for WebUI URLs, or the SiteInstance for
-// |source_contents| if it represents the same website as |url|. Returns NULL
-// otherwise.
-SiteInstance* GetSiteInstance(TabContents* source_contents, Profile* profile,
- const GURL& url) {
- // If url is a WebUI or extension, we need to be sure to use the right type
- // of renderer process up front. Otherwise, we create a normal SiteInstance
- // as part of creating the tab.
- ExtensionService* service = profile->GetExtensionService();
- if (ChromeWebUIFactory::GetInstance()->UseWebUIForURL(profile, url) ||
- (service && service->GetExtensionByWebExtent(url))) {
- return SiteInstance::CreateSiteInstanceForURL(profile, url);
- }
-
- if (!source_contents)
- return NULL;
-
- // Don't use this logic when "--process-per-tab" is specified.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessPerTab) &&
- SiteInstance::IsSameWebSite(source_contents->profile(),
- source_contents->GetURL(),
- url)) {
- return source_contents->GetSiteInstance();
- }
- return NULL;
-}
-
// Returns true if the specified Browser can open tabs. Not all Browsers support
// multiple tabs, such as app frames and popups. This function returns false for
// those types of Browser.
@@ -412,7 +384,8 @@ void Navigate(NavigateParams* params) {
params->target_contents =
Browser::TabContentsFactory(
params->browser->profile(),
- GetSiteInstance(source_contents, params->browser->profile(), url),
+ tab_util::GetSiteInstanceForNewTab(
+ source_contents, params->browser->profile(), url),
MSG_ROUTING_NONE,
source_contents,
NULL);
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698