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

Unified Diff: chrome/browser/sessions/session_service.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/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 99de7204e61bdf7d52e078b0e979d175b29f58eb..596c493dda5f53fe76d0767c91f9545371f56155 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -487,6 +487,16 @@ void SessionService::SetTabExtensionAppID(
tab_id, extension_app_id).Pass());
}
+void SessionService::SetActivationTime(const SessionID& window_id,
+ const SessionID& tab_id,
+ base::TimeTicks activation_time) {
+ if (!ShouldTrackChangesToWindow(window_id))
+ return;
+
+ ScheduleCommand(
sky 2015/05/12 21:25:30 Don't you want to gate this by SessionRestore::Get
Georges Khalil 2015/05/15 16:55:30 Good idea. I'm actually going to gate the call to
+ sessions::CreateActivationTimeCommand(tab_id, activation_time).Pass());
+}
+
base::CancelableTaskTracker::TaskId SessionService::GetLastSession(
const SessionCallback& callback,
base::CancelableTaskTracker* tracker) {
@@ -727,6 +737,12 @@ void SessionService::BuildCommandsForTab(const SessionID& window_id,
sessions::CreatePinnedStateCommand(session_id, true));
}
+ // This works because we are persisting the last activation when restoring
sky 2015/05/12 21:25:30 I don't understand this comment. It likely can be
Georges Khalil 2015/05/15 16:55:30 Removed.
+ // tabs.
+ base_session_service_->AppendRebuildCommand(
+ sessions::CreateActivationTimeCommand(session_id,
+ tab->GetLastActiveTime()));
+
extensions::TabHelper* extensions_tab_helper =
extensions::TabHelper::FromWebContents(tab);
if (extensions_tab_helper->extension_app()) {

Powered by Google App Engine
This is Rietveld 408576698