[go: nahoru, domu]

blob: 46c6679624f69d7bc69858e06a591daa4b92c9fa [file] [log] [blame]
xiaoyinh2bbdd102017-05-18 23:29:421// 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
Jacob Dufaultffd9b0d2017-11-15 23:07:165#include "ash/login/login_screen_controller.h"
xiaoyinh2bbdd102017-05-18 23:29:426
jdufaulteb4c9f1e2017-06-08 23:08:307#include "ash/login/ui/lock_screen.h"
Quan Nguyend09dd112018-06-19 19:20:328#include "ash/login/ui/lock_window.h"
Jacob Dufault40623d52017-09-15 17:22:539#include "ash/login/ui/login_data_dispatcher.h"
Sarah Hu069eea12017-09-08 01:28:4010#include "ash/public/cpp/ash_pref_names.h"
Aga Wronska16abb432018-01-11 23:49:5911#include "ash/root_window_controller.h"
Sarah Hu069eea12017-09-08 01:28:4012#include "ash/session/session_controller.h"
Quan Nguyend09dd112018-06-19 19:20:3213#include "ash/shelf/shelf.h"
14#include "ash/shelf/shelf_widget.h"
Sarah Hu069eea12017-09-08 01:28:4015#include "ash/shell.h"
Aga Wronska16abb432018-01-11 23:49:5916#include "ash/system/status_area_widget.h"
Jacob Dufaultc06d6ca2018-04-24 23:49:1717#include "base/debug/alias.h"
Sarah Hu069eea12017-09-08 01:28:4018#include "base/strings/string_number_conversions.h"
Jialiu Linf99b788b2018-01-17 23:01:2119#include "base/strings/utf_string_conversions.h"
xiaoyinh2bbdd102017-05-18 23:29:4220#include "chromeos/cryptohome/system_salt_getter.h"
Sarah Hu069eea12017-09-08 01:28:4021#include "components/prefs/pref_registry_simple.h"
Jacob Dufault957e0922017-12-06 19:16:0922#include "components/session_manager/session_manager_types.h"
xiaoyinh2bbdd102017-05-18 23:29:4223
24namespace ash {
25
Sarah Hu069eea12017-09-08 01:28:4026namespace {
xiaoyinh2bbdd102017-05-18 23:29:4227
Aga Wronskaa844cdcd12018-01-29 16:06:4428enum class SystemTrayVisibility {
29 kNone, // Tray not visible anywhere.
30 kPrimary, // Tray visible only on primary display.
31 kAll, // Tray visible on all displays.
32};
33
34void SetSystemTrayVisibility(SystemTrayVisibility visibility) {
35 RootWindowController* primary_window_controller =
36 Shell::GetPrimaryRootWindowController();
37 for (RootWindowController* window_controller :
38 Shell::GetAllRootWindowControllers()) {
39 StatusAreaWidget* status_area = window_controller->GetStatusAreaWidget();
40 if (!status_area)
41 continue;
42 if (window_controller == primary_window_controller) {
43 status_area->SetSystemTrayVisibility(
44 visibility == SystemTrayVisibility::kPrimary ||
45 visibility == SystemTrayVisibility::kAll);
46 } else {
47 status_area->SetSystemTrayVisibility(visibility ==
48 SystemTrayVisibility::kAll);
49 }
50 }
Aga Wronska16abb432018-01-11 23:49:5951}
52
Sarah Hu069eea12017-09-08 01:28:4053} // namespace
54
James Cookede316a2017-12-14 22:38:4355LoginScreenController::LoginScreenController() : weak_factory_(this) {}
James Cook8f1e6062017-11-13 23:40:5956
Jacob Dufaultffd9b0d2017-11-15 23:07:1657LoginScreenController::~LoginScreenController() = default;
xiaoyinh2bbdd102017-05-18 23:29:4258
Sarah Hu069eea12017-09-08 01:28:4059// static
Jacob Dufaultffd9b0d2017-11-15 23:07:1660void LoginScreenController::RegisterProfilePrefs(PrefRegistrySimple* registry,
61 bool for_test) {
Sarah Hu069eea12017-09-08 01:28:4062 if (for_test) {
63 // There is no remote pref service, so pretend that ash owns the pref.
64 registry->RegisterStringPref(prefs::kQuickUnlockPinSalt, "");
65 return;
66 }
67
68 // Pref is owned by chrome and flagged as PUBLIC.
69 registry->RegisterForeignPref(prefs::kQuickUnlockPinSalt);
70}
71
Jacob Dufaultffd9b0d2017-11-15 23:07:1672void LoginScreenController::BindRequest(mojom::LoginScreenRequest request) {
James Cookede316a2017-12-14 22:38:4373 bindings_.AddBinding(this, std::move(request));
xiaoyinh2bbdd102017-05-18 23:29:4274}
75
Jacob Dufaultb7a2d842017-12-01 23:21:1576void LoginScreenController::AuthenticateUser(const AccountId& account_id,
77 const std::string& password,
78 bool authenticated_by_pin,
79 OnAuthenticateCallback callback) {
Jacob Dufault8876ba82018-03-27 22:55:4380 // It is an error to call this function while an authentication is in
81 // progress.
Jacob Dufaultc06d6ca2018-04-24 23:49:1782 LOG_IF(ERROR, authentication_stage_ != AuthenticationStage::kIdle)
Jacob Dufault8876ba82018-03-27 22:55:4383 << "Authentication stage is " << static_cast<int>(authentication_stage_);
84 CHECK_EQ(authentication_stage_, AuthenticationStage::kIdle);
85
86 if (!login_screen_client_) {
Jacob Dufaultb7a2d842017-12-01 23:21:1587 std::move(callback).Run(base::nullopt);
xiaoyinh9f6fa0e2017-06-07 19:22:3288 return;
Jacob Dufaultb7a2d842017-12-01 23:21:1589 }
xiaoyinh9f6fa0e2017-06-07 19:22:3290
Jacob Dufaulteafc6fe2017-10-11 21:16:5291 // If auth is disabled by the debug overlay bypass the mojo call entirely, as
92 // it will dismiss the lock screen if the password is correct.
Jacob Dufault0fbed9c02017-11-14 19:22:2493 switch (force_fail_auth_for_debug_overlay_) {
94 case ForceFailAuth::kOff:
95 break;
96 case ForceFailAuth::kImmediate:
Jacob Dufaultb7a2d842017-12-01 23:21:1597 OnAuthenticateComplete(std::move(callback), false /*success*/);
Jacob Dufault0fbed9c02017-11-14 19:22:2498 return;
99 case ForceFailAuth::kDelayed:
100 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
Jacob Dufaultb7a2d842017-12-01 23:21:15101 FROM_HERE,
102 base::BindOnce(&LoginScreenController::OnAuthenticateComplete,
103 weak_factory_.GetWeakPtr(), base::Passed(&callback),
104 false),
Jacob Dufault0fbed9c02017-11-14 19:22:24105 base::TimeDelta::FromSeconds(1));
106 return;
Jacob Dufaulteafc6fe2017-10-11 21:16:52107 }
108
Jacob Dufault8876ba82018-03-27 22:55:43109 // |DoAuthenticateUser| requires the system salt.
110 authentication_stage_ = AuthenticationStage::kGetSystemSalt;
111 chromeos::SystemSaltGetter::Get()->GetSystemSalt(
112 base::AdaptCallbackForRepeating(
113 base::BindOnce(&LoginScreenController::DoAuthenticateUser,
114 weak_factory_.GetWeakPtr(), account_id, password,
115 authenticated_by_pin, std::move(callback))));
xiaoyinh9f6fa0e2017-06-07 19:22:32116}
117
Jacob Dufaultffd9b0d2017-11-15 23:07:16118void LoginScreenController::AttemptUnlock(const AccountId& account_id) {
119 if (!login_screen_client_)
xiaoyinh9f6fa0e2017-06-07 19:22:32120 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16121 login_screen_client_->AttemptUnlock(account_id);
Sarah Hue0e01a52017-10-25 20:29:30122
123 Shell::Get()->metrics()->login_metrics_recorder()->SetAuthMethod(
124 LoginMetricsRecorder::AuthMethod::kSmartlock);
xiaoyinh9f6fa0e2017-06-07 19:22:32125}
126
Jacob Dufaultffd9b0d2017-11-15 23:07:16127void LoginScreenController::HardlockPod(const AccountId& account_id) {
128 if (!login_screen_client_)
xiaoyinh9f6fa0e2017-06-07 19:22:32129 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16130 login_screen_client_->HardlockPod(account_id);
xiaoyinh9f6fa0e2017-06-07 19:22:32131}
132
Jacob Dufaultffd9b0d2017-11-15 23:07:16133void LoginScreenController::RecordClickOnLockIcon(const AccountId& account_id) {
134 if (!login_screen_client_)
xiaoyinh9f6fa0e2017-06-07 19:22:32135 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16136 login_screen_client_->RecordClickOnLockIcon(account_id);
xiaoyinh9f6fa0e2017-06-07 19:22:32137}
138
Jacob Dufaultffd9b0d2017-11-15 23:07:16139void LoginScreenController::OnFocusPod(const AccountId& account_id) {
140 if (!login_screen_client_)
xiaoyinhf534c4f2017-06-13 20:50:27141 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16142 login_screen_client_->OnFocusPod(account_id);
xiaoyinhf534c4f2017-06-13 20:50:27143}
144
Jacob Dufaultffd9b0d2017-11-15 23:07:16145void LoginScreenController::OnNoPodFocused() {
146 if (!login_screen_client_)
xiaoyinhf534c4f2017-06-13 20:50:27147 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16148 login_screen_client_->OnNoPodFocused();
xiaoyinhf534c4f2017-06-13 20:50:27149}
150
Jacob Dufaultffd9b0d2017-11-15 23:07:16151void LoginScreenController::LoadWallpaper(const AccountId& account_id) {
152 if (!login_screen_client_)
xiaoyinhf534c4f2017-06-13 20:50:27153 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16154 login_screen_client_->LoadWallpaper(account_id);
xiaoyinhf534c4f2017-06-13 20:50:27155}
156
Jacob Dufaultffd9b0d2017-11-15 23:07:16157void LoginScreenController::SignOutUser() {
158 if (!login_screen_client_)
xiaoyinhf534c4f2017-06-13 20:50:27159 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16160 login_screen_client_->SignOutUser();
xiaoyinhf534c4f2017-06-13 20:50:27161}
162
Jacob Dufaultffd9b0d2017-11-15 23:07:16163void LoginScreenController::CancelAddUser() {
164 if (!login_screen_client_)
Wenzhao Zang16e7ea722017-09-16 01:27:30165 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16166 login_screen_client_->CancelAddUser();
Wenzhao Zang16e7ea722017-09-16 01:27:30167}
168
Aga Wronska6a32f9872018-01-06 00:16:10169void LoginScreenController::LoginAsGuest() {
170 if (!login_screen_client_)
171 return;
172 login_screen_client_->LoginAsGuest();
173}
174
Jacob Dufaultffd9b0d2017-11-15 23:07:16175void LoginScreenController::OnMaxIncorrectPasswordAttempted(
xiaoyinhf534c4f2017-06-13 20:50:27176 const AccountId& account_id) {
Jacob Dufaultffd9b0d2017-11-15 23:07:16177 if (!login_screen_client_)
xiaoyinhf534c4f2017-06-13 20:50:27178 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16179 login_screen_client_->OnMaxIncorrectPasswordAttempted(account_id);
xiaoyinhf534c4f2017-06-13 20:50:27180}
181
Jacob Dufaultffd9b0d2017-11-15 23:07:16182void LoginScreenController::FocusLockScreenApps(bool reverse) {
183 if (!login_screen_client_)
Toni Barzicf61c4452017-10-05 03:57:48184 return;
Jacob Dufaultffd9b0d2017-11-15 23:07:16185 login_screen_client_->FocusLockScreenApps(reverse);
Toni Barzicf61c4452017-10-05 03:57:48186}
187
Wenzhao Zang767a9f32018-05-02 21:20:55188void LoginScreenController::ShowGaiaSignin(
Jacob Dufaultfb72607d2018-06-12 19:50:33189 bool can_close,
190 const base::Optional<AccountId>& prefilled_account) {
Sarah Hu9fba0e752018-02-07 01:41:09191 if (!login_screen_client_)
192 return;
Jacob Dufaultfb72607d2018-06-12 19:50:33193 login_screen_client_->ShowGaiaSignin(can_close, prefilled_account);
Sarah Hu9fba0e752018-02-07 01:41:09194}
195
Jacob Dufaultfc31c742018-03-20 17:32:19196void LoginScreenController::OnRemoveUserWarningShown() {
197 if (!login_screen_client_)
198 return;
199 login_screen_client_->OnRemoveUserWarningShown();
200}
201
202void LoginScreenController::RemoveUser(const AccountId& account_id) {
203 if (!login_screen_client_)
204 return;
205 login_screen_client_->RemoveUser(account_id);
206}
207
Sarah Hu3fcf9f82018-03-22 20:32:54208void LoginScreenController::LaunchPublicSession(
209 const AccountId& account_id,
210 const std::string& locale,
211 const std::string& input_method) {
212 if (!login_screen_client_)
213 return;
214 login_screen_client_->LaunchPublicSession(account_id, locale, input_method);
215}
216
Sarah Huf9affb122018-04-27 21:36:36217void LoginScreenController::RequestPublicSessionKeyboardLayouts(
218 const AccountId& account_id,
219 const std::string& locale) {
220 if (!login_screen_client_)
221 return;
222 login_screen_client_->RequestPublicSessionKeyboardLayouts(account_id, locale);
223}
224
Sarah Hu0007c932018-06-18 20:21:04225void LoginScreenController::ShowFeedback() {
226 if (!login_screen_client_)
227 return;
228 login_screen_client_->ShowFeedback();
229}
230
Jacob Dufault589d9942018-03-27 20:28:47231void LoginScreenController::AddObserver(
232 LoginScreenControllerObserver* observer) {
233 observers_.AddObserver(observer);
Toni Barzicf61c4452017-10-05 03:57:48234}
235
Jacob Dufault589d9942018-03-27 20:28:47236void LoginScreenController::RemoveObserver(
237 LoginScreenControllerObserver* observer) {
238 observers_.RemoveObserver(observer);
Toni Barzicf61c4452017-10-05 03:57:48239}
240
Jacob Dufaultffd9b0d2017-11-15 23:07:16241void LoginScreenController::FlushForTesting() {
242 login_screen_client_.FlushForTesting();
Toni Barzicf61c4452017-10-05 03:57:48243}
244
Jacob Dufault589d9942018-03-27 20:28:47245void LoginScreenController::SetClient(mojom::LoginScreenClientPtr client) {
246 login_screen_client_ = std::move(client);
247}
248
249void LoginScreenController::ShowLockScreen(ShowLockScreenCallback on_shown) {
250 OnShow();
251 ash::LockScreen::Show(ash::LockScreen::ScreenType::kLock);
252 std::move(on_shown).Run(true);
253}
254
255void LoginScreenController::ShowLoginScreen(ShowLoginScreenCallback on_shown) {
256 // Login screen can only be used during login.
257 if (Shell::Get()->session_controller()->GetSessionState() !=
258 session_manager::SessionState::LOGIN_PRIMARY) {
259 LOG(ERROR) << "Not showing login screen since session state is "
260 << static_cast<int>(
261 Shell::Get()->session_controller()->GetSessionState());
262 std::move(on_shown).Run(false);
263 return;
264 }
265
266 OnShow();
267 // TODO(jdufault): rename ash::LockScreen to ash::LoginScreen.
268 ash::LockScreen::Show(ash::LockScreen::ScreenType::kLogin);
269 std::move(on_shown).Run(true);
270}
271
272void LoginScreenController::ShowErrorMessage(int32_t login_attempts,
273 const std::string& error_text,
274 const std::string& help_link_text,
275 int32_t help_topic_id) {
276 NOTIMPLEMENTED();
277}
278
279void LoginScreenController::ClearErrors() {
280 NOTIMPLEMENTED();
281}
282
283void LoginScreenController::ShowUserPodCustomIcon(
284 const AccountId& account_id,
285 mojom::EasyUnlockIconOptionsPtr icon) {
286 DataDispatcher()->ShowEasyUnlockIcon(account_id, icon);
287}
288
289void LoginScreenController::HideUserPodCustomIcon(const AccountId& account_id) {
290 auto icon_options = mojom::EasyUnlockIconOptions::New();
291 icon_options->icon = mojom::EasyUnlockIconId::NONE;
292 DataDispatcher()->ShowEasyUnlockIcon(account_id, icon_options);
293}
294
295void LoginScreenController::SetAuthType(
296 const AccountId& account_id,
297 proximity_auth::mojom::AuthType auth_type,
298 const base::string16& initial_value) {
299 if (auth_type == proximity_auth::mojom::AuthType::USER_CLICK) {
300 DataDispatcher()->SetClickToUnlockEnabledForUser(account_id,
301 true /*enabled*/);
Wenzhao Zang767a9f32018-05-02 21:20:55302 } else if (auth_type == proximity_auth::mojom::AuthType::ONLINE_SIGN_IN) {
303 DataDispatcher()->SetForceOnlineSignInForUser(account_id);
Jacob Dufault589d9942018-03-27 20:28:47304 } else {
305 NOTIMPLEMENTED();
306 }
307}
308
309void LoginScreenController::LoadUsers(
310 std::vector<mojom::LoginUserInfoPtr> users,
311 bool show_guest) {
312 DCHECK(DataDispatcher());
313
314 DataDispatcher()->NotifyUsers(users);
315}
316
317void LoginScreenController::SetPinEnabledForUser(const AccountId& account_id,
318 bool is_enabled) {
319 // Chrome will update pin pod state every time user tries to authenticate.
320 // LockScreen is destroyed in the case of authentication success.
321 if (DataDispatcher())
322 DataDispatcher()->SetPinEnabledForUser(account_id, is_enabled);
323}
324
Jacob Dufault77d75ce92018-04-13 18:20:09325void LoginScreenController::SetAvatarForUser(const AccountId& account_id,
326 mojom::UserAvatarPtr avatar) {
327 for (auto& observer : observers_)
328 observer.SetAvatarForUser(account_id, avatar);
329}
330
Wenzhao Zange0c2ab22018-05-23 17:43:46331void LoginScreenController::SetAuthEnabledForUser(
332 const AccountId& account_id,
333 bool is_enabled,
334 base::Optional<base::Time> auth_reenabled_time) {
335 if (DataDispatcher()) {
336 DataDispatcher()->SetAuthEnabledForUser(account_id, is_enabled,
337 auth_reenabled_time);
338 }
339}
340
Jacob Dufault589d9942018-03-27 20:28:47341void LoginScreenController::HandleFocusLeavingLockScreenApps(bool reverse) {
342 for (auto& observer : observers_)
343 observer.OnFocusLeavingLockScreenApps(reverse);
344}
345
346void LoginScreenController::SetDevChannelInfo(
347 const std::string& os_version_label_text,
348 const std::string& enterprise_info_text,
349 const std::string& bluetooth_name) {
350 if (DataDispatcher()) {
351 DataDispatcher()->SetDevChannelInfo(os_version_label_text,
352 enterprise_info_text, bluetooth_name);
353 }
354}
355
356void LoginScreenController::IsReadyForPassword(
357 IsReadyForPasswordCallback callback) {
Wenzhao Zang733497282018-06-12 16:53:10358 std::move(callback).Run(LockScreen::HasInstance() &&
Jacob Dufault8876ba82018-03-27 22:55:43359 authentication_stage_ == AuthenticationStage::kIdle);
Jacob Dufault589d9942018-03-27 20:28:47360}
361
362void LoginScreenController::SetPublicSessionDisplayName(
363 const AccountId& account_id,
364 const std::string& display_name) {
365 if (DataDispatcher())
366 DataDispatcher()->SetPublicSessionDisplayName(account_id, display_name);
367}
368
369void LoginScreenController::SetPublicSessionLocales(
370 const AccountId& account_id,
Sarah Hue9cd6132018-05-17 17:25:56371 std::vector<mojom::LocaleItemPtr> locales,
Jacob Dufault589d9942018-03-27 20:28:47372 const std::string& default_locale,
373 bool show_advanced_view) {
374 if (DataDispatcher()) {
375 DataDispatcher()->SetPublicSessionLocales(
Sarah Hue9cd6132018-05-17 17:25:56376 account_id, locales, default_locale, show_advanced_view);
Jacob Dufault589d9942018-03-27 20:28:47377 }
378}
379
Sarah Huf9affb122018-04-27 21:36:36380void LoginScreenController::SetPublicSessionKeyboardLayouts(
381 const AccountId& account_id,
382 const std::string& locale,
383 std::vector<mojom::InputMethodItemPtr> keyboard_layouts) {
384 if (DataDispatcher()) {
385 DataDispatcher()->SetPublicSessionKeyboardLayouts(account_id, locale,
386 keyboard_layouts);
387 }
388}
389
Sarah Hu1a7de562018-05-14 17:18:22390void LoginScreenController::SetFingerprintUnlockState(
391 const AccountId& account_id,
392 mojom::FingerprintUnlockState state) {
393 if (DataDispatcher())
394 DataDispatcher()->SetFingerprintUnlockState(account_id, state);
395}
396
Quan Nguyend09dd112018-06-19 19:20:32397void LoginScreenController::SetKioskApps(
398 std::vector<mojom::KioskAppInfoPtr> kiosk_apps) {
399 Shelf::ForWindow(Shell::Get()->GetPrimaryRootWindow())
400 ->shelf_widget()
401 ->SetLoginKioskApps(std::move(kiosk_apps));
402}
403
404void LoginScreenController::LaunchKioskApp(const std::string& app_id) {
405 login_screen_client_->LaunchKioskApp(app_id);
406}
407
Jacob Dufaultb7a2d842017-12-01 23:21:15408void LoginScreenController::DoAuthenticateUser(const AccountId& account_id,
409 const std::string& password,
410 bool authenticated_by_pin,
411 OnAuthenticateCallback callback,
412 const std::string& system_salt) {
Jacob Dufault8876ba82018-03-27 22:55:43413 authentication_stage_ = AuthenticationStage::kDoAuthenticate;
414
Sarah Hu069eea12017-09-08 01:28:40415 int dummy_value;
416 bool is_pin =
417 authenticated_by_pin && base::StringToInt(password, &dummy_value);
Roman Sorokinc5590012017-09-28 00:48:29418
Sarah Hue0e01a52017-10-25 20:29:30419 Shell::Get()->metrics()->login_metrics_recorder()->SetAuthMethod(
420 is_pin ? LoginMetricsRecorder::AuthMethod::kPin
421 : LoginMetricsRecorder::AuthMethod::kPassword);
Jacob Dufault2be71002018-05-16 17:07:43422
Jacob Dufaultb7a2d842017-12-01 23:21:15423 login_screen_client_->AuthenticateUser(
Jacob Dufault2be71002018-05-16 17:07:43424 account_id, password, is_pin,
Jacob Dufaultb7a2d842017-12-01 23:21:15425 base::BindOnce(&LoginScreenController::OnAuthenticateComplete,
426 weak_factory_.GetWeakPtr(), base::Passed(&callback)));
jdufaulteb4c9f1e2017-06-08 23:08:30427}
428
Jacob Dufaultb7a2d842017-12-01 23:21:15429void LoginScreenController::OnAuthenticateComplete(
430 OnAuthenticateCallback callback,
431 bool success) {
Jacob Dufault8876ba82018-03-27 22:55:43432 authentication_stage_ = AuthenticationStage::kUserCallback;
Jacob Dufaultb7a2d842017-12-01 23:21:15433 std::move(callback).Run(success);
Jacob Dufault8876ba82018-03-27 22:55:43434 authentication_stage_ = AuthenticationStage::kIdle;
xiaoyinh2bbdd102017-05-18 23:29:42435}
436
Jacob Dufaultffd9b0d2017-11-15 23:07:16437LoginDataDispatcher* LoginScreenController::DataDispatcher() const {
Wenzhao Zang733497282018-06-12 16:53:10438 if (!ash::LockScreen::HasInstance())
Jacob Dufault40623d52017-09-15 17:22:53439 return nullptr;
440 return ash::LockScreen::Get()->data_dispatcher();
441}
442
Jacob Dufaultcbc1ee02018-02-28 18:38:54443void LoginScreenController::OnShow() {
444 SetSystemTrayVisibility(SystemTrayVisibility::kPrimary);
Jacob Dufaultc06d6ca2018-04-24 23:49:17445 if (authentication_stage_ != AuthenticationStage::kIdle) {
446 AuthenticationStage authentication_stage = authentication_stage_;
447 base::debug::Alias(&authentication_stage);
448 LOG(FATAL) << "Unexpected authentication stage "
449 << static_cast<int>(authentication_stage_);
450 }
Jacob Dufaultcbc1ee02018-02-28 18:38:54451}
452
xiaoyinh2bbdd102017-05-18 23:29:42453} // namespace ash