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

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

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again and hope upload works this time Created 9 years, 8 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_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 1b3b5f7abea92791964b7869bf775d6b10e9975f..4b06737417213deb458743705c65f2433e7cc5ba 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_service.h"
+#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser.h"
@@ -422,7 +423,8 @@ class SessionRestoreImpl : public NotificationObserver {
}
Browser* Restore() {
- SessionService* session_service = profile_->GetSessionService();
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile_);
DCHECK(session_service);
SessionService::SessionCallback* callback =
NewCallback(this, &SessionRestoreImpl::OnGotSession);
@@ -727,7 +729,8 @@ class SessionRestoreImpl : public NotificationObserver {
// Invokes TabRestored on the SessionService for all tabs in browser after
// initial_count.
void NotifySessionServiceOfRestoredTabs(Browser* browser, int initial_count) {
- SessionService* session_service = profile_->GetSessionService();
+ SessionService* session_service =
+ SessionServiceFactory::GetForProfile(profile_);
for (int i = initial_count; i < browser->tab_count(); ++i)
session_service->TabRestored(&browser->GetTabContentsAt(i)->controller(),
browser->tabstrip_model()->IsTabPinned(i));
@@ -789,7 +792,7 @@ static Browser* Restore(Profile* profile,
// Always restore from the original profile (incognito profiles have no
// session service).
profile = profile->GetOriginalProfile();
- if (!profile->GetSessionService()) {
+ if (!SessionServiceFactory::GetForProfile(profile)) {
NOTREACHED();
return NULL;
}
« no previous file with comments | « chrome/browser/sessions/base_session_service.h ('k') | chrome/browser/sessions/session_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698