Commit a0cbe31d authored by jeremy@chromium.org's avatar jeremy@chromium.org

Disable sync immediately when deleting a profile

BUG=105813
TEST=Create a new profile and enable sync, then delete that profile. Profile deletion should succeed, sync should continue to operate for other accounts and sync data from the deleted account shouldn't be affected.


Review URL: http://codereview.chromium.org/8772028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112785 0039d316-1c4b-4281-b951-d872f2087c98
parent c6b2c217
......@@ -676,9 +676,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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment