Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: chrome/browser/chromeos/login/lock/view_screen_locker.cc

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: incoporate comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698