| Index: chrome/browser/profiles/profile_manager.cc
|
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
|
| index bb0bbd9875bcf9073bbfc836815a19c86875ad37..b973fb4f4e210c19d96c663f3bd80db425e88cc1 100644
|
| --- a/chrome/browser/profiles/profile_manager.cc
|
| +++ b/chrome/browser/profiles/profile_manager.cc
|
| @@ -671,9 +671,14 @@ void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) {
|
| // TODO(sail): Due to bug 88586 we don't delete the profile instance. Once we
|
| // start deleting the profile instance we need to close background apps too.
|
| Profile* profile = GetProfileByPath(profile_dir);
|
| - if (profile)
|
| + if (profile) {
|
| BrowserList::CloseAllBrowsersWithProfile(profile);
|
|
|
| + // Disable sync for doomed profile.
|
| + if (profile->HasProfileSyncService())
|
| + profile->GetProfileSyncService()->DisableForUser();
|
| + }
|
| +
|
| QueueProfileDirectoryForDeletion(profile_dir);
|
| cache.DeleteProfileFromCache(profile_dir);
|
| }
|
|
|