Bug 1610353 - [2.0] Connect Gecko backend to GeckoView onLoginUsed API. r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D60441

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eugen Sawin 2020-01-23 20:03:47 +00:00
Родитель a2a4ce5156
Коммит 7f3a6f5a5f
2 изменённых файлов: 21 добавлений и 12 удалений

Просмотреть файл

@ -115,6 +115,13 @@ const GeckoViewLoginStorage = {
});
},
/**
* Delegates login entry saving to the attached LoginStorage GeckoView delegate.
* Call this when a new login entry or a new password for an existing login
* entry has been submitted.
*
* @param aLogin The {LoginEntry} to be saved.
*/
onLoginSave(aLogin) {
debug`onLoginSave ${aLogin}`;
@ -124,6 +131,14 @@ const GeckoViewLoginStorage = {
});
},
/**
* Delegates login entry password usage to the attached LoginStorage GeckoView
* delegate.
* Call this when the password of an existing login entry, as returned by
* fetchLogins, has been used for autofill.
*
* @param aLogin The {LoginEntry} whose password was used.
*/
onLoginPasswordUsed(aLogin) {
debug`onLoginUsed ${aLogin}`;

Просмотреть файл

@ -16,17 +16,11 @@ const { LoginManagerStorage_json } = ChromeUtils.import(
"resource://gre/modules/storage-json.js"
);
ChromeUtils.defineModuleGetter(
this,
"GeckoViewLoginStorage",
"resource://gre/modules/GeckoViewLoginStorage.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"LoginHelper",
"resource://gre/modules/LoginHelper.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
GeckoViewLoginStorage: "resource://gre/modules/GeckoViewLoginStorage.jsm",
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
LoginEntry: "resource://gre/modules/GeckoViewLoginStorage.jsm",
});
class LoginManagerStorage_geckoview extends LoginManagerStorage_json {
get classID() {
@ -79,7 +73,7 @@ class LoginManagerStorage_geckoview extends LoginManagerStorage_json {
}
recordPasswordUse(login) {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
GeckoViewLoginStorage.onLoginPasswordUsed(LoginEntry.fromLoginInfo(login));
}
getAllLogins() {