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

Side by Side Diff: chrome/browser/chromeos/login/lock/view_screen_locker.cc

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: clean up and trybot 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 unified diff | Download patch
OLDNEW
(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";
14 } // namespace
15
16 ViewScreenLocker::ViewScreenLocker(ScreenLocker* screen_locker)
17 : screen_locker_(screen_locker), weak_factory_(this) {
18 LockScreenClient::Get()->SetDelegate(this);
19 std::string display_type = kLockDisplay;
jdufault 2017/05/26 18:59:10 const
xiaoyinh(OOO Sep 11-29) 2017/05/30 22:23:50 Thanks. Changed to use kLockDisplay directly.
20 user_selection_screen_.reset(new ChromeUserSelectionScreen(display_type));
21 user_selection_screen_->SetView(LockScreenClient::Get());
22 }
23
24 ViewScreenLocker::~ViewScreenLocker() {
25 LockScreenClient::Get()->SetDelegate(nullptr);
26 }
27
28 void ViewScreenLocker::SetPasswordInputEnabled(bool enabled) {
29 NOTIMPLEMENTED();
30 }
31
32 void ViewScreenLocker::ShowErrorMessage(
33 int error_msg_id,
34 HelpAppLauncher::HelpTopic help_topic_id) {
35 // TODO(xiaoyinh): Complete the implementation here.
36 LockScreenClient::Get()->ShowErrorMessage(0 /* login_attempts */,
37 std::string(), std::string(),
38 static_cast<int>(help_topic_id));
39 }
40
41 void ViewScreenLocker::ClearErrors() {
42 LockScreenClient::Get()->ClearErrors();
43 }
44
45 void ViewScreenLocker::AnimateAuthenticationSuccess() {
46 NOTIMPLEMENTED();
47 }
48
49 void ViewScreenLocker::OnLockWebUIReady() {
50 NOTIMPLEMENTED();
51 }
52
53 void ViewScreenLocker::OnLockBackgroundDisplayed() {
54 NOTIMPLEMENTED();
55 }
56
57 void ViewScreenLocker::OnHeaderBarVisible() {
58 NOTIMPLEMENTED();
59 }
60
61 void ViewScreenLocker::OnAshLockAnimationFinished() {
62 NOTIMPLEMENTED();
63 }
64
65 void ViewScreenLocker::SetFingerprintState(
66 const AccountId& account_id,
67 ScreenLocker::FingerprintState state) {
68 NOTIMPLEMENTED();
69 }
70
71 content::WebContents* ViewScreenLocker::GetWebContents() {
72 return nullptr;
73 }
74
75 void ViewScreenLocker::Init() {
76 lock_time_ = base::TimeTicks::Now();
77 user_selection_screen_->Init(screen_locker_->users(), false /* show_guest */);
78 user_selection_screen_->HandleGetUsers();
79 }
80
81 void ViewScreenLocker::OnLockScreenReady() {
82 user_selection_screen_->InitEasyUnlock();
83 UMA_HISTOGRAM_TIMES("LockScreen.LockReady",
84 base::TimeTicks::Now() - lock_time_);
85 screen_locker_->ScreenLockReady();
86 }
87
88 void ViewScreenLocker::HandleAttemptUnlock(const AccountId& account_id) {
89 user_selection_screen_->AttemptEasyUnlock(account_id);
90 }
91
92 void ViewScreenLocker::HandleHardlockPod(const AccountId& account_id) {
93 user_selection_screen_->HardLockPod(account_id);
94 }
95
96 void ViewScreenLocker::HandleRecordClickOnLockIcon(
97 const AccountId& account_id) {
98 user_selection_screen_->RecordClickOnLockIcon(account_id);
99 }
100
101 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698