Chromium Code Reviews| Index: chrome/browser/chromeos/login/lock/view_screen_locker.cc |
| diff --git a/chrome/browser/chromeos/login/lock/view_screen_locker.cc b/chrome/browser/chromeos/login/lock/view_screen_locker.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..98777f0288ba64dad54f2961dae4566ae405aa94 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/login/lock/view_screen_locker.cc |
| @@ -0,0 +1,100 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chromeos/login/lock/view_screen_locker.h" |
| + |
| +#include "base/metrics/histogram_macros.h" |
| +#include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" |
| + |
| +namespace chromeos { |
| + |
| +namespace { |
| +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.
|
| +} // namespace |
| + |
| +ViewScreenLocker::ViewScreenLocker(ScreenLocker* screen_locker) |
| + : screen_locker_(screen_locker), weak_factory_(this) { |
| + LockScreenClient::Get()->SetDelegate(this); |
| + user_selection_screen_.reset(new ChromeUserSelectionScreen(kLockDisplay)); |
| + user_selection_screen_->SetView(LockScreenClient::Get()); |
| +} |
| + |
| +ViewScreenLocker::~ViewScreenLocker() { |
| + LockScreenClient::Get()->SetDelegate(nullptr); |
| +} |
| + |
| +void ViewScreenLocker::SetPasswordInputEnabled(bool enabled) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::ShowErrorMessage( |
| + int error_msg_id, |
| + HelpAppLauncher::HelpTopic help_topic_id) { |
| + // TODO(xiaoyinh): Complete the implementation here. |
| + LockScreenClient::Get()->ShowErrorMessage(0 /* login_attempts */, |
| + std::string(), std::string(), |
| + static_cast<int>(help_topic_id)); |
| +} |
| + |
| +void ViewScreenLocker::ClearErrors() { |
| + LockScreenClient::Get()->ClearErrors(); |
| +} |
| + |
| +void ViewScreenLocker::AnimateAuthenticationSuccess() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::OnLockWebUIReady() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::OnLockBackgroundDisplayed() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::OnHeaderBarVisible() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::OnAshLockAnimationFinished() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void ViewScreenLocker::SetFingerprintState( |
| + const AccountId& account_id, |
| + ScreenLocker::FingerprintState state) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +content::WebContents* ViewScreenLocker::GetWebContents() { |
| + return nullptr; |
| +} |
| + |
| +void ViewScreenLocker::Init() { |
| + lock_time_ = base::TimeTicks::Now(); |
| + user_selection_screen_->Init(screen_locker_->users(), false /* show_guest */); |
| + 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.
|
| +} |
| + |
| +void ViewScreenLocker::OnLockScreenReady() { |
| + user_selection_screen_->InitEasyUnlock(); |
| + UMA_HISTOGRAM_TIMES("LockScreen.LockReady", |
| + base::TimeTicks::Now() - lock_time_); |
| + screen_locker_->ScreenLockReady(); |
| +} |
| + |
| +void ViewScreenLocker::HandleAttemptUnlock(const AccountId& account_id) { |
| + user_selection_screen_->AttemptEasyUnlock(account_id); |
| +} |
| + |
| +void ViewScreenLocker::HandleHardlockPod(const AccountId& account_id) { |
| + user_selection_screen_->HardLockPod(account_id); |
| +} |
| + |
| +void ViewScreenLocker::HandleRecordClickOnLockIcon( |
| + const AccountId& account_id) { |
| + user_selection_screen_->RecordClickOnLockIcon(account_id); |
| +} |
| + |
| +} // namespace chromeos |