Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: components/password_manager/core/browser/password_store.cc

Issue 1615653005: [Password manager] Human readable origins for Android credentials on chrome://settings/passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined the variable androidUriSuffix Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/password_store.cc
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index be0ed47991777a31327da3e12193c1fd875eeaba..df785ddde42d81b65fa738eaa66bdb8df2b42085 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -195,6 +195,12 @@ void PasswordStore::GetAutofillableLogins(PasswordStoreConsumer* consumer) {
Schedule(&PasswordStore::GetAutofillableLoginsImpl, consumer);
}
+void PasswordStore::GetAutofillableLoginsWithAffiliatedRealms(
+ PasswordStoreConsumer* consumer) {
+ Schedule(&PasswordStore::GetAutofillableLoginsWithAffiliatedRealmsImpl,
+ consumer);
+}
+
void PasswordStore::GetBlacklistLogins(PasswordStoreConsumer* consumer) {
Schedule(&PasswordStore::GetBlacklistLoginsImpl, consumer);
}
@@ -415,6 +421,25 @@ void PasswordStore::GetAutofillableLoginsImpl(
request->NotifyConsumerWithResults(std::move(obtained_forms));
}
+void PasswordStore::GetAutofillableLoginsWithAffiliatedRealmsImpl(
+ scoped_ptr<GetLoginsRequest> request) {
+ ScopedVector<PasswordForm> obtained_forms;
+ if (!FillAutofillableLogins(&obtained_forms))
+ obtained_forms.clear();
+ // Since AffiliatedMatchHelper's requests should be sent from UI thread,
+ // post a request to UI thread.
+ main_thread_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&PasswordStore::InjectAffiliatedWebRealms, this,
+ base::Passed(&obtained_forms), base::Passed(&request)));
+}
+
+void PasswordStore::NotifyLoginsWithAffiliatedRealms(
+ scoped_ptr<GetLoginsRequest> request,
+ ScopedVector<PasswordForm> obtained_forms) {
+ request->NotifyConsumerWithResults(std::move(obtained_forms));
+}
+
void PasswordStore::GetBlacklistLoginsImpl(
scoped_ptr<GetLoginsRequest> request) {
ScopedVector<PasswordForm> obtained_forms;
@@ -452,6 +477,19 @@ void PasswordStore::GetLoginsWithAffiliationsImpl(
request->NotifyConsumerWithResults(std::move(results));
}
+void PasswordStore::InjectAffiliatedWebRealms(
+ ScopedVector<PasswordForm> forms,
+ scoped_ptr<GetLoginsRequest> request) {
+ if (affiliated_match_helper_) {
+ affiliated_match_helper_->InjectAffiliatedWebRealms(
+ std::move(forms),
+ base::Bind(&PasswordStore::GetLoginsRequest::NotifyConsumerWithResults,
+ base::Owned(request.release())));
+ } else {
+ request->NotifyConsumerWithResults(std::move(forms));
+ }
+}
+
void PasswordStore::ScheduleGetLoginsWithAffiliations(
const PasswordForm& form,
scoped_ptr<GetLoginsRequest> request,

Powered by Google App Engine
This is Rietveld 408576698