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

Unified Diff: chrome/browser/ui/webui/profile_helper.cc

Issue 1869473002: Fixed crash on double profile delete operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 4 years, 7 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
Index: chrome/browser/ui/webui/profile_helper.cc
diff --git a/chrome/browser/ui/webui/profile_helper.cc b/chrome/browser/ui/webui/profile_helper.cc
index f350b962f1c9a8c56524d20225f3292814038455..37bce0fa2206d0872a973dad7130e7c1ecea1d03 100644
--- a/chrome/browser/ui/webui/profile_helper.cc
+++ b/chrome/browser/ui/webui/profile_helper.cc
@@ -26,16 +26,17 @@ void OpenNewWindowForProfile(Profile* profile, Profile::CreateStatus status) {
chrome::startup::IS_FIRST_RUN, false);
}
-void DeleteProfileAtPath(base::FilePath file_path, content::WebUI* web_ui) {
+void DeleteProfileAtPath(base::FilePath file_path,
+ content::WebUI* web_ui,
+ ProfileMetrics::ProfileDelete user) {
DCHECK(web_ui);
if (!profiles::IsMultipleProfilesEnabled())
return;
-
- ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::DELETE_PROFILE_SETTINGS);
-
- g_browser_process->profile_manager()->ScheduleProfileForDeletion(
- file_path, base::Bind(&OpenNewWindowForProfile));
+ if (g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion(
achuithb 2016/05/12 22:33:59 This seems a bit awkward. Can you pass user into M
+ file_path, base::Bind(&OpenNewWindowForProfile))) {
+ ProfileMetrics::LogProfileDeleteUser(user);
+ }
}
} // namespace webui

Powered by Google App Engine
This is Rietveld 408576698