Index: chrome/common/extensions/api/certificate_provider.idl |
diff --git a/chrome/common/extensions/api/certificate_provider.idl b/chrome/common/extensions/api/certificate_provider.idl |
index 4062d0445b3a48d68be9c5f97b3a383d372e9416..07bfb7631ee2aab9bdb5fa3dbe246dfc557ccb8c 100644 |
--- a/chrome/common/extensions/api/certificate_provider.idl |
+++ b/chrome/common/extensions/api/certificate_provider.idl |
@@ -13,6 +13,11 @@ namespace certificateProvider { |
SHA512 |
}; |
+ enum PinDialogType { |
+ PIN, |
+ PUK |
+ }; |
+ |
[noinline_doc] dictionary CertificateInfo { |
// Must be the DER encoding of a X.509 certificate. Currently, only |
// certificates of RSA keys are supported. |
@@ -36,6 +41,28 @@ namespace certificateProvider { |
ArrayBuffer certificate; |
}; |
+ dictionary PinDialogDetails { |
+ // The type of code requested, PIN or PUK. Default is PIN. |
+ PinDialogType? type; |
+ // The error message to display for user. Default - no error. |
+ DOMString? errorMessage; |
+ // Whether the dialog should accept user input. Defaults to true. |
+ boolean? acceptInput; |
+ }; |
+ |
+ dictionary PinResponseDetails { |
+ DOMString? userInput; |
+ }; |
+ |
+ // A callback called when the dialog gets resolved with the user input, or |
+ // when the dialog request finishes unsuccessfully (e.g. the dialog was |
+ // canceled by the user or was not allowed to be shown). |
+ callback ShowPinDialogCallback = void (optional PinResponseDetails details); |
+ |
+ // The callback to be used by Chrome to send to middleware application the |
+ // status from their request to close PIN dialog for user. |
+ callback ClosePinDialogCallback = void (); |
+ |
// The callback provided by the extension that Chrome uses to report back |
// rejected certificates. See <code>CertificatesCallback</code>. |
callback ResultCallback = void (ArrayBuffer[] rejectedCertificates); |
@@ -76,4 +103,14 @@ namespace certificateProvider { |
static void onSignDigestRequested(SignRequest request, |
SignCallback reportCallback); |
}; |
+ |
+ interface Functions { |
+ // Requests to show a PIN dialog. |
+ static void showPinDialog(optional PinDialogDetails details, |
+ ShowPinDialogCallback callback); |
+ |
+ // Requests to close the dialog that was previously opened using the |
+ // $(ref:showPinDialog) function. |
+ static void closePinDialog(ClosePinDialogCallback callback); |
+ }; |
}; |