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 26 matching lines...) Expand all Loading... |
37 int32_t help_topic_id) override; | 37 int32_t help_topic_id) override; |
38 void ClearErrors() override; | 38 void ClearErrors() override; |
39 void ShowUserPodCustomIcon(const AccountId& account_id, | 39 void ShowUserPodCustomIcon(const AccountId& account_id, |
40 mojom::UserPodCustomIconOptionsPtr icon) override; | 40 mojom::UserPodCustomIconOptionsPtr icon) override; |
41 void HideUserPodCustomIcon(const AccountId& account_id) override; | 41 void HideUserPodCustomIcon(const AccountId& account_id) override; |
42 void SetAuthType(const AccountId& account_id, | 42 void SetAuthType(const AccountId& account_id, |
43 mojom::AuthType auth_type, | 43 mojom::AuthType auth_type, |
44 const base::string16& initial_value) override; | 44 const base::string16& initial_value) override; |
45 void LoadUsers(std::unique_ptr<base::ListValue> users, | 45 void LoadUsers(std::unique_ptr<base::ListValue> users, |
46 bool show_guest) override; | 46 bool show_guest) override; |
| 47 void SetPinEnabledForUser(const AccountId& account_id, |
| 48 bool is_enabled) override; |
47 | 49 |
48 // Wrappers around the mojom::LockScreenClient interface. | 50 // Wrappers around the mojom::LockScreenClient interface. |
49 // Hash the password and send AuthenticateUser request to LockScreenClient. | 51 // Hash the password and send AuthenticateUser request to LockScreenClient. |
50 // LockScreenClient(chrome) will do the authentication and request to show | 52 // LockScreenClient(chrome) will do the authentication and request to show |
51 // error messages in the lock screen if auth fails, or request to clear | 53 // error messages in the lock screen if auth fails, or request to clear |
52 // errors if auth succeeds. | 54 // errors if auth succeeds. |
53 void AuthenticateUser( | 55 void AuthenticateUser( |
54 const AccountId& account_id, | 56 const AccountId& account_id, |
55 const std::string& password, | 57 const std::string& password, |
56 bool authenticated_by_pin, | 58 bool authenticated_by_pin, |
57 mojom::LockScreenClient::AuthenticateUserCallback callback); | 59 mojom::LockScreenClient::AuthenticateUserCallback callback); |
58 void AttemptUnlock(const AccountId& account_id); | 60 void AttemptUnlock(const AccountId& account_id); |
59 void HardlockPod(const AccountId& account_id); | 61 void HardlockPod(const AccountId& account_id); |
60 void RecordClickOnLockIcon(const AccountId& account_id); | 62 void RecordClickOnLockIcon(const AccountId& account_id); |
| 63 void OnFocusPod(const AccountId& account_id); |
| 64 void OnNoPodFocused(); |
| 65 void LoadWallpaper(const AccountId& account_id); |
| 66 void SignOutUser(); |
| 67 void OnMaxIncorrectPasswordAttempted(const AccountId& account_id); |
61 | 68 |
62 private: | 69 private: |
63 using PendingAuthenticateUserCall = | 70 using PendingAuthenticateUserCall = |
64 base::OnceCallback<void(const std::string& system_salt)>; | 71 base::OnceCallback<void(const std::string& system_salt)>; |
65 | 72 |
66 void DoAuthenticateUser( | 73 void DoAuthenticateUser( |
67 const AccountId& account_id, | 74 const AccountId& account_id, |
68 const std::string& password, | 75 const std::string& password, |
69 bool authenticated_by_pin, | 76 bool authenticated_by_pin, |
70 mojom::LockScreenClient::AuthenticateUserCallback callback, | 77 mojom::LockScreenClient::AuthenticateUserCallback callback, |
71 const std::string& system_salt); | 78 const std::string& system_salt); |
72 | 79 |
73 void OnGetSystemSalt(const std::string& system_salt); | 80 void OnGetSystemSalt(const std::string& system_salt); |
74 | 81 |
75 // Client interface in chrome browser. May be null in tests. | 82 // Client interface in chrome browser. May be null in tests. |
76 mojom::LockScreenClientPtr lock_screen_client_; | 83 mojom::LockScreenClientPtr lock_screen_client_; |
77 | 84 |
78 // Bindings for the LockScreen interface. | 85 // Bindings for the LockScreen interface. |
79 mojo::BindingSet<mojom::LockScreen> bindings_; | 86 mojo::BindingSet<mojom::LockScreen> bindings_; |
80 | 87 |
81 // User authentication call that will run when we have system salt. | 88 // User authentication call that will run when we have system salt. |
82 PendingAuthenticateUserCall pending_user_auth_; | 89 PendingAuthenticateUserCall pending_user_auth_; |
83 | 90 |
84 DISALLOW_COPY_AND_ASSIGN(LockScreenController); | 91 DISALLOW_COPY_AND_ASSIGN(LockScreenController); |
85 }; | 92 }; |
86 | 93 |
87 } // namespace ash | 94 } // namespace ash |
88 | 95 |
89 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ | 96 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ |
OLD | NEW |