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

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

Issue 10969012: Fix: Prerendering was confusing SessionService to not save sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 3 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/sessions/session_service.cc ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 3ebab50f3bb808d3fb41efe49bcda673f3435a95..83e795103cdf2618bb3c64126c8358d6c9c4b805 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1023,12 +1023,20 @@ void Browser::TabInsertedAt(TabContents* contents,
registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_DETACHED,
content::Source<WebContents>(contents->web_contents()));
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile_);
+ if (session_service)
+ session_service->TabInserted(contents->web_contents());
}
void Browser::TabClosingAt(TabStripModel* tab_strip_model,
TabContents* contents,
int index) {
fullscreen_controller_->OnTabClosing(contents->web_contents());
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile_);
+ if (session_service)
+ session_service->TabClosing(contents->web_contents());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_TAB_CLOSING,
content::Source<NavigationController>(
@@ -1138,6 +1146,10 @@ void Browser::TabReplacedAt(TabStripModel* tab_strip_model,
TabContents* new_contents,
int index) {
TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE);
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile_);
+ if (session_service)
+ session_service->TabClosing(old_contents->web_contents());
TabInsertedAt(new_contents, index, (index == active_index()));
int entry_count =
@@ -1150,8 +1162,6 @@ void Browser::TabReplacedAt(TabStripModel* tab_strip_model,
entry_count - 1);
}
- SessionService* session_service =
- SessionServiceFactory::GetForProfile(profile());
if (session_service) {
// The new_contents may end up with a different navigation stack. Force
// the session service to update itself.
« no previous file with comments | « chrome/browser/sessions/session_service.cc ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698