| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Control and monitor the screen locker. | 5 // Control and monitor the screen locker. |
| 6 [permissions=screenlockPrivate, nodoc] | 6 [permissions=screenlockPrivate, nodoc] |
| 7 namespace screenlockPrivate { | 7 namespace screenlockPrivate { |
| 8 // Supported authentication types shown on the user pod. | 8 // Supported authentication types shown on the user pod. |
| 9 // |offlinePassword|: The standard password field, which authenticates using | 9 // |offlinePassword|: The standard password field, which authenticates using |
| 10 // the user's regular password. The $(ref:onAuthAttempted)() | 10 // the user's regular password. The $(ref:onAuthAttempted)() |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Returns true if the screen is currently locked, false otherwise. | 23 // Returns true if the screen is currently locked, false otherwise. |
| 24 static void getLocked(BooleanCallback callback); | 24 static void getLocked(BooleanCallback callback); |
| 25 | 25 |
| 26 // Set <code>locked=true</code> to lock the screen, | 26 // Set <code>locked=true</code> to lock the screen, |
| 27 // <code>locked=false</code> to unlock it. | 27 // <code>locked=false</code> to unlock it. |
| 28 static void setLocked(boolean locked); | 28 static void setLocked(boolean locked); |
| 29 | 29 |
| 30 // Show a message to the user on the unlock UI if the screen is locked. | 30 // Show a message to the user on the unlock UI if the screen is locked. |
| 31 static void showMessage(DOMString message); | 31 static void showMessage(DOMString message); |
| 32 | 32 |
| 33 // Show a Button, an icon beside the input field on the user pod. | 33 // Show a custom icon beside the input field on the user pod. |
| 34 // |icon|: An extension resource of the icon image. | 34 // |icon|: An extension resource of the icon image. |
| 35 static void showButton(DOMString icon); | 35 static void showCustomIcon(DOMString icon); |
| 36 | 36 |
| 37 // Hides the button added by $(ref:showButton)(). | 37 // Hides the custom icon added by $(ref:showCustomIcon)(). |
| 38 static void hideButton(); | 38 static void hideCustomIcon(); |
| 39 | 39 |
| 40 // Returns the current auth type used for the user pod. | 40 // Returns the current auth type used for the user pod. |
| 41 static void getAuthType(AuthTypeCallback callback); | 41 static void getAuthType(AuthTypeCallback callback); |
| 42 | 42 |
| 43 // Set the type of the authentication for the user pod. The input field | 43 // Set the type of the authentication for the user pod. The input field |
| 44 // area of the user pod below the user's portrait will be changed. | 44 // area of the user pod below the user's portrait will be changed. |
| 45 // |authType|: The type of authentication to use. | 45 // |authType|: The type of authentication to use. |
| 46 // |initialValue|: The initial value to populate the input field. | 46 // |initialValue|: The initial value to populate the input field. |
| 47 static void setAuthType(AuthType authType, optional DOMString initialValue); | 47 static void setAuthType(AuthType authType, optional DOMString initialValue); |
| 48 | 48 |
| 49 // Accepts or rejects the current auth attempt. | 49 // Accepts or rejects the current auth attempt. |
| 50 static void acceptAuthAttempt(boolean accept); | 50 static void acceptAuthAttempt(boolean accept); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 interface Events { | 53 interface Events { |
| 54 // Fires whenever the screen is locked or unlocked. | 54 // Fires whenever the screen is locked or unlocked. |
| 55 static void onChanged(boolean locked); | 55 static void onChanged(boolean locked); |
| 56 | 56 |
| 57 // Fires when the user clicks on the Button shown by $(ref:showButton)(). | |
| 58 static void onButtonClicked(); | |
| 59 | |
| 60 // Fires when the user attempts to authenticate with the user's input. | 57 // Fires when the user attempts to authenticate with the user's input. |
| 61 // There will be at most one auth attempt active at any time. | 58 // There will be at most one auth attempt active at any time. |
| 62 // Call $(ref:acceptAuthAttempt)() to accept or reject this attempt. | 59 // Call $(ref:acceptAuthAttempt)() to accept or reject this attempt. |
| 63 // Note: Some authentication types will not have an input. | 60 // Note: Some authentication types will not have an input. |
| 64 static void onAuthAttempted(AuthType type, DOMString input); | 61 static void onAuthAttempted(AuthType type, DOMString input); |
| 65 }; | 62 }; |
| 66 }; | 63 }; |
| OLD | NEW |