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/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/value_conversions.h" | 9 #include "base/value_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); | 617 kKeyAvatarUrl, GetAvatarImageAtIndex(i, info_cache)); |
618 | 618 |
619 // The row of user pods should display the active user first. | 619 // The row of user pods should display the active user first. |
620 if (is_active_user) | 620 if (is_active_user) |
621 users_list.Insert(0, profile_value); | 621 users_list.Insert(0, profile_value); |
622 else | 622 else |
623 users_list.Append(profile_value); | 623 users_list.Append(profile_value); |
624 } | 624 } |
625 | 625 |
626 web_ui()->CallJavascriptFunction("login.AccountPickerScreen.loadUsers", | 626 web_ui()->CallJavascriptFunction("login.AccountPickerScreen.loadUsers", |
627 users_list, base::FundamentalValue(false), base::FundamentalValue(true)); | 627 users_list, base::FundamentalValue(true)); |
628 } | 628 } |
629 | 629 |
630 void UserManagerScreenHandler::ReportAuthenticationResult( | 630 void UserManagerScreenHandler::ReportAuthenticationResult( |
631 bool success, | 631 bool success, |
632 ProfileMetrics::ProfileAuth auth) { | 632 ProfileMetrics::ProfileAuth auth) { |
633 ProfileMetrics::LogProfileAuthResult(auth); | 633 ProfileMetrics::LogProfileAuthResult(auth); |
634 password_attempt_.clear(); | 634 password_attempt_.clear(); |
635 | 635 |
636 if (success) { | 636 if (success) { |
637 ProfileInfoCache& info_cache = | 637 ProfileInfoCache& info_cache = |
638 g_browser_process->profile_manager()->GetProfileInfoCache(); | 638 g_browser_process->profile_manager()->GetProfileInfoCache(); |
639 info_cache.SetProfileSigninRequiredAtIndex( | 639 info_cache.SetProfileSigninRequiredAtIndex( |
640 authenticating_profile_index_, false); | 640 authenticating_profile_index_, false); |
641 base::FilePath path = info_cache.GetPathOfProfileAtIndex( | 641 base::FilePath path = info_cache.GetPathOfProfileAtIndex( |
642 authenticating_profile_index_); | 642 authenticating_profile_index_); |
643 profiles::SwitchToProfile(path, desktop_type_, true, | 643 profiles::SwitchToProfile(path, desktop_type_, true, |
644 base::Bind(&OnSwitchToProfileComplete), | 644 base::Bind(&OnSwitchToProfileComplete), |
645 ProfileMetrics::SWITCH_PROFILE_UNLOCK); | 645 ProfileMetrics::SWITCH_PROFILE_UNLOCK); |
646 } else { | 646 } else { |
647 web_ui()->CallJavascriptFunction( | 647 web_ui()->CallJavascriptFunction( |
648 "cr.ui.Oobe.showSignInError", | 648 "cr.ui.Oobe.showSignInError", |
649 base::FundamentalValue(0), | 649 base::FundamentalValue(0), |
650 base::StringValue( | 650 base::StringValue( |
651 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING)), | 651 l10n_util::GetStringUTF8(IDS_LOGIN_ERROR_AUTHENTICATING)), |
652 base::StringValue(""), | 652 base::StringValue(""), |
653 base::FundamentalValue(0)); | 653 base::FundamentalValue(0)); |
654 } | 654 } |
655 } | 655 } |
OLD | NEW |