| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // have been reused. | 376 // have been reused. |
| 377 for (user_manager::User* user : users_) | 377 for (user_manager::User* user : users_) |
| 378 handler_->OnUserImageChanged(*user); | 378 handler_->OnUserImageChanged(*user); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 void UserSelectionScreen::SetView(UserBoardView* view) { | 382 void UserSelectionScreen::SetView(UserBoardView* view) { |
| 383 view_ = view; | 383 view_ = view; |
| 384 } | 384 } |
| 385 | 385 |
| 386 void UserSelectionScreen::Init(const user_manager::UserList& users, | 386 void UserSelectionScreen::Init(const user_manager::UserList& users) { |
| 387 bool show_guest) { | |
| 388 users_ = users; | 387 users_ = users; |
| 389 show_guest_ = show_guest; | |
| 390 | 388 |
| 391 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); | 389 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
| 392 if (activity_detector && !activity_detector->HasObserver(this)) | 390 if (activity_detector && !activity_detector->HasObserver(this)) |
| 393 activity_detector->AddObserver(this); | 391 activity_detector->AddObserver(this); |
| 394 } | 392 } |
| 395 | 393 |
| 396 void UserSelectionScreen::OnBeforeUserRemoved(const AccountId& account_id) { | 394 void UserSelectionScreen::OnBeforeUserRemoved(const AccountId& account_id) { |
| 397 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end(); | 395 for (user_manager::UserList::iterator it = users_.begin(); it != users_.end(); |
| 398 ++it) { | 396 ++it) { |
| 399 if ((*it)->GetAccountId() == account_id) { | 397 if ((*it)->GetAccountId() == account_id) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // Single user check here is necessary because owner info might not be | 515 // Single user check here is necessary because owner info might not be |
| 518 // available when running into login screen on first boot. | 516 // available when running into login screen on first boot. |
| 519 // See http://crosbug.com/12723 | 517 // See http://crosbug.com/12723 |
| 520 bool can_remove_user = | 518 bool can_remove_user = |
| 521 ((!single_user || is_enterprise_managed) && account_id.is_valid() && | 519 ((!single_user || is_enterprise_managed) && account_id.is_valid() && |
| 522 !is_owner && !is_public_account && !signed_in && !is_signin_to_add); | 520 !is_owner && !is_public_account && !signed_in && !is_signin_to_add); |
| 523 user_dict->SetBoolean(kKeyCanRemove, can_remove_user); | 521 user_dict->SetBoolean(kKeyCanRemove, can_remove_user); |
| 524 users_list.Append(std::move(user_dict)); | 522 users_list.Append(std::move(user_dict)); |
| 525 } | 523 } |
| 526 | 524 |
| 527 handler_->LoadUsers(users_list, show_guest_); | 525 handler_->LoadUsers(users_to_send, users_list); |
| 528 } | 526 } |
| 529 | 527 |
| 530 void UserSelectionScreen::HandleGetUsers() { | 528 void UserSelectionScreen::HandleGetUsers() { |
| 531 SendUserList(); | 529 SendUserList(); |
| 532 } | 530 } |
| 533 | 531 |
| 534 void UserSelectionScreen::CheckUserStatus(const AccountId& account_id) { | 532 void UserSelectionScreen::CheckUserStatus(const AccountId& account_id) { |
| 535 // No checks on lock screen. | 533 // No checks on lock screen. |
| 536 if (ScreenLocker::default_screen_locker()) | 534 if (ScreenLocker::default_screen_locker()) |
| 537 return; | 535 return; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 // The user profile should exist if and only if this is the lock screen. | 688 // The user profile should exist if and only if this is the lock screen. |
| 691 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 689 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 692 | 690 |
| 693 if (!profile) | 691 if (!profile) |
| 694 profile = profile_helper->GetSigninProfile(); | 692 profile = profile_helper->GetSigninProfile(); |
| 695 | 693 |
| 696 return EasyUnlockService::Get(profile); | 694 return EasyUnlockService::Get(profile); |
| 697 } | 695 } |
| 698 | 696 |
| 699 } // namespace chromeos | 697 } // namespace chromeos |
| OLD | NEW |