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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac build 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/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 7e81d1cbc0e2c60d7d5ba2863e8bcc65d7306b6f..cfe36a25c05ae95c626e601c2e2112953f869d35 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -24,7 +24,9 @@
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sessions/session_service.h"
+#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service.h"
+#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/sync/sync_ui_util_mac.h"
@@ -329,7 +331,7 @@ void RecordLastRunAppBundlePath() {
// proper shutdown. If we don't do this, Chrome won't shut down cleanly,
// and may end up crashing when some thread tries to use the IO thread (or
// another thread) that is no longer valid.
- [self defaultProfile]->ResetTabRestoreService();
+ TabRestoreServiceFactory::ResetForProfile([self defaultProfile]);
}
}
@@ -636,7 +638,8 @@ void RecordLastRunAppBundlePath() {
// Checks with the TabRestoreService to see if there's anything there to
// restore and returns YES if so.
- (BOOL)canRestoreTab {
- TabRestoreService* service = [self defaultProfile]->GetTabRestoreService();
+ TabRestoreService* service =
+ TabRestoreServiceFactory::GetForProfile([self defaultProfile]);
return service && !service->entries().empty();
}
@@ -927,7 +930,7 @@ void RecordLastRunAppBundlePath() {
doneOnce = YES;
if (base::mac::WasLaunchedAsHiddenLoginItem()) {
SessionService* sessionService =
- [self defaultProfile]->GetSessionService();
+ SessionServiceFactory::GetForProfile([self defaultProfile]);
if (sessionService &&
sessionService->RestoreIfNecessary(std::vector<GURL>()))
return NO;

Powered by Google App Engine
This is Rietveld 408576698