| Index: chrome/browser/password_manager/native_backend_libsecret.cc
|
| diff --git a/chrome/browser/password_manager/native_backend_libsecret.cc b/chrome/browser/password_manager/native_backend_libsecret.cc
|
| index dab55dbe895a1dad495890b1e423cab41c75cf56..82976c219f6f659c094477cd9d3bdbac4f6e40c9 100644
|
| --- a/chrome/browser/password_manager/native_backend_libsecret.cc
|
| +++ b/chrome/browser/password_manager/native_backend_libsecret.cc
|
| @@ -164,8 +164,8 @@ std::string GetProfileSpecificAppString(LocalProfileId id) {
|
| } // namespace
|
|
|
| NativeBackendLibsecret::NativeBackendLibsecret(LocalProfileId id)
|
| - : app_string_(GetProfileSpecificAppString(id)) {
|
| -}
|
| + : app_string_(GetProfileSpecificAppString(id)),
|
| + ensured_keyring_unlocked_(false) {}
|
|
|
| NativeBackendLibsecret::~NativeBackendLibsecret() {
|
| }
|
| @@ -307,6 +307,11 @@ bool NativeBackendLibsecret::GetLogins(
|
| bool NativeBackendLibsecret::AddUpdateLoginSearch(
|
| const autofill::PasswordForm& lookup_form,
|
| ScopedVector<autofill::PasswordForm>* forms) {
|
| + if (!ensured_keyring_unlocked_) {
|
| + LibsecretLoader::EnsureKeyringUnlocked();
|
| + ensured_keyring_unlocked_ = true;
|
| + }
|
| +
|
| LibsecretAttributesBuilder attrs;
|
| attrs.Append("origin_url", lookup_form.origin.spec());
|
| attrs.Append("username_element", UTF16ToUTF8(lookup_form.username_element));
|
| @@ -408,6 +413,11 @@ bool NativeBackendLibsecret::GetLoginsList(
|
| const PasswordStore::FormDigest* lookup_form,
|
| GetLoginsListOptions options,
|
| ScopedVector<autofill::PasswordForm>* forms) {
|
| + if (!ensured_keyring_unlocked_) {
|
| + LibsecretLoader::EnsureKeyringUnlocked();
|
| + ensured_keyring_unlocked_ = true;
|
| + }
|
| +
|
| LibsecretAttributesBuilder attrs;
|
| attrs.Append("application", app_string_);
|
| if (options != ALL_LOGINS)
|
|
|