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

Unified Diff: chrome/browser/ui/browser.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: Review feedback. 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 34c7cdd9e223c36e2173be01bb023ce2e25254ae..3d0065a4b3f30a39a52a964aef7c6e2f43b59ad8 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -67,6 +67,7 @@
#include "chrome/browser/tab_closeable_state_watcher.h"
#include "chrome/browser/tab_contents/background_contents.h"
#include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h"
+#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tabs/tab_finder.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/themes/theme_service.h"
@@ -1152,7 +1153,10 @@ TabContents* Browser::AddRestoredTab(
bool pin,
bool from_last_session,
SessionStorageNamespace* session_storage_namespace) {
- TabContentsWrapper* wrapper = TabContentsFactory(profile(), NULL,
+ GURL restore_url = navigations.at(selected_navigation).virtual_url();
+ TabContentsWrapper* wrapper = TabContentsFactory(
+ profile(),
+ tab_util::GetSiteInstanceForNewTab(NULL, profile_, restore_url),
MSG_ROUTING_NONE,
GetSelectedTabContents(),
session_storage_namespace);
@@ -1198,7 +1202,10 @@ void Browser::ReplaceRestoredTab(
bool from_last_session,
const std::string& extension_app_id,
SessionStorageNamespace* session_storage_namespace) {
- TabContentsWrapper* wrapper = TabContentsFactory(profile(), NULL,
+ GURL restore_url = navigations.at(selected_navigation).virtual_url();
+ TabContentsWrapper* wrapper = TabContentsFactory(
+ profile(),
+ tab_util::GetSiteInstanceForNewTab(NULL, profile_, restore_url),
MSG_ROUTING_NONE,
GetSelectedTabContents(),
session_storage_namespace);

Powered by Google App Engine
This is Rietveld 408576698