Chromium Code Reviews| Index: chrome/common/extensions/api/quick_unlock_private.idl |
| diff --git a/chrome/common/extensions/api/quick_unlock_private.idl b/chrome/common/extensions/api/quick_unlock_private.idl |
| index c3121beffcaf4e61c5d7148737a66a8e72b6f317..d07a27b542a7253b6e5c9d38a58e6e06e09ec865 100644 |
| --- a/chrome/common/extensions/api/quick_unlock_private.idl |
| +++ b/chrome/common/extensions/api/quick_unlock_private.idl |
| @@ -19,8 +19,30 @@ namespace quickUnlockPrivate { |
| PIN |
| }; |
| + // The problems a given PIN might have. |
| + enum CredentialProblem { |
| + TOO_SHORT, |
| + TOO_LONG, |
| + TOO_WEAK, |
| + CONTAINS_NONDIGIT |
| + }; |
| + |
| + dictionary CredentialCheck { |
| + // The given PINs errors. Users cannot proceed with an error. |
| + CredentialProblem[] errors; |
| + // THe given PINs warnings. Users can, but are not advised to proceed with |
| + // a warning. |
| + CredentialProblem[] warnings; |
| + // The minimum allowed length for a PIN. |
| + long minLength; |
| + // The maximum allowed length for a PIN. A value of 0 indicates no maximum |
| + // length. |
| + long maxLength; |
| + }; |
|
stevenjb
2016/11/30 18:13:58
It seems a little awkward to me that we return the
sammiequon
2016/11/30 23:03:42
Done.
|
| + |
| callback BooleanResultCallback = void (boolean value); |
| callback ModesCallback = void (QuickUnlockMode[] modes); |
| + callback CredentialCheckCallback = void (CredentialCheck check); |
| interface Functions { |
| // Returns the set of quick unlock modes that are available for the user to |
| @@ -31,6 +53,17 @@ namespace quickUnlockPrivate { |
| // the lock screen. |
| static void getActiveModes(ModesCallback onComplete); |
| + // Checks if the given credential can be used for the given unlock mode. |
| + // Enterprise policy can change credential requirements. |
| + // |mode|: The quick unlock mode that is used. |
| + // |credential|: The given credential. |
| + // |onComplete|: Called with a list of warnings and errors the given |
| + // |credential| has (if any). Allow provides extra information needed to be |
| + // displayed. |
| + static void checkCredential(QuickUnlockMode mode, |
| + DOMString credential, |
| + CredentialCheckCallback onComplete); |
| + |
| // Update the set of quick unlock modes that are currently active/enabled. |
| // |accountPassword|: The password associated with the account (e.g. the |
| // GAIA password). This is required to change the quick unlock credentials. |