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

Unified Diff: components/password_manager/content/browser/credential_manager_impl.cc

Issue 2517993004: Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins(). (Closed)
Patch Set: use set Created 4 years, 1 month 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/content/browser/credential_manager_impl.cc
diff --git a/components/password_manager/content/browser/credential_manager_impl.cc b/components/password_manager/content/browser/credential_manager_impl.cc
index 444d3adccf4dffaf6600381a428d1cc8213a65b5..7e6e528cdfb5fcb01a0ad3911bc271b6e3cf5008 100644
--- a/components/password_manager/content/browser/credential_manager_impl.cc
+++ b/components/password_manager/content/browser/credential_manager_impl.cc
@@ -177,38 +177,13 @@ void CredentialManagerImpl::Get(bool zero_click_only,
return;
}
- if (store->affiliated_match_helper()) {
- store->affiliated_match_helper()->GetAffiliatedAndroidRealms(
- GetSynthesizedFormForOrigin(),
- base::Bind(&CredentialManagerImpl::ScheduleRequestTask,
- weak_factory_.GetWeakPtr(), callback, zero_click_only,
- include_passwords, federations));
- } else {
- std::vector<std::string> no_affiliated_realms;
- ScheduleRequestTask(callback, zero_click_only, include_passwords,
- federations, no_affiliated_realms);
- }
-}
-
-void CredentialManagerImpl::ScheduleRequestTask(
- const GetCallback& callback,
- bool zero_click_only,
- bool include_passwords,
- const std::vector<GURL>& federations,
- const std::vector<std::string>& android_realms) {
- DCHECK(GetPasswordStore());
pending_request_.reset(new CredentialManagerPendingRequestTask(
this, base::Bind(&RunMojoGetCallback, callback), zero_click_only,
- web_contents()->GetLastCommittedURL().GetOrigin(), include_passwords,
- federations, android_realms));
-
+ include_passwords, federations));
// This will result in a callback to
// PendingRequestTask::OnGetPasswordStoreResults().
- GetPasswordStore()->GetAutofillableLogins(pending_request_.get());
-}
-
-PasswordStore* CredentialManagerImpl::GetPasswordStore() {
- return client_ ? client_->GetPasswordStore() : nullptr;
+ GetPasswordStore()->GetLogins(GetSynthesizedFormForOrigin(),
+ pending_request_.get());
}
bool CredentialManagerImpl::IsZeroClickAllowed() const {
@@ -278,6 +253,15 @@ PasswordManagerClient* CredentialManagerImpl::client() const {
return client_;
}
+PasswordStore* CredentialManagerImpl::GetPasswordStore() {
+ return client_ ? client_->GetPasswordStore() : nullptr;
+}
+
+void CredentialManagerImpl::DoneRequiringUserMediation() {
+ DCHECK(pending_require_user_mediation_);
+ pending_require_user_mediation_.reset();
+}
+
PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin()
const {
PasswordStore::FormDigest digest = {
@@ -287,9 +271,4 @@ PasswordStore::FormDigest CredentialManagerImpl::GetSynthesizedFormForOrigin()
return digest;
}
-void CredentialManagerImpl::DoneRequiringUserMediation() {
- DCHECK(pending_require_user_mediation_);
- pending_require_user_mediation_.reset();
-}
-
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698