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

Unified Diff: chrome/browser/jumplist_win.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
« no previous file with comments | « chrome/browser/browsing_data_remover.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/jumplist_win.cc
diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc
index 8262d22fb0afdaecc767c79c906d4526ff8bd9d3..e60e4ba1a68248c49fd635f1ba39d611676181f3 100644
--- a/chrome/browser/jumplist_win.cc
+++ b/chrome/browser/jumplist_win.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_types.h"
#include "chrome/browser/sessions/tab_restore_service.h"
+#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
@@ -596,7 +597,8 @@ bool JumpList::AddObserver(Profile* profile) {
if (base::win::GetVersion() < base::win::VERSION_WIN7 || !profile)
return false;
- TabRestoreService* tab_restore_service = profile->GetTabRestoreService();
+ TabRestoreService* tab_restore_service =
+ TabRestoreServiceFactory::GetForProfile(profile);
if (!tab_restore_service)
return false;
@@ -608,8 +610,12 @@ bool JumpList::AddObserver(Profile* profile) {
}
void JumpList::RemoveObserver() {
- if (profile_ && profile_->GetTabRestoreService())
- profile_->GetTabRestoreService()->RemoveObserver(this);
+ if (profile_) {
+ TabRestoreService* tab_restore_service =
+ TabRestoreServiceFactory::GetForProfile(profile_);
+ if (tab_restore_service)
+ tab_restore_service->RemoveObserver(this);
+ }
profile_ = NULL;
}
@@ -733,7 +739,8 @@ void JumpList::OnSegmentUsageAvailable(
// RecentlyClosedTabsHandler::TabRestoreServiceChanged() to emulate it.
const int kRecentlyClosedCount = 4;
recently_closed_pages_.clear();
- TabRestoreService* tab_restore_service = profile_->GetTabRestoreService();
+ TabRestoreService* tab_restore_service =
+ TabRestoreServiceFactory::GetForProfile(profile_);
const TabRestoreService::Entries& entries = tab_restore_service->entries();
for (TabRestoreService::Entries::const_iterator it = entries.begin();
it != entries.end(); ++it) {
« no previous file with comments | « chrome/browser/browsing_data_remover.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698