Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/common/extensions/api/quick_unlock_private.idl

Issue 2374303002: cros: Added a new function to quick unlock api for checking unfinished pins. (Closed)
Patch Set: Fixed patch set 2 errors. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Use the <code>chrome.quickUnlockPrivate</code> API to change the active quick 5 // Use the <code>chrome.quickUnlockPrivate</code> API to change the active quick
6 // unlock modes and to change their respective credentials. 6 // unlock modes and to change their respective credentials.
7 // 7 //
8 // Quick unlock only supports unlocking an account that has already been signed 8 // Quick unlock only supports unlocking an account that has already been signed
9 // in. 9 // in.
10 // 10 //
11 // The quick unlock authentication facilities are not available through this 11 // The quick unlock authentication facilities are not available through this
12 // API; they are built directly into the lock screen. 12 // API; they are built directly into the lock screen.
13 13
14 [platforms=("chromeos"), 14 [platforms=("chromeos"),
15 implemented_in="chrome/browser/chromeos/extensions/quick_unlock_private/quick_u nlock_private_api.h"] 15 implemented_in="chrome/browser/chromeos/extensions/quick_unlock_private/quick_u nlock_private_api.h"]
16 namespace quickUnlockPrivate { 16 namespace quickUnlockPrivate {
17 // TODO(jdufault): Add more quick unlock modes, such as a pattern unlock. 17 // TODO(jdufault): Add more quick unlock modes, such as a pattern unlock.
18 enum QuickUnlockMode { 18 enum QuickUnlockMode {
19 PIN 19 PIN
20 }; 20 };
21 21
22 enum CredentialRequirementFailure {
23 TOO_SHORT,
24 TOO_LONG,
25 TOO_WEAK
26 };
27
28 dictionary CredentialRequirement {
29 CredentialRequirementFailure[] failures;
30 long? minLength;
31 long? maxLength;
32 boolean? allowEasyPins;
jdufault 2016/10/04 22:57:28 Why does the UI need to know the policy value for
sammiequon 2016/10/05 19:48:11 I thought they will display a warning instead of e
jdufault 2016/10/05 21:47:37 This means that some of the failures are not actua
sammiequon 2016/10/14 20:58:53 Done.
33 };
34
22 callback BooleanResultCallback = void (boolean value); 35 callback BooleanResultCallback = void (boolean value);
23 callback ModesCallback = void (QuickUnlockMode[] modes); 36 callback ModesCallback = void (QuickUnlockMode[] modes);
37 callback CredentialRequirementCallback =
38 void (CredentialRequirement requirement);
24 39
25 interface Functions { 40 interface Functions {
26 // Returns the set of quick unlock modes that are available for the user to 41 // Returns the set of quick unlock modes that are available for the user to
27 // use. Some quick unlock modes may be disabled by policy. 42 // use. Some quick unlock modes may be disabled by policy.
28 static void getAvailableModes(ModesCallback onComplete); 43 static void getAvailableModes(ModesCallback onComplete);
29 44
30 // Returns the quick unlock modes that are currently enabled and usable on 45 // Returns the quick unlock modes that are currently enabled and usable on
31 // the lock screen. 46 // the lock screen.
32 static void getActiveModes(ModesCallback onComplete); 47 static void getActiveModes(ModesCallback onComplete);
33 48
49 // Returns a set of problems if any with the give mode and credential.
jdufault 2016/10/04 22:57:28 What about: // Checks if the given credential can
sammiequon 2016/10/05 19:48:11 Done.
50 static void isCredentialUsable(QuickUnlockMode mode,
51 DOMString credential,
52 CredentialRequirementCallback onComplete);
53
34 // Update the set of quick unlock modes that are currently active/enabled. 54 // Update the set of quick unlock modes that are currently active/enabled.
35 // |accountPassword|: The password associated with the account (e.g. the 55 // |accountPassword|: The password associated with the account (e.g. the
36 // GAIA password). This is required to change the quick unlock credentials. 56 // GAIA password). This is required to change the quick unlock credentials.
37 // |modes|: The quick unlock modes that should be active. 57 // |modes|: The quick unlock modes that should be active.
38 // |credentials|: The associated credential for each mode. To keep 58 // |credentials|: The associated credential for each mode. To keep
39 // the credential the same for the associated mode, pass an empty string. 59 // the credential the same for the associated mode, pass an empty string.
40 // |onComplete|: Called with true if the quick unlock state was updated, 60 // |onComplete|: Called with true if the quick unlock state was updated,
41 // false otherwise. The update is treated as a single atomic operation. 61 // false otherwise. The update is treated as a single atomic operation.
42 static void setModes(DOMString accountPassword, 62 static void setModes(DOMString accountPassword,
43 QuickUnlockMode[] modes, DOMString[] credentials, 63 QuickUnlockMode[] modes, DOMString[] credentials,
44 BooleanResultCallback onComplete); 64 BooleanResultCallback onComplete);
45 }; 65 };
46 66
47 interface Events { 67 interface Events {
48 // Called after the active set of quick unlock modes has changed. 68 // Called after the active set of quick unlock modes has changed.
49 // |activeModes|: The set of quick unlock modes which are now active. 69 // |activeModes|: The set of quick unlock modes which are now active.
50 static void onActiveModesChanged(QuickUnlockMode[] activeModes); 70 static void onActiveModesChanged(QuickUnlockMode[] activeModes);
51 }; 71 };
52 }; 72 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698