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

Unified Diff: chrome/common/extensions/api/screenlock_private.idl

Issue 168623003: Add chrome.screenlockPrivate API functions to handle alternate auth types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update tests Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/screenlock_private.idl
diff --git a/chrome/common/extensions/api/screenlock_private.idl b/chrome/common/extensions/api/screenlock_private.idl
index f89b3a689f0b571ff71f117b281d3216c5488bf9..4c5bb4d2d953a724f38d3e1aa2dfe2818d9ca42d 100644
--- a/chrome/common/extensions/api/screenlock_private.idl
+++ b/chrome/common/extensions/api/screenlock_private.idl
@@ -5,7 +5,19 @@
// Control and monitor the screen locker.
[platforms=("chromeos"), implemented_in="chrome/browser/chromeos/extensions/screenlock_private_api.h", permissions=screenlockPrivate]
namespace screenlockPrivate {
+ // Supported authentication types shown on the user pod.
+ // |systemPassword|: The standard password field, which authenticates using
+ // the user's regular password. The $ref:onAuthAttempted()
+ // event will not be fired for this authentication type.
+ // |numericPin|: An input field for a 4 digit numeric pin code.
+ // |userClick|: Makes the user pod clickable when it is focused, and
+ // clicking on it attempts the authentication. If |value| is
+ // specified with $ref:setAuthType(), the text is displayed
+ // in the password field.
+ enum AuthType {systemPassword, numericPin, userClick};
xiyuan 2014/02/20 17:44:44 nit: systemPassword -> offlinePassword to be consi
Tim Song 2014/02/20 21:06:08 Done.
+
callback BooleanCallback = void(boolean locked);
+ callback AuthTypeCallback = void(AuthType authType);
interface Functions {
// Returns true if the screen is currently locked, false otherwise.
@@ -18,16 +30,37 @@ namespace screenlockPrivate {
// Show a message to the user on the unlock UI if the screen is locked.
static void showMessage(DOMString message);
- // Show a button icon on the unlock UI if the screen is locked.
+ // Show a Button, an icon beside the input field on the user pod.
+ // |icon|: An extension resource of the icon image.
static void showButton(DOMString icon);
+
+ // Hides the button added by $ref:showButton().
+ static void hideButton();
+
+ // Returns the current auth type used for the user pod.
+ static void getAuthType(AuthTypeCallback callback);
+
+ // Set the type of the authentication for the user pod. The input field
+ // area of the user pod below the user's portrait will be changed.
+ // |authType|: The type of authentication to use.
+ // |initialValue|: The initial value to populate the input field.
+ static void setAuthType(AuthType authType, optional DOMString initialValue);
+
+ // Accepts or rejects the current auth attempt.
+ static void acceptAuthAttempt(boolean accept);
not at google - send to devlin 2014/02/20 01:16:20 it would be a nicer API if this were a method on t
Tim Song 2014/02/20 01:37:46 That would be nice. Can you point me to another AP
};
interface Events {
// Fires whenever the screen is locked or unlocked.
static void onChanged(boolean locked);
- // Fires when the user presses the button on the unlock UI shown by
- // $ref:showButton().
+ // Fires when the user clicks on the Button shown by $ref:showButton().
static void onButtonClicked();
+
+ // Fires when the user attempts to authenticate with the user's input.
+ // There will be at most one auth attempt active at any time.
+ // Call $ref:acceptAuthAttempt() to accept or reject this attempt.
+ // Note: Some authentication types will not have an input.
+ static void onAuthAttempted(AuthType type, DOMString input);
};
};

Powered by Google App Engine
This is Rietveld 408576698