Chromium Code Reviews| 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 module ash.mojom; | 5 module ash.mojom; |
| 6 | 6 |
| 7 import "components/signin/public/interfaces/account_id.mojom"; | 7 import "components/signin/public/interfaces/account_id.mojom"; |
| 8 import "mojo/common/values.mojom"; | |
| 8 | 9 |
| 9 // Allows clients (e.g. Chrome browser) to control the ash lock screen. | 10 // Allows clients (e.g. Chrome browser) to control the ash lock screen. |
| 10 interface LockScreen { | 11 interface LockScreen { |
| 11 // Sets the client interface. | 12 // Sets the client interface. |
| 12 SetClient(LockScreenClient client); | 13 SetClient(LockScreenClient client); |
| 13 | 14 |
| 14 // Requests to show error message in the ash lock screen. | 15 // Requests to show error message in the ash lock screen. |
| 15 // TODO(xiaoyinh): login_attempts is probabaly not needed from chrome, | 16 // TODO(xiaoyinh): login_attempts is probabaly not needed from chrome, |
| 16 // remove it when we start to count the login attempts in ash lock screen. | 17 // remove it when we start to count the login attempts in ash lock screen. |
| 17 // |login_attempts|: The number of the login authentication attempts. | 18 // |login_attempts|: The number of the login authentication attempts. |
| 18 // |error_text|: The error text to be shown in lock screen. | 19 // |error_text|: The error text to be shown in lock screen. |
| 19 // |help_link_text|: The help link to be shown in lock screen. | 20 // |help_link_text|: The help link to be shown in lock screen. |
| 20 // |help_topic_id|: The id of the help app topic regarding this error. | 21 // |help_topic_id|: The id of the help app topic regarding this error. |
| 21 ShowErrorMessage(int32 login_attempts, | 22 ShowErrorMessage(int32 login_attempts, |
| 22 string error_text, | 23 string error_text, |
| 23 string help_link_text, | 24 string help_link_text, |
| 24 int32 help_topic_id); | 25 int32 help_topic_id); |
| 25 | 26 |
| 26 // Requests to close any displayed error messages in ash lock screen. | 27 // Requests to close any displayed error messages in ash lock screen. |
| 27 ClearErrors(); | 28 ClearErrors(); |
| 29 | |
| 30 // Requests to show the custom icon in the user pod. | |
| 31 // |account_id|: The account id of the user in the user pod. | |
| 32 // |icon|: Information regarding the icon. | |
| 33 ShowUserPodCustomIcon(signin.mojom.AccountId account_id, | |
| 34 mojo.common.mojom.DictionaryValue icon); | |
|
xiyuan
2017/05/31 17:51:18
Can we create mojo struct for ScreenlockBridge::Us
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:28
Done.
| |
| 35 | |
| 36 // Requests to hide the custom icon in the user pod. | |
| 37 // |account_id|: The account id of the user in the user pod. | |
| 38 HideUserPodCustomIcon(signin.mojom.AccountId account_id); | |
| 39 | |
| 40 // Requests to set the authentication type. | |
| 41 // |account_id|: The account id of the user in the user pod. | |
| 42 // |auth_type|: Authentication type. | |
| 43 // |initial_value|: A message shown in the password field of the user pod. | |
| 44 SetAuthType(signin.mojom.AccountId account_id, | |
| 45 int32 auth_type, | |
|
xiyuan
2017/05/31 17:51:18
Create a mojo enum and use it here?
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:28
Done.
| |
| 46 string initial_value); | |
| 47 | |
| 48 // Requests to load users in the lock screen. | |
| 49 // |users|: A list of users who can unlock the device. | |
| 50 // |show_guest|: Whether to show guest session button. | |
| 51 LoadUsers(mojo.common.mojom.ListValue users, bool show_guest); | |
|
xiyuan
2017/05/31 17:51:18
Similar here, prefer to have a array<some_struct>
jdufault
2017/05/31 22:54:00
ie, ash.mojom.UserInfo
xiaoyinh(OOO Sep 11-29)
2017/06/02 23:42:28
Thanks for the suggestion. Each user in |users| ha
| |
| 28 }; | 52 }; |
| 29 | 53 |
| 30 // Allows ash lock screen to control a client (e.g. Chrome browser). Requests | 54 // Allows ash lock screen to control a client (e.g. Chrome browser). Requests |
| 31 // often involve preferences or talk to cryptohome that is not available to ash. | 55 // often involve preferences or talk to cryptohome that is not available to ash. |
| 32 interface LockScreenClient { | 56 interface LockScreenClient { |
| 33 // Request user authentication in chrome. | 57 // Request user authentication in chrome. |
| 34 // If auth succeeds: | 58 // If auth succeeds: |
| 35 // chrome will hide the lock screen and clear any displayed error messages. | 59 // chrome will hide the lock screen and clear any displayed error messages. |
| 36 // If auth fails: | 60 // If auth fails: |
| 37 // chrome will request lock screen to show error messages. | 61 // chrome will request lock screen to show error messages. |
| 38 // |account_id|: The account id of the user we are authenticating. | 62 // |account_id|: The account id of the user we are authenticating. |
| 39 // |hashed_password|: The hashed password of the user. | 63 // |hashed_password|: The hashed password of the user. |
| 40 // |authenticated_by_pin|: True if we are using pin to authenticate. | 64 // |authenticated_by_pin|: True if we are using pin to authenticate. |
| 41 AuthenticateUser(signin.mojom.AccountId account_id, | 65 AuthenticateUser(signin.mojom.AccountId account_id, |
| 42 string hashed_password, | 66 string hashed_password, |
| 43 bool authenticated_by_pin); | 67 bool authenticated_by_pin); |
| 68 | |
| 69 // Request to attempt easy unlock in chrome. | |
| 70 // |account_id|: The account id of the user we are authenticating. | |
| 71 AttemptUnlock(signin.mojom.AccountId account_id); | |
| 72 | |
| 73 // Request to hard lock the user pod. | |
| 74 // |account_id|: The account id of the user in the user pod. | |
| 75 HardlockPod(signin.mojom.AccountId account_id); | |
| 76 | |
| 77 // Record clicks on the lock icon in the user pod. | |
| 78 // |account_id|: The account id of the user in the user pod. | |
| 79 RecordClickOnLockIcon(signin.mojom.AccountId account_id); | |
| 44 }; | 80 }; |
| OLD | NEW |