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

Unified Diff: chrome/browser/ui/webui/signin/signin_error_handler.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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/signin/signin_error_handler.cc
diff --git a/chrome/browser/ui/webui/signin/signin_error_handler.cc b/chrome/browser/ui/webui/signin/signin_error_handler.cc
index 47916eac593aa98861a2d515cf60d1d56ed6c450..4111b6a52e9ce6c7259f8995a17c9a4bc6ac663f 100644
--- a/chrome/browser/ui/webui/signin/signin_error_handler.cc
+++ b/chrome/browser/ui/webui/signin/signin_error_handler.cc
@@ -38,14 +38,19 @@ void SigninErrorHandler::HandleSwitchToExistingProfile(
const base::ListValue* args) {
if (duplicate_profile_path_.empty())
return;
+
+ // CloseDialog will eventually destroy this object, so nothing should access
+ // its members after this call. However, closing the dialog may steal focus
+ // back to the original window, so make a copy of the path to switch to and
+ // perform the switch after the dialog is closed.
+ base::FilePath path_switching_to = duplicate_profile_path_;
+ CloseDialog();
+
// Switch to the existing duplicate profile. Do not create a new window when
// any existing ones can be reused.
- profiles::SwitchToProfile(duplicate_profile_path_, false,
+ profiles::SwitchToProfile(path_switching_to, false,
ProfileManager::CreateCallback(),
ProfileMetrics::SWITCH_PROFILE_DUPLICATE);
- // CloseDialog will eventually destroy this object, so nothing should access
- // its members after this call.
- CloseDialog();
}
void SigninErrorHandler::HandleConfirm(const base::ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698