Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/login/screens/user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" | 21 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" |
| 22 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" | 22 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
| 23 #include "chrome/browser/chromeos/login/reauth_stats.h" | 23 #include "chrome/browser/chromeos/login/reauth_stats.h" |
| 24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 25 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" | 25 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" |
| 26 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 26 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 27 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 27 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 30 #include "chrome/browser/signin/easy_unlock_service.h" | 30 #include "chrome/browser/signin/easy_unlock_service.h" |
| 31 #include "chrome/browser/ui/ash/lock_screen_client.h" | |
| 31 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 32 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
| 32 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 33 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 33 #include "chrome/grit/generated_resources.h" | 34 #include "chrome/grit/generated_resources.h" |
| 34 #include "chromeos/chromeos_switches.h" | 35 #include "chromeos/chromeos_switches.h" |
| 35 #include "chromeos/cryptohome/cryptohome_parameters.h" | 36 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 36 #include "chromeos/dbus/cryptohome_client.h" | 37 #include "chromeos/dbus/cryptohome_client.h" |
| 37 #include "chromeos/dbus/dbus_method_call_status.h" | 38 #include "chromeos/dbus/dbus_method_call_status.h" |
| 38 #include "chromeos/dbus/dbus_thread_manager.h" | 39 #include "chromeos/dbus/dbus_thread_manager.h" |
| 39 #include "components/arc/arc_util.h" | 40 #include "components/arc/arc_util.h" |
| 40 #include "components/prefs/pref_service.h" | 41 #include "components/prefs/pref_service.h" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 // Single user check here is necessary because owner info might not be | 534 // Single user check here is necessary because owner info might not be |
| 534 // available when running into login screen on first boot. | 535 // available when running into login screen on first boot. |
| 535 // See http://crosbug.com/12723 | 536 // See http://crosbug.com/12723 |
| 536 bool can_remove_user = | 537 bool can_remove_user = |
| 537 ((!single_user || is_enterprise_managed) && account_id.is_valid() && | 538 ((!single_user || is_enterprise_managed) && account_id.is_valid() && |
| 538 !is_owner && !is_public_account && !signed_in && !is_signin_to_add); | 539 !is_owner && !is_public_account && !signed_in && !is_signin_to_add); |
| 539 user_dict->SetBoolean(kKeyCanRemove, can_remove_user); | 540 user_dict->SetBoolean(kKeyCanRemove, can_remove_user); |
| 540 users_list.Append(std::move(user_dict)); | 541 users_list.Append(std::move(user_dict)); |
| 541 } | 542 } |
| 542 | 543 |
| 543 handler_->LoadUsers(users_list, show_guest_); | 544 if (handler_) { |
| 545 handler_->LoadUsers(users_list, show_guest_); | |
| 546 } else { | |
| 547 // Views-based lock screen won't instantiate handler. | |
| 548 LockScreenClient::Get()->LoadUsers(users_list, show_guest_); | |
|
jdufault
2017/05/31 22:54:00
FYI, https://codereview.chromium.org/2811383002/.
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:29
Thanks for the information.
| |
| 549 } | |
| 544 } | 550 } |
| 545 | 551 |
| 546 void UserSelectionScreen::HandleGetUsers() { | 552 void UserSelectionScreen::HandleGetUsers() { |
| 547 SendUserList(); | 553 SendUserList(); |
| 548 } | 554 } |
| 549 | 555 |
| 550 void UserSelectionScreen::CheckUserStatus(const AccountId& account_id) { | 556 void UserSelectionScreen::CheckUserStatus(const AccountId& account_id) { |
| 551 // No checks on lock screen. | 557 // No checks on lock screen. |
| 552 if (ScreenLocker::default_screen_locker()) | 558 if (ScreenLocker::default_screen_locker()) |
| 553 return; | 559 return; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 void UserSelectionScreen::AttemptEasySignin(const AccountId& account_id, | 655 void UserSelectionScreen::AttemptEasySignin(const AccountId& account_id, |
| 650 const std::string& secret, | 656 const std::string& secret, |
| 651 const std::string& key_label) { | 657 const std::string& key_label) { |
| 652 DCHECK_EQ(GetScreenType(), SIGNIN_SCREEN); | 658 DCHECK_EQ(GetScreenType(), SIGNIN_SCREEN); |
| 653 | 659 |
| 654 UserContext user_context(account_id); | 660 UserContext user_context(account_id); |
| 655 user_context.SetAuthFlow(UserContext::AUTH_FLOW_EASY_UNLOCK); | 661 user_context.SetAuthFlow(UserContext::AUTH_FLOW_EASY_UNLOCK); |
| 656 user_context.SetKey(Key(secret)); | 662 user_context.SetKey(Key(secret)); |
| 657 user_context.GetKey()->SetLabel(key_label); | 663 user_context.GetKey()->SetLabel(key_label); |
| 658 | 664 |
| 659 login_display_delegate_->Login(user_context, SigninSpecifics()); | 665 // login display delegate not exist in views-based lock screen. |
| 666 if (login_display_delegate_) | |
| 667 login_display_delegate_->Login(user_context, SigninSpecifics()); | |
| 660 } | 668 } |
| 661 | 669 |
| 662 void UserSelectionScreen::Show() {} | 670 void UserSelectionScreen::Show() {} |
| 663 | 671 |
| 664 void UserSelectionScreen::Hide() {} | 672 void UserSelectionScreen::Hide() {} |
| 665 | 673 |
| 666 void UserSelectionScreen::HardLockPod(const AccountId& account_id) { | 674 void UserSelectionScreen::HardLockPod(const AccountId& account_id) { |
| 667 view_->SetAuthType(account_id, OFFLINE_PASSWORD, base::string16()); | 675 view_->SetAuthType(account_id, OFFLINE_PASSWORD, base::string16()); |
| 668 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); | 676 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); |
| 669 if (!service) | 677 if (!service) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 // The user profile should exist if and only if this is the lock screen. | 714 // The user profile should exist if and only if this is the lock screen. |
| 707 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 715 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 708 | 716 |
| 709 if (!profile) | 717 if (!profile) |
| 710 profile = profile_helper->GetSigninProfile(); | 718 profile = profile_helper->GetSigninProfile(); |
| 711 | 719 |
| 712 return EasyUnlockService::Get(profile); | 720 return EasyUnlockService::Get(profile); |
| 713 } | 721 } |
| 714 | 722 |
| 715 } // namespace chromeos | 723 } // namespace chromeos |
| OLD | NEW |