[go: nahoru, domu]

Adding mojo calls for several lock screen related operations.

This CL does the following:
1. Adding Mojo calls to:
  a. Notify chrome when user pod is focused/no user pod is focused,
     and when user has reached maximum incorrect password attempts.
  b. Send request to chrome to load wallpaper and sign out current user.
  c. Notify lockscreen views when pin unlock is enabled/disabled.
2. Move common helper functions out of SignInScreenHandler into
lock_screen_utils so both WebUI handlers and Views based handlers
(ViewsScreenLocker) can use.

BUG=721524

Review-Url: https://codereview.chromium.org/2923773003
Cr-Commit-Position: refs/heads/master@{#479142}
diff --git a/ash/login/lock_screen_controller.cc b/ash/login/lock_screen_controller.cc
index dd5a085..5f863dc 100644
--- a/ash/login/lock_screen_controller.cc
+++ b/ash/login/lock_screen_controller.cc
@@ -59,6 +59,11 @@
   NOTIMPLEMENTED();
 }
 
+void LockScreenController::SetPinEnabledForUser(const AccountId& account_id,
+                                                bool is_enabled) {
+  NOTIMPLEMENTED();
+}
+
 void LockScreenController::AuthenticateUser(
     const AccountId& account_id,
     const std::string& password,
@@ -97,6 +102,37 @@
   lock_screen_client_->RecordClickOnLockIcon(account_id);
 }
 
+void LockScreenController::OnFocusPod(const AccountId& account_id) {
+  if (!lock_screen_client_)
+    return;
+  lock_screen_client_->OnFocusPod(account_id);
+}
+
+void LockScreenController::OnNoPodFocused() {
+  if (!lock_screen_client_)
+    return;
+  lock_screen_client_->OnNoPodFocused();
+}
+
+void LockScreenController::LoadWallpaper(const AccountId& account_id) {
+  if (!lock_screen_client_)
+    return;
+  lock_screen_client_->LoadWallpaper(account_id);
+}
+
+void LockScreenController::SignOutUser() {
+  if (!lock_screen_client_)
+    return;
+  lock_screen_client_->SignOutUser();
+}
+
+void LockScreenController::OnMaxIncorrectPasswordAttempted(
+    const AccountId& account_id) {
+  if (!lock_screen_client_)
+    return;
+  lock_screen_client_->OnMaxIncorrectPasswordAttempted(account_id);
+}
+
 void LockScreenController::DoAuthenticateUser(
     const AccountId& account_id,
     const std::string& password,