Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 9a0ed359e027b479444f1de4e679df58d4132974..af148242df390c8df2436257864c8daf07ea2765 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -726,10 +726,20 @@ ProfileShortcutManager* ProfileManager::profile_shortcut_manager() { |
| } |
| #if !defined(OS_ANDROID) |
| +bool ProfileManager::MaybeScheduleProfileForDeletion( |
| + const base::FilePath& profile_dir, |
| + const CreateCallback& callback) { |
| + if (IsProfileMarkedForDeletion(profile_dir)) |
| + return false; |
| + ScheduleProfileForDeletion(profile_dir, callback); |
| + return true; |
| +} |
| + |
| void ProfileManager::ScheduleProfileForDeletion( |
| const base::FilePath& profile_dir, |
| const CreateCallback& callback) { |
| DCHECK(profiles::IsMultipleProfilesEnabled()); |
| + CHECK(!IsProfileMarkedForDeletion(profile_dir)); |
|
Dan Beam
2016/05/13 03:37:40
sooooo, why can't we just do:
if (IsProfileMarked
Bernhard Bauer
2016/05/13 09:37:54
I would make this a DCHECK though.
|
| // Cancel all in-progress downloads before deleting the profile to prevent a |
| // "Do you want to exit Google Chrome and cancel the downloads?" prompt |