| Index: chrome/browser/profiles/profile_manager.cc
|
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
|
| index cd53c8fb480de4e2516d75b37a97f0f86d1ca157..cf917e67658caa825250e3cf8b5aa140335194d7 100644
|
| --- a/chrome/browser/profiles/profile_manager.cc
|
| +++ b/chrome/browser/profiles/profile_manager.cc
|
| @@ -24,6 +24,7 @@
|
| #include "chrome/browser/profiles/profile_metrics.h"
|
| #include "chrome/browser/sessions/session_service_factory.h"
|
| #include "chrome/browser/sync/profile_sync_service.h"
|
| +#include "chrome/browser/sync/profile_sync_service_factory.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
|
| @@ -821,8 +822,11 @@ void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) {
|
| BrowserList::CloseAllBrowsersWithProfile(profile);
|
|
|
| // Disable sync for doomed profile.
|
| - if (profile->HasProfileSyncService())
|
| - profile->GetProfileSyncService()->DisableForUser();
|
| + if (ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(
|
| + profile)) {
|
| + ProfileSyncServiceFactory::GetInstance()->GetForProfile(
|
| + profile)->DisableForUser();
|
| + }
|
| }
|
|
|
| QueueProfileDirectoryForDeletion(profile_dir);
|
|
|