Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 8cd12c67fc123f7a4a0784216f0bea9206fe76e8..c41f6f847d9c87f098d1afc26e5ad078229f0660 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -58,8 +58,7 @@ |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/search_engines/template_url_fetcher.h" |
#include "chrome/browser/search_engines/template_url_model.h" |
-#include "chrome/browser/sessions/session_service.h" |
-#include "chrome/browser/sessions/tab_restore_service.h" |
+#include "chrome/browser/sessions/session_service_factory.h" |
#include "chrome/browser/spellcheck_host.h" |
#include "chrome/browser/ssl/ssl_host_state.h" |
#include "chrome/browser/status_icons/status_tray.h" |
@@ -280,7 +279,6 @@ ProfileImpl::ProfileImpl(const FilePath& path, |
#if defined(OS_WIN) |
checked_instant_promo_(false), |
#endif |
- shutdown_session_service_(false), |
delegate_(delegate) { |
DCHECK(!path.empty()) << "Using an empty path will attempt to write " << |
"profile files to the root directory!"; |
@@ -587,11 +585,10 @@ ProfileImpl::~ProfileImpl() { |
Source<Profile>(this), |
NotificationService::NoDetails()); |
- ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
+ StopCreateSessionServiceTimer(); |
- tab_restore_service_.reset(); |
+ ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
- StopCreateSessionServiceTimer(); |
// TemplateURLModel schedules a task on the WebDataService from its |
// destructor. Delete it first to ensure the task gets scheduled before we |
// shut down the database. |
@@ -1178,30 +1175,6 @@ quota::QuotaManager* ProfileImpl::GetQuotaManager() { |
return quota_manager_.get(); |
} |
-SessionService* ProfileImpl::GetSessionService() { |
- if (!session_service_.get() && !shutdown_session_service_) { |
- session_service_.reset(new SessionService(this)); |
- session_service_->ResetFromCurrentBrowsers(); |
- } |
- return session_service_.get(); |
-} |
- |
-void ProfileImpl::ShutdownSessionService() { |
- if (shutdown_session_service_) |
- return; |
- |
- // We're about to exit, force creation of the session service if it hasn't |
- // been created yet. We do this to ensure session state matches the point in |
- // time the user exited. |
- GetSessionService(); |
- shutdown_session_service_ = true; |
- session_service_.reset(); |
-} |
- |
-bool ProfileImpl::HasSessionService() const { |
- return (session_service_.get() != NULL); |
-} |
- |
bool ProfileImpl::HasProfileSyncService() const { |
return (sync_service_.get() != NULL); |
} |
@@ -1236,12 +1209,6 @@ Time ProfileImpl::GetStartTime() const { |
return start_time_; |
} |
-TabRestoreService* ProfileImpl::GetTabRestoreService() { |
- if (!tab_restore_service_.get()) |
- tab_restore_service_.reset(new TabRestoreService(this)); |
- return tab_restore_service_.get(); |
-} |
- |
history::TopSites* ProfileImpl::GetTopSites() { |
if (!top_sites_.get()) { |
top_sites_ = new history::TopSites(this); |
@@ -1254,10 +1221,6 @@ history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() { |
return top_sites_; |
} |
-void ProfileImpl::ResetTabRestoreService() { |
- tab_restore_service_.reset(); |
-} |
- |
SpellCheckHost* ProfileImpl::GetSpellCheckHost() { |
return spellcheck_host_ready_ ? spellcheck_host_.get() : NULL; |
} |
@@ -1366,6 +1329,10 @@ void ProfileImpl::StopCreateSessionServiceTimer() { |
create_session_service_timer_.Stop(); |
} |
+void ProfileImpl::EnsureSessionServiceCreated() { |
+ SessionServiceFactory::GetForProfile(this); |
+} |
+ |
TokenService* ProfileImpl::GetTokenService() { |
if (!token_service_.get()) { |
token_service_.reset(new TokenService()); |