зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a2a4ce5156
Коммит
7f3a6f5a5f
|
@ -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() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче