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

Side by Side Diff: chrome/browser/ui/webui/options/sync_setup_handler.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 bool delete_profile = false; 686 bool delete_profile = false;
687 args->GetBoolean(0, &delete_profile); 687 args->GetBoolean(0, &delete_profile);
688 signin_metrics::SignoutDelete delete_metric = 688 signin_metrics::SignoutDelete delete_metric =
689 delete_profile ? signin_metrics::SignoutDelete::DELETED 689 delete_profile ? signin_metrics::SignoutDelete::DELETED
690 : signin_metrics::SignoutDelete::KEEPING; 690 : signin_metrics::SignoutDelete::KEEPING;
691 SigninManagerFactory::GetForProfile(GetProfile()) 691 SigninManagerFactory::GetForProfile(GetProfile())
692 ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric); 692 ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric);
693 693
694 if (delete_profile) { 694 if (delete_profile) {
695 // Do as BrowserOptionsHandler::DeleteProfile(). 695 // Do as BrowserOptionsHandler::DeleteProfile().
696 webui::DeleteProfileAtPath(GetProfile()->GetPath(), web_ui()); 696 webui::DeleteProfileAtPath(GetProfile()->GetPath(),
achuithb 2016/05/12 22:33:59 {}
697 web_ui(),
698 ProfileMetrics::DELETE_PROFILE_SETTINGS);
697 } 699 }
698 } 700 }
699 #endif 701 #endif
700 702
701 void SyncSetupHandler::HandleCloseTimeout(const base::ListValue* args) { 703 void SyncSetupHandler::HandleCloseTimeout(const base::ListValue* args) {
702 CloseSyncSetup(); 704 CloseSyncSetup();
703 } 705 }
704 706
705 void SyncSetupHandler::CloseSyncSetup() { 707 void SyncSetupHandler::CloseSyncSetup() {
706 // Stop a timer to handle timeout in waiting for checking network connection. 708 // Stop a timer to handle timeout in waiting for checking network connection.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 "SyncSetupOverlay.showSyncSetupPage", page, args); 967 "SyncSetupOverlay.showSyncSetupPage", page, args);
966 968
967 // Make sure the tab used for the Gaia sign in does not cover the settings 969 // Make sure the tab used for the Gaia sign in does not cover the settings
968 // tab. 970 // tab.
969 FocusUI(); 971 FocusUI();
970 } 972 }
971 973
972 LoginUIService* SyncSetupHandler::GetLoginUIService() const { 974 LoginUIService* SyncSetupHandler::GetLoginUIService() const {
973 return LoginUIServiceFactory::GetForProfile(GetProfile()); 975 return LoginUIServiceFactory::GetForProfile(GetProfile());
974 } 976 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698