| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ | 5 #ifndef ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ |
| 6 #define ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ | 6 #define ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/public/interfaces/lock_screen.mojom.h" | 9 #include "ash/public/interfaces/lock_screen.mojom.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 int32_t help_topic_id) override; | 34 int32_t help_topic_id) override; |
| 35 void ClearErrors() override; | 35 void ClearErrors() override; |
| 36 void ShowUserPodCustomIcon(const AccountId& account_id, | 36 void ShowUserPodCustomIcon(const AccountId& account_id, |
| 37 mojom::UserPodCustomIconOptionsPtr icon) override; | 37 mojom::UserPodCustomIconOptionsPtr icon) override; |
| 38 void HideUserPodCustomIcon(const AccountId& account_id) override; | 38 void HideUserPodCustomIcon(const AccountId& account_id) override; |
| 39 void SetAuthType(const AccountId& account_id, | 39 void SetAuthType(const AccountId& account_id, |
| 40 mojom::AuthType auth_type, | 40 mojom::AuthType auth_type, |
| 41 const base::string16& initial_value) override; | 41 const base::string16& initial_value) override; |
| 42 void LoadUsers(std::unique_ptr<base::ListValue> users, | 42 void LoadUsers(std::unique_ptr<base::ListValue> users, |
| 43 bool show_guest) override; | 43 bool show_guest) override; |
| 44 void SetPinEnabledForUser(const AccountId& account_id, |
| 45 bool is_enabled) override; |
| 44 | 46 |
| 45 // Wrappers around the mojom::LockScreenClient interface. | 47 // Wrappers around the mojom::LockScreenClient interface. |
| 46 // Hash the password and send AuthenticateUser request to LockScreenClient. | 48 // Hash the password and send AuthenticateUser request to LockScreenClient. |
| 47 // LockScreenClient(chrome) will do the authentication and request to show | 49 // LockScreenClient(chrome) will do the authentication and request to show |
| 48 // error messages in the lock screen if auth fails, or request to clear | 50 // error messages in the lock screen if auth fails, or request to clear |
| 49 // errors if auth succeeds. | 51 // errors if auth succeeds. |
| 50 void AuthenticateUser(const AccountId& account_id, | 52 void AuthenticateUser(const AccountId& account_id, |
| 51 const std::string& password, | 53 const std::string& password, |
| 52 bool authenticated_by_pin); | 54 bool authenticated_by_pin); |
| 53 void AttemptUnlock(const AccountId& account_id); | 55 void AttemptUnlock(const AccountId& account_id); |
| 54 void HardlockPod(const AccountId& account_id); | 56 void HardlockPod(const AccountId& account_id); |
| 55 void RecordClickOnLockIcon(const AccountId& account_id); | 57 void RecordClickOnLockIcon(const AccountId& account_id); |
| 58 void FocusPod(const AccountId& account_id); |
| 59 void NoPodFocused(); |
| 60 void LoadWallpaper(const AccountId& account_id); |
| 61 void SignOutUser(); |
| 62 void MaxIncorrectPasswordAttempts(const AccountId& account_id); |
| 56 | 63 |
| 57 private: | 64 private: |
| 58 void DoAuthenticateUser(const AccountId& account_id, | 65 void DoAuthenticateUser(const AccountId& account_id, |
| 59 const std::string& password, | 66 const std::string& password, |
| 60 bool authenticated_by_pin, | 67 bool authenticated_by_pin, |
| 61 const std::string& system_salt); | 68 const std::string& system_salt); |
| 62 | 69 |
| 63 // Client interface in chrome browser. May be null in tests. | 70 // Client interface in chrome browser. May be null in tests. |
| 64 mojom::LockScreenClientPtr lock_screen_client_; | 71 mojom::LockScreenClientPtr lock_screen_client_; |
| 65 | 72 |
| 66 // Bindings for the LockScreen interface. | 73 // Bindings for the LockScreen interface. |
| 67 mojo::BindingSet<mojom::LockScreen> bindings_; | 74 mojo::BindingSet<mojom::LockScreen> bindings_; |
| 68 | 75 |
| 69 DISALLOW_COPY_AND_ASSIGN(LockScreenController); | 76 DISALLOW_COPY_AND_ASSIGN(LockScreenController); |
| 70 }; | 77 }; |
| 71 | 78 |
| 72 } // namspace ash | 79 } // namspace ash |
| 73 | 80 |
| 74 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ | 81 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ |
| OLD | NEW |