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

Unified Diff: chrome/browser/sessions/session_service.cc

Issue 1319473014: Introduce TabRestoreServiceClient and //chrome implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 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.h ('k') | chrome/browser/sessions/session_service_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 1e241d68f110fdc622e48b087ef43c4789b9ec2b..6db79705ece69a44f19b9d48d6340154a9abbf68 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -37,6 +37,7 @@
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/sessions/content/content_serialized_navigation_builder.h"
+#include "components/sessions/core/session_constants.h"
#include "components/sessions/session_command.h"
#include "components/sessions/session_types.h"
#include "content/public/browser/navigation_details.h"
@@ -497,7 +498,7 @@ void SessionService::SetLastActiveTime(const SessionID& window_id,
}
base::CancelableTaskTracker::TaskId SessionService::GetLastSession(
- const SessionCallback& callback,
+ const sessions::GetLastSessionCallback& callback,
base::CancelableTaskTracker* tracker) {
// OnGotSessionCommands maps the SessionCommands to browser state, then run
// the callback.
@@ -695,7 +696,7 @@ void SessionService::OnBrowserSetLastActive(Browser* browser) {
}
void SessionService::OnGotSessionCommands(
- const SessionCallback& callback,
+ const sessions::GetLastSessionCallback& callback,
ScopedVector<sessions::SessionCommand> commands) {
ScopedVector<sessions::SessionWindow> valid_windows;
SessionID::id_type active_window_id = 0;
@@ -719,9 +720,11 @@ void SessionService::BuildCommandsForTab(const SessionID& window_id,
sessions::CreateSetTabWindowCommand(window_id, session_id));
const int current_index = tab->GetController().GetCurrentEntryIndex();
- const int min_index = std::max(current_index - gMaxPersistNavigationCount, 0);
- const int max_index = std::min(current_index + gMaxPersistNavigationCount,
- tab->GetController().GetEntryCount());
+ const int min_index =
+ std::max(current_index - sessions::gMaxPersistNavigationCount, 0);
+ const int max_index =
+ std::min(current_index + sessions::gMaxPersistNavigationCount,
+ tab->GetController().GetEntryCount());
const int pending_index = tab->GetController().GetPendingEntryIndex();
if (tab_to_available_range) {
(*tab_to_available_range)[session_id.id()] =
« no previous file with comments | « chrome/browser/sessions/session_service.h ('k') | chrome/browser/sessions/session_service_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698