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 | 8 |
9 // Allows clients (e.g. Chrome browser) to control the ash lock screen. | 9 // Allows clients (e.g. Chrome browser) to control the ash lock screen. |
10 interface LockScreen { | 10 interface LockScreen { |
11 // Sets the client interface. | 11 // Sets the client interface. |
12 SetClient(LockScreenClient client); | 12 SetClient(LockScreenClient client); |
13 | 13 |
| 14 // Displays the lock screen. |did_show| is true iff the lock UI was |
| 15 // successfully displayed. |
| 16 ShowLockScreen() => (bool did_show); |
| 17 |
14 // Requests to show error message in the ash lock screen. | 18 // Requests to show error message in the ash lock screen. |
15 // TODO(xiaoyinh): login_attempts is probabaly not needed from chrome, | 19 // 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. | 20 // remove it when we start to count the login attempts in ash lock screen. |
17 // |login_attempts|: The number of the login authentication attempts. | 21 // |login_attempts|: The number of the login authentication attempts. |
18 // |error_text|: The error text to be shown in lock screen. | 22 // |error_text|: The error text to be shown in lock screen. |
19 // |help_link_text|: The help link to be shown in lock screen. | 23 // |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. | 24 // |help_topic_id|: The id of the help app topic regarding this error. |
21 ShowErrorMessage(int32 login_attempts, | 25 ShowErrorMessage(int32 login_attempts, |
22 string error_text, | 26 string error_text, |
23 string help_link_text, | 27 string help_link_text, |
24 int32 help_topic_id); | 28 int32 help_topic_id); |
25 | 29 |
26 // Requests to close any displayed error messages in ash lock screen. | 30 // Requests to close any displayed error messages in ash lock screen. |
27 ClearErrors(); | 31 ClearErrors(); |
28 }; | 32 }; |
29 | 33 |
30 // Allows ash lock screen to control a client (e.g. Chrome browser). Requests | 34 // 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. | 35 // often involve preferences or talk to cryptohome that is not available to ash. |
32 interface LockScreenClient { | 36 interface LockScreenClient { |
33 // Request user authentication in chrome. | 37 // Request user authentication in chrome. |
34 // If auth succeeds: | 38 // If auth succeeds: |
35 // chrome will hide the lock screen and clear any displayed error messages. | 39 // chrome will hide the lock screen and clear any displayed error messages. |
36 // If auth fails: | 40 // If auth fails: |
37 // chrome will request lock screen to show error messages. | 41 // chrome will request lock screen to show error messages. |
38 // |account_id|: The account id of the user we are authenticating. | 42 // |account_id|: The account id of the user we are authenticating. |
39 // |hashed_password|: The hashed password of the user. | 43 // |hashed_password|: The hashed password of the user. |
40 // |authenticated_by_pin|: True if we are using pin to authenticate. | 44 // |authenticated_by_pin|: True if we are using pin to authenticate. |
| 45 // |
| 46 // The result will be set to true if auth was successful, false if not. |
41 AuthenticateUser(signin.mojom.AccountId account_id, | 47 AuthenticateUser(signin.mojom.AccountId account_id, |
42 string hashed_password, | 48 string hashed_password, |
43 » bool authenticated_by_pin); | 49 bool authenticated_by_pin) => (bool auth_success); |
44 }; | 50 }; |
OLD | NEW |