| 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 15 matching lines...) Expand all Loading... |
| 26 // Binds the mojom::LockScreen interface to this object. | 26 // Binds the mojom::LockScreen interface to this object. |
| 27 void BindRequest(mojom::LockScreenRequest request); | 27 void BindRequest(mojom::LockScreenRequest request); |
| 28 | 28 |
| 29 // mojom::LockScreen: | 29 // mojom::LockScreen: |
| 30 void SetClient(mojom::LockScreenClientPtr client) override; | 30 void SetClient(mojom::LockScreenClientPtr client) override; |
| 31 void ShowErrorMessage(int32_t login_attempts, | 31 void ShowErrorMessage(int32_t login_attempts, |
| 32 const std::string& error_text, | 32 const std::string& error_text, |
| 33 const std::string& help_link_text, | 33 const std::string& help_link_text, |
| 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, |
| 37 mojom::UserPodCustomIconOptionsPtr icon) override; |
| 38 void HideUserPodCustomIcon(const AccountId& account_id) override; |
| 39 void SetAuthType(const AccountId& account_id, |
| 40 mojom::AuthType auth_type, |
| 41 const base::string16& initial_value) override; |
| 42 void LoadUsers(std::unique_ptr<base::ListValue> users, |
| 43 bool show_guest) override; |
| 36 | 44 |
| 37 // Wrappers around the mojom::SystemTrayClient interface. | 45 // Wrappers around the mojom::LockScreenClient interface. |
| 38 // Hash the password and send AuthenticateUser request to LockScreenClient. | 46 // Hash the password and send AuthenticateUser request to LockScreenClient. |
| 39 // LockScreenClient(chrome) will do the authentication and request to show | 47 // LockScreenClient(chrome) will do the authentication and request to show |
| 40 // error messages in the lock screen if auth fails, or request to clear | 48 // error messages in the lock screen if auth fails, or request to clear |
| 41 // errors if auth succeeds. | 49 // errors if auth succeeds. |
| 42 void AuthenticateUser(const AccountId& account_id, | 50 void AuthenticateUser(const AccountId& account_id, |
| 43 const std::string& password, | 51 const std::string& password, |
| 44 bool authenticated_by_pin); | 52 bool authenticated_by_pin); |
| 53 void AttemptUnlock(const AccountId& account_id); |
| 54 void HardlockPod(const AccountId& account_id); |
| 55 void RecordClickOnLockIcon(const AccountId& account_id); |
| 45 | 56 |
| 46 private: | 57 private: |
| 47 void DoAuthenticateUser(const AccountId& account_id, | 58 void DoAuthenticateUser(const AccountId& account_id, |
| 48 const std::string& password, | 59 const std::string& password, |
| 49 bool authenticated_by_pin, | 60 bool authenticated_by_pin, |
| 50 const std::string& system_salt); | 61 const std::string& system_salt); |
| 51 | 62 |
| 52 // Client interface in chrome browser. May be null in tests. | 63 // Client interface in chrome browser. May be null in tests. |
| 53 mojom::LockScreenClientPtr lock_screen_client_; | 64 mojom::LockScreenClientPtr lock_screen_client_; |
| 54 | 65 |
| 55 // Bindings for the LockScreen interface. | 66 // Bindings for the LockScreen interface. |
| 56 mojo::BindingSet<mojom::LockScreen> bindings_; | 67 mojo::BindingSet<mojom::LockScreen> bindings_; |
| 57 | 68 |
| 58 DISALLOW_COPY_AND_ASSIGN(LockScreenController); | 69 DISALLOW_COPY_AND_ASSIGN(LockScreenController); |
| 59 }; | 70 }; |
| 60 | 71 |
| 61 } // namspace ash | 72 } // namspace ash |
| 62 | 73 |
| 63 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ | 74 #endif // ASH_LOGIN_LOCK_SCREEN_CONTROLLER_H_ |
| OLD | NEW |