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

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: 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 | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 531113316ea9e16bb0cd76824a91eac99dd9165b..fb01b870ffee8d982ed8d7a52e7e0f1dfc25febf 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -23,7 +23,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();
}
@@ -925,7 +928,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;
« no previous file with comments | « no previous file | chrome/browser/automation/automation_provider_observers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698