| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/value_conversions.h" | 10 #include "base/value_conversions.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 452 |
| 453 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | 453 g_browser_process->profile_manager()->ScheduleProfileForDeletion( |
| 454 profile_path, | 454 profile_path, |
| 455 base::Bind(&OpenNewWindowForProfile, desktop_type_)); | 455 base::Bind(&OpenNewWindowForProfile, desktop_type_)); |
| 456 ProfileMetrics::LogProfileDeleteUser( | 456 ProfileMetrics::LogProfileDeleteUser( |
| 457 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); | 457 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) { | 460 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) { |
| 461 if (IsGuestModeEnabled()) { | 461 if (IsGuestModeEnabled()) { |
| 462 ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_GUEST); | |
| 463 profiles::SwitchToGuestProfile( | 462 profiles::SwitchToGuestProfile( |
| 464 desktop_type_, | 463 desktop_type_, |
| 465 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete, | 464 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete, |
| 466 weak_ptr_factory_.GetWeakPtr())); | 465 weak_ptr_factory_.GetWeakPtr())); |
| 467 } else { | 466 } else { |
| 468 // The UI should have prevented the user from allowing the selection of | 467 // The UI should have prevented the user from allowing the selection of |
| 469 // guest mode. | 468 // guest mode. |
| 470 NOTREACHED(); | 469 NOTREACHED(); |
| 471 } | 470 } |
| 472 } | 471 } |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 Profile* profile, Profile::CreateStatus profile_create_status) { | 828 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 830 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 829 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
| 831 if (browser && browser->window()) { | 830 if (browser && browser->window()) { |
| 832 OnBrowserWindowReady(browser); | 831 OnBrowserWindowReady(browser); |
| 833 } else { | 832 } else { |
| 834 registrar_.Add(this, | 833 registrar_.Add(this, |
| 835 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 834 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 836 content::NotificationService::AllSources()); | 835 content::NotificationService::AllSources()); |
| 837 } | 836 } |
| 838 } | 837 } |
| OLD | NEW |