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

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

Issue 1309363007: [sessions] Remove most knowledge of //chrome from core tab restore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab_restore_service_client
Patch Set: Make OnTabRestored() optional 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
Index: chrome/browser/sessions/persistent_tab_restore_service.cc
diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc
index 128eae5727b3855e783acd56691bcc6fb0e3eec7..f616ade59fa088fa06f8d96ae6b08b07cff1a7ea 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service.cc
@@ -17,7 +17,6 @@
#include "base/stl_util.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/base_session_service_delegate_impl.h"
#include "components/sessions/base_session_service.h"
#include "components/sessions/base_session_service_commands.h"
@@ -118,7 +117,7 @@ class PersistentTabRestoreService::Delegate
: public BaseSessionServiceDelegateImpl,
public TabRestoreServiceHelper::Observer {
public:
- Delegate(Profile* profile, sessions::TabRestoreServiceClient* client);
+ explicit Delegate(sessions::TabRestoreServiceClient* client);
~Delegate() override;
@@ -223,9 +222,6 @@ class PersistentTabRestoreService::Delegate
private:
scoped_ptr<sessions::BaseSessionService> base_session_service_;
- // The associated profile.
- Profile* profile_;
-
// The associated client.
sessions::TabRestoreServiceClient* client_;
@@ -252,22 +248,17 @@ class PersistentTabRestoreService::Delegate
};
PersistentTabRestoreService::Delegate::Delegate(
- Profile* profile,
sessions::TabRestoreServiceClient* client)
: BaseSessionServiceDelegateImpl(true),
base_session_service_(new sessions::BaseSessionService(
sessions::BaseSessionService::TAB_RESTORE,
- profile->GetPath(),
+ client->GetPathToSaveTo(),
this)),
- profile_(profile),
client_(client),
tab_restore_service_helper_(NULL),
entries_to_write_(0),
entries_written_(0),
- load_state_(NOT_LOADED) {
- // We should never be created when incognito.
- DCHECK(!profile->IsOffTheRecord());
-}
+ load_state_(NOT_LOADED) {}
PersistentTabRestoreService::Delegate::~Delegate() {}
@@ -927,8 +918,8 @@ PersistentTabRestoreService::PersistentTabRestoreService(
scoped_ptr<sessions::TabRestoreServiceClient> client,
TimeFactory* time_factory)
: client_(client.Pass()),
- delegate_(new Delegate(profile, client_.get())),
- helper_(this, delegate_.get(), profile, time_factory) {
+ delegate_(new Delegate(client_.get())),
+ helper_(this, delegate_.get(), profile, client_.get(), time_factory) {
delegate_->set_tab_restore_service_helper(&helper_);
}
« no previous file with comments | « chrome/browser/sessions/in_memory_tab_restore_service.cc ('k') | chrome/browser/sessions/tab_restore_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698