Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/login/lock/view_screen_locker.h" | |
| 6 | |
| 7 #include "base/metrics/histogram_macros.h" | |
| 8 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" | |
| 9 | |
| 10 namespace chromeos { | |
| 11 | |
| 12 namespace { | |
| 13 const char kLockDisplay[] = "lock"; | |
|
xiyuan
2017/05/31 17:51:18
nit: const -> constexpr
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:29
Done.
| |
| 14 } // namespace | |
| 15 | |
| 16 ViewScreenLocker::ViewScreenLocker(ScreenLocker* screen_locker) | |
| 17 : screen_locker_(screen_locker), weak_factory_(this) { | |
| 18 LockScreenClient::Get()->SetDelegate(this); | |
| 19 user_selection_screen_.reset(new ChromeUserSelectionScreen(kLockDisplay)); | |
| 20 user_selection_screen_->SetView(LockScreenClient::Get()); | |
| 21 } | |
| 22 | |
| 23 ViewScreenLocker::~ViewScreenLocker() { | |
| 24 LockScreenClient::Get()->SetDelegate(nullptr); | |
| 25 } | |
| 26 | |
| 27 void ViewScreenLocker::SetPasswordInputEnabled(bool enabled) { | |
| 28 NOTIMPLEMENTED(); | |
| 29 } | |
| 30 | |
| 31 void ViewScreenLocker::ShowErrorMessage( | |
| 32 int error_msg_id, | |
| 33 HelpAppLauncher::HelpTopic help_topic_id) { | |
| 34 // TODO(xiaoyinh): Complete the implementation here. | |
| 35 LockScreenClient::Get()->ShowErrorMessage(0 /* login_attempts */, | |
| 36 std::string(), std::string(), | |
| 37 static_cast<int>(help_topic_id)); | |
| 38 } | |
| 39 | |
| 40 void ViewScreenLocker::ClearErrors() { | |
| 41 LockScreenClient::Get()->ClearErrors(); | |
| 42 } | |
| 43 | |
| 44 void ViewScreenLocker::AnimateAuthenticationSuccess() { | |
| 45 NOTIMPLEMENTED(); | |
| 46 } | |
| 47 | |
| 48 void ViewScreenLocker::OnLockWebUIReady() { | |
| 49 NOTIMPLEMENTED(); | |
| 50 } | |
| 51 | |
| 52 void ViewScreenLocker::OnLockBackgroundDisplayed() { | |
| 53 NOTIMPLEMENTED(); | |
| 54 } | |
| 55 | |
| 56 void ViewScreenLocker::OnHeaderBarVisible() { | |
| 57 NOTIMPLEMENTED(); | |
| 58 } | |
| 59 | |
| 60 void ViewScreenLocker::OnAshLockAnimationFinished() { | |
| 61 NOTIMPLEMENTED(); | |
| 62 } | |
| 63 | |
| 64 void ViewScreenLocker::SetFingerprintState( | |
| 65 const AccountId& account_id, | |
| 66 ScreenLocker::FingerprintState state) { | |
| 67 NOTIMPLEMENTED(); | |
| 68 } | |
| 69 | |
| 70 content::WebContents* ViewScreenLocker::GetWebContents() { | |
| 71 return nullptr; | |
| 72 } | |
| 73 | |
| 74 void ViewScreenLocker::Init() { | |
| 75 lock_time_ = base::TimeTicks::Now(); | |
| 76 user_selection_screen_->Init(screen_locker_->users(), false /* show_guest */); | |
| 77 user_selection_screen_->HandleGetUsers(); | |
|
xiyuan
2017/05/31 17:51:18
Prefer to split UserSelectionScreen::SendUserList
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:29
Done.
| |
| 78 } | |
| 79 | |
| 80 void ViewScreenLocker::OnLockScreenReady() { | |
| 81 user_selection_screen_->InitEasyUnlock(); | |
| 82 UMA_HISTOGRAM_TIMES("LockScreen.LockReady", | |
| 83 base::TimeTicks::Now() - lock_time_); | |
| 84 screen_locker_->ScreenLockReady(); | |
| 85 } | |
| 86 | |
| 87 void ViewScreenLocker::HandleAttemptUnlock(const AccountId& account_id) { | |
| 88 user_selection_screen_->AttemptEasyUnlock(account_id); | |
| 89 } | |
| 90 | |
| 91 void ViewScreenLocker::HandleHardlockPod(const AccountId& account_id) { | |
| 92 user_selection_screen_->HardLockPod(account_id); | |
| 93 } | |
| 94 | |
| 95 void ViewScreenLocker::HandleRecordClickOnLockIcon( | |
| 96 const AccountId& account_id) { | |
| 97 user_selection_screen_->RecordClickOnLockIcon(account_id); | |
| 98 } | |
| 99 | |
| 100 } // namespace chromeos | |
| OLD | NEW |