| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 NOTREACHED(); | 456 NOTREACHED(); |
| 457 return; | 457 return; |
| 458 } | 458 } |
| 459 | 459 |
| 460 base::FilePath profile_path; | 460 base::FilePath profile_path; |
| 461 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) { | 461 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) { |
| 462 NOTREACHED(); | 462 NOTREACHED(); |
| 463 return; | 463 return; |
| 464 } | 464 } |
| 465 | 465 |
| 466 if (!profiles::IsMultipleProfilesEnabled()) { | 466 DCHECK(profiles::IsMultipleProfilesEnabled()); |
| 467 NOTREACHED(); | |
| 468 return; | |
| 469 } | |
| 470 | 467 |
| 471 // The callback is run if the only profile has been deleted, and a new | 468 // The callback is run if the only profile has been deleted, and a new |
| 472 // profile has been created to replace it. | 469 // profile has been created to replace it. |
| 473 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | 470 webui::DeleteProfileAtPath(profile_path, |
| 474 profile_path, base::Bind(&webui::OpenNewWindowForProfile)); | 471 web_ui(), |
| 475 ProfileMetrics::LogProfileDeleteUser( | 472 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); |
| 476 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); | |
| 477 } | 473 } |
| 478 | 474 |
| 479 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) { | 475 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) { |
| 480 if (IsGuestModeEnabled()) { | 476 if (IsGuestModeEnabled()) { |
| 481 profiles::SwitchToGuestProfile( | 477 profiles::SwitchToGuestProfile( |
| 482 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete, | 478 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete, |
| 483 weak_ptr_factory_.GetWeakPtr())); | 479 weak_ptr_factory_.GetWeakPtr())); |
| 484 } else { | 480 } else { |
| 485 // The UI should have prevented the user from allowing the selection of | 481 // The UI should have prevented the user from allowing the selection of |
| 486 // guest mode. | 482 // guest mode. |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 Profile* profile, Profile::CreateStatus profile_create_status) { | 977 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 982 Browser* browser = chrome::FindAnyBrowser(profile, false); | 978 Browser* browser = chrome::FindAnyBrowser(profile, false); |
| 983 if (browser && browser->window()) { | 979 if (browser && browser->window()) { |
| 984 OnBrowserWindowReady(browser); | 980 OnBrowserWindowReady(browser); |
| 985 } else { | 981 } else { |
| 986 registrar_.Add(this, | 982 registrar_.Add(this, |
| 987 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 983 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 988 content::NotificationService::AllSources()); | 984 content::NotificationService::AllSources()); |
| 989 } | 985 } |
| 990 } | 986 } |
| OLD | NEW |