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

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

Issue 1131373003: [Session restore] Add MRU logic to loading of background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 c1556d9e1bb6c69324779bc9d7c71a1975e8835d..431bb85573b4fcb19431fb571b75f366b57668c3 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1071,13 +1071,18 @@ void Browser::ActiveTabChanged(WebContents* old_contents,
find_bar_controller_->find_bar()->MoveWindowIfNecessary(gfx::Rect());
}
- // Update sessions. Don't force creation of sessions. If sessions doesn't
- // exist, the change will be picked up by sessions when created.
+ // Update sessions (selected tab index and last activation time). Don't force
+ // creation of sessions. If sessions doesn't exist, the change will be picked
+ // up by sessions when created.
SessionService* session_service =
SessionServiceFactory::GetForProfileIfExisting(profile_);
if (session_service && !tab_strip_model_->closing_all()) {
session_service->SetSelectedTabInWindow(session_id(),
tab_strip_model_->active_index());
+ SessionTabHelper* session_tab_helper =
+ SessionTabHelper::FromWebContents(new_contents);
+ session_service->SetActivationTime(
sky 2015/05/12 21:25:30 I think you should only do this if the tab is acti
Georges Khalil 2015/05/15 16:55:30 The length if the activation is something that's g
sky 2015/05/22 03:00:19 Can you outline where you're thinking you'll go wi
Georges Khalil 2015/05/22 20:14:09 Forgot to mention that we need to keep them separa
sky 2015/05/22 20:25:30 We could change session restore to not only keep o
+ session_id(), session_tab_helper->session_id(), base::TimeTicks::Now());
}
// This needs to be called after notifying SearchDelegate.

Powered by Google App Engine
This is Rietveld 408576698