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/string16.mojom"; | |
| 9 import "mojo/common/values.mojom"; | |
| 10 | |
| 11 // Supported authentication types. Keep in sync with enum in | |
| 12 // screenlock_bridge.h | |
| 13 enum AuthType { | |
| 14 OFFLINE_PASSWORD, | |
| 15 ONLINE_SIGN_IN, | |
| 16 NUMERIC_PIN, | |
| 17 USER_CLICK, | |
| 18 EXPAND_THEN_USER_CLICK, | |
| 19 FORCE_OFFLINE_PASSWORD, | |
| 20 }; | |
| 21 | |
| 22 // Information about the custom icon in the user pod. | |
| 23 struct UserPodCustomIconOptions { | |
| 24 string id; | |
| 25 mojo.common.mojom.String16 tooltip; | |
| 26 bool autoshow_tooltip; | |
| 27 mojo.common.mojom.String16 aria_label; | |
| 28 bool hardlock_on_click; | |
| 29 bool is_trial_run; | |
| 30 }; | |
| 8 | 31 |
| 9 // Allows clients (e.g. Chrome browser) to control the ash lock screen. | 32 // Allows clients (e.g. Chrome browser) to control the ash lock screen. |
| 10 interface LockScreen { | 33 interface LockScreen { |
| 11 // Sets the client interface. | 34 // Sets the client interface. |
| 12 SetClient(LockScreenClient client); | 35 SetClient(LockScreenClient client); |
| 13 | 36 |
| 14 // Requests to show error message in the ash lock screen. | 37 // Requests to show error message in the ash lock screen. |
| 15 // TODO(xiaoyinh): login_attempts is probabaly not needed from chrome, | 38 // 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. | 39 // remove it when we start to count the login attempts in ash lock screen. |
| 17 // |login_attempts|: The number of the login authentication attempts. | 40 // |login_attempts|: The number of the login authentication attempts. |
| 18 // |error_text|: The error text to be shown in lock screen. | 41 // |error_text|: The error text to be shown in lock screen. |
| 19 // |help_link_text|: The help link to be shown in lock screen. | 42 // |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. | 43 // |help_topic_id|: The id of the help app topic regarding this error. |
| 21 ShowErrorMessage(int32 login_attempts, | 44 ShowErrorMessage(int32 login_attempts, |
| 22 string error_text, | 45 string error_text, |
| 23 string help_link_text, | 46 string help_link_text, |
| 24 int32 help_topic_id); | 47 int32 help_topic_id); |
| 25 | 48 |
| 26 // Requests to close any displayed error messages in ash lock screen. | 49 // Requests to close any displayed error messages in ash lock screen. |
| 27 ClearErrors(); | 50 ClearErrors(); |
| 51 | |
| 52 // Requests to show the custom icon in the user pod. | |
| 53 // |account_id|: The account id of the user in the user pod. | |
| 54 // |icon|: Information regarding the icon. | |
| 55 ShowUserPodCustomIcon(signin.mojom.AccountId account_id, | |
| 56 UserPodCustomIconOptions icon); | |
| 57 | |
| 58 // Requests to hide the custom icon in the user pod. | |
| 59 // |account_id|: The account id of the user in the user pod. | |
| 60 HideUserPodCustomIcon(signin.mojom.AccountId account_id); | |
| 61 | |
| 62 // Requests to set the authentication type. | |
| 63 // |account_id|: The account id of the user in the user pod. | |
| 64 // |auth_type|: Authentication type. | |
| 65 // |initial_value|: A message shown in the password field of the user pod. | |
| 66 SetAuthType(signin.mojom.AccountId account_id, | |
| 67 AuthType auth_type, | |
| 68 mojo.common.mojom.String16 initial_value); | |
| 69 | |
| 70 // Requests to load users in the lock screen. | |
| 71 // TODO: create a mojo struct for |users|, this contains user information | |
|
jdufault
2017/06/03 01:00:45
Please file a bug and reference it here.
xiaoyinh(OOO Sep 11-29)
2017/06/06 16:36:04
Done.
| |
| 72 // for login/lock screen, some of which might not be needed for the new | |
| 73 // view-based UI. | |
| 74 // |users|: A list of users who can unlock the device. | |
| 75 // |show_guest|: Whether to show guest session button. | |
| 76 LoadUsers(mojo.common.mojom.ListValue users, bool show_guest); | |
| 28 }; | 77 }; |
| 29 | 78 |
| 30 // Allows ash lock screen to control a client (e.g. Chrome browser). Requests | 79 // 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. | 80 // often involve preferences or talk to cryptohome that is not available to ash. |
| 32 interface LockScreenClient { | 81 interface LockScreenClient { |
| 33 // Request user authentication in chrome. | 82 // Request user authentication in chrome. |
| 34 // If auth succeeds: | 83 // If auth succeeds: |
| 35 // chrome will hide the lock screen and clear any displayed error messages. | 84 // chrome will hide the lock screen and clear any displayed error messages. |
| 36 // If auth fails: | 85 // If auth fails: |
| 37 // chrome will request lock screen to show error messages. | 86 // chrome will request lock screen to show error messages. |
| 38 // |account_id|: The account id of the user we are authenticating. | 87 // |account_id|: The account id of the user we are authenticating. |
| 39 // |hashed_password|: The hashed password of the user. | 88 // |hashed_password|: The hashed password of the user. |
| 40 // |authenticated_by_pin|: True if we are using pin to authenticate. | 89 // |authenticated_by_pin|: True if we are using pin to authenticate. |
| 41 AuthenticateUser(signin.mojom.AccountId account_id, | 90 AuthenticateUser(signin.mojom.AccountId account_id, |
| 42 string hashed_password, | 91 string hashed_password, |
| 43 bool authenticated_by_pin); | 92 bool authenticated_by_pin); |
| 93 | |
| 94 // Request to attempt easy unlock in chrome. | |
| 95 // |account_id|: The account id of the user we are authenticating. | |
| 96 AttemptUnlock(signin.mojom.AccountId account_id); | |
| 97 | |
| 98 // Request to hard lock the user pod. | |
| 99 // |account_id|: The account id of the user in the user pod. | |
| 100 HardlockPod(signin.mojom.AccountId account_id); | |
| 101 | |
| 102 // Record clicks on the lock icon in the user pod. | |
| 103 // |account_id|: The account id of the user in the user pod. | |
| 104 RecordClickOnLockIcon(signin.mojom.AccountId account_id); | |
| 44 }; | 105 }; |
| OLD | NEW |