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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 1620083003: Fix best credentials selection algorithm in Password Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests added Created 4 years, 11 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: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index 610bbc4e43a1f5a5d8efc6325a7ccd80ad61213e..cd0238673a73da09b1bf330b4ee2ae17b5ff2437 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -427,7 +427,15 @@ ManagePasswordsBubbleView::ManageView::ManageView(
// If we have a list of passwords to store for the current site, display
// them to the user for management. Otherwise, render a "No passwords for
// this site" message.
- if (!parent_->model()->local_credentials().empty()) {
+
+ bool only_PSL_matches =
+ find_if(parent_->model()->local_credentials().begin(),
+ parent_->model()->local_credentials().end(),
+ [](const autofill::PasswordForm* form) {
+ return !form->is_public_suffix_match;
+ }) == parent_->model()->local_credentials().end();
+
+ if (!only_PSL_matches) {
ManagePasswordItemsView* item = new ManagePasswordItemsView(
parent_->model(), parent_->model()->local_credentials().get());
layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0,

Powered by Google App Engine
This is Rietveld 408576698