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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 PinStorage* pin_storage = PinStorageFactory::GetForUser(user); | 126 PinStorage* pin_storage = PinStorageFactory::GetForUser(user); |
127 if (!pin_storage) | 127 if (!pin_storage) |
128 return false; | 128 return false; |
129 | 129 |
130 return pin_storage->IsPinAuthenticationAvailable(); | 130 return pin_storage->IsPinAuthenticationAvailable(); |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) | 135 UserSelectionScreen::UserSelectionScreen(const std::string& display_type) |
136 : handler_(nullptr), | 136 : BaseScreen(nullptr, OobeScreen::SCREEN_USER_SELECTION), |
137 login_display_delegate_(nullptr), | |
138 view_(nullptr), | |
139 display_type_(display_type), | 137 display_type_(display_type), |
140 weak_factory_(this) { | 138 weak_factory_(this) {} |
141 } | |
142 | 139 |
143 UserSelectionScreen::~UserSelectionScreen() { | 140 UserSelectionScreen::~UserSelectionScreen() { |
144 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(nullptr); | 141 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(nullptr); |
145 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); | 142 ui::UserActivityDetector* activity_detector = ui::UserActivityDetector::Get(); |
146 if (activity_detector && activity_detector->HasObserver(this)) | 143 if (activity_detector && activity_detector->HasObserver(this)) |
147 activity_detector->RemoveObserver(this); | 144 activity_detector->RemoveObserver(this); |
148 } | 145 } |
149 | 146 |
150 void UserSelectionScreen::InitEasyUnlock() { | 147 void UserSelectionScreen::InitEasyUnlock() { |
151 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(this); | 148 proximity_auth::ScreenlockBridge::Get()->SetLockHandler(this); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 DCHECK_EQ(GetScreenType(), SIGNIN_SCREEN); | 523 DCHECK_EQ(GetScreenType(), SIGNIN_SCREEN); |
527 | 524 |
528 UserContext user_context(account_id); | 525 UserContext user_context(account_id); |
529 user_context.SetAuthFlow(UserContext::AUTH_FLOW_EASY_UNLOCK); | 526 user_context.SetAuthFlow(UserContext::AUTH_FLOW_EASY_UNLOCK); |
530 user_context.SetKey(Key(secret)); | 527 user_context.SetKey(Key(secret)); |
531 user_context.GetKey()->SetLabel(key_label); | 528 user_context.GetKey()->SetLabel(key_label); |
532 | 529 |
533 login_display_delegate_->Login(user_context, SigninSpecifics()); | 530 login_display_delegate_->Login(user_context, SigninSpecifics()); |
534 } | 531 } |
535 | 532 |
| 533 void UserSelectionScreen::Show() {} |
| 534 |
| 535 void UserSelectionScreen::Hide() {} |
| 536 |
536 void UserSelectionScreen::HardLockPod(const AccountId& account_id) { | 537 void UserSelectionScreen::HardLockPod(const AccountId& account_id) { |
537 view_->SetAuthType(account_id, OFFLINE_PASSWORD, base::string16()); | 538 view_->SetAuthType(account_id, OFFLINE_PASSWORD, base::string16()); |
538 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); | 539 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); |
539 if (!service) | 540 if (!service) |
540 return; | 541 return; |
541 service->SetHardlockState(EasyUnlockScreenlockStateHandler::USER_HARDLOCK); | 542 service->SetHardlockState(EasyUnlockScreenlockStateHandler::USER_HARDLOCK); |
542 } | 543 } |
543 | 544 |
544 void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) { | 545 void UserSelectionScreen::AttemptEasyUnlock(const AccountId& account_id) { |
545 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); | 546 EasyUnlockService* service = GetEasyUnlockServiceForUser(account_id); |
(...skipping 30 matching lines...) Expand all Loading... |
576 // The user profile should exist if and only if this is the lock screen. | 577 // The user profile should exist if and only if this is the lock screen. |
577 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 578 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
578 | 579 |
579 if (!profile) | 580 if (!profile) |
580 profile = profile_helper->GetSigninProfile(); | 581 profile = profile_helper->GetSigninProfile(); |
581 | 582 |
582 return EasyUnlockService::Get(profile); | 583 return EasyUnlockService::Get(profile); |
583 } | 584 } |
584 | 585 |
585 } // namespace chromeos | 586 } // namespace chromeos |
OLD | NEW |