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

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

Issue 1260263002: Move ShouldFilterAutofillResult from ChromePasswordManagerClient to PasswordManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac fix Created 5 years, 5 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_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index e331c63d6f9258a5b7bbbad44d303628fc5622f5..d0f0a7ec30951a37f0cad87ba1f85117d41082bb 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -22,6 +22,7 @@
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
#include "components/password_manager/core/browser/password_store.h"
+#include "components/password_manager/core/browser/store_result_filter.h"
#include "google_apis/gaia/gaia_auth_util.h"
using autofill::FormStructure;
@@ -367,8 +368,10 @@ void PasswordFormManager::OnRequestDone(
std::vector<int> credential_scores;
credential_scores.reserve(logins_result.size());
int best_score = 0;
+ scoped_ptr<StoreResultFilter> result_filter =
+ client_->CreateStoreResultFilter();
for (const PasswordForm* login : logins_result) {
- if (ShouldIgnoreResult(*login)) {
+ if (ShouldIgnoreResult(*login, result_filter.get())) {
credential_scores.push_back(-1);
continue;
}
@@ -451,8 +454,6 @@ void PasswordFormManager::OnRequestDone(
best_matches_.insert(username, protege.Pass());
}
- client_->AutofillResultsComputed();
-
UMA_HISTOGRAM_COUNTS("PasswordManager.NumPasswordsNotShown",
logins_result_size - best_matches_.size());
@@ -537,12 +538,13 @@ void PasswordFormManager::OnGetPasswordStoreResults(
drivers_.clear();
}
-bool PasswordFormManager::ShouldIgnoreResult(const PasswordForm& form) const {
+bool PasswordFormManager::ShouldIgnoreResult(const PasswordForm& form,
+ StoreResultFilter* filter) const {
// Don't match an invalid SSL form with one saved under secure circumstances.
if (form.ssl_valid && !observed_form_.ssl_valid)
return true;
- if (client_->ShouldFilterAutofillResult(form))
+ if (filter->ShouldIgnore(form))
return true;
return false;

Powered by Google App Engine
This is Rietveld 408576698