From 2b854e07be8aca98d05cf6ff9e35f778724710b1 Mon Sep 17 00:00:00 2001 From: Elizabeth Popova Date: Tue, 26 Oct 2021 20:58:48 +0000 Subject: [PATCH] [Passwords] Add addPassword to private API Introduce passwordsPrivate.addPassword API, which will be called from add password dialog in Desktop Settings. Bug: 1236053 Change-Id: I3e3d286db9fe4cb563a5176acceb60a763fdd478 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3242642 Reviewed-by: Devlin Commit-Queue: Elizabeth Popova Cr-Commit-Position: refs/heads/main@{#935126} NOKEYCHECK=True GitOrigin-RevId: 06881ba16672f9ffadc12a415495643171cc1aae --- closure_compiler/externs/passwords_private.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/closure_compiler/externs/passwords_private.js b/closure_compiler/externs/passwords_private.js index b33d31d71532..9b7e566f1913 100644 --- a/closure_compiler/externs/passwords_private.js +++ b/closure_compiler/externs/passwords_private.js @@ -130,6 +130,16 @@ chrome.passwordsPrivate.InsecureCredential; */ chrome.passwordsPrivate.PasswordCheckStatus; +/** + * @typedef {{ + * url: string, + * username: string, + * password: string, + * useAccountStore: boolean + * }} + */ +chrome.passwordsPrivate.AddPasswordOptions; + /** * Function that logs that the Passwords page was accessed from the Chrome * Settings WebUI. @@ -338,6 +348,16 @@ chrome.passwordsPrivate.getPasswordCheckStatus = function(callback) {}; */ chrome.passwordsPrivate.getUrlCollection = function(url, callback) {}; +/** + * Saves a new password entry described by the given |options|. Invokes + * |callback| or raises an error depending on whether the operation succeeded. + * @param {!chrome.passwordsPrivate.AddPasswordOptions} options Details about a + * new password and storage to be used. + * @param {function(): void=} callback The callback that gets invoked on + * success. + */ +chrome.passwordsPrivate.addPassword = function(options, callback) {}; + /** * Fired when the saved passwords list has changed, meaning that an entry has * been added or removed.