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

Side by Side Diff: chrome/browser/ui/views/passwords/manage_password_items_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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" 5 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h"
6 6
7 #include <numeric> 7 #include <numeric>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 undo_link_ = nullptr; 260 undo_link_ = nullptr;
261 } 261 }
262 262
263 // ManagePasswordItemsView 263 // ManagePasswordItemsView
264 ManagePasswordItemsView::ManagePasswordItemsView( 264 ManagePasswordItemsView::ManagePasswordItemsView(
265 ManagePasswordsBubbleModel* manage_passwords_bubble_model, 265 ManagePasswordsBubbleModel* manage_passwords_bubble_model,
266 const std::vector<const autofill::PasswordForm*>& password_forms) 266 const std::vector<const autofill::PasswordForm*>& password_forms)
267 : model_(manage_passwords_bubble_model) { 267 : model_(manage_passwords_bubble_model) {
268 int fixed_height = PasswordFormRow::GetFixedHeight(model_->state()); 268 int fixed_height = PasswordFormRow::GetFixedHeight(model_->state());
269 for (const autofill::PasswordForm* password_form : password_forms) { 269 for (const autofill::PasswordForm* password_form : password_forms) {
270 password_forms_rows_.push_back( 270 if (!password_form->is_public_suffix_match)
271 new PasswordFormRow(this, password_form, fixed_height)); 271 password_forms_rows_.push_back(
272 new PasswordFormRow(this, password_form, fixed_height));
272 } 273 }
273 AddRows(); 274 AddRows();
274 } 275 }
275 276
276 ManagePasswordItemsView::~ManagePasswordItemsView() = default; 277 ManagePasswordItemsView::~ManagePasswordItemsView() = default;
277 278
278 void ManagePasswordItemsView::AddRows() { 279 void ManagePasswordItemsView::AddRows() {
279 views::GridLayout* layout = new views::GridLayout(this); 280 views::GridLayout* layout = new views::GridLayout(this);
280 SetLayoutManager(layout); 281 SetLayoutManager(layout);
281 for (auto* row : password_forms_rows_) { 282 for (auto* row : password_forms_rows_) {
(...skipping 13 matching lines...) Expand all
295 deleted 296 deleted
296 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD 297 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD
297 : ManagePasswordsBubbleModel::ADD_PASSWORD); 298 : ManagePasswordsBubbleModel::ADD_PASSWORD);
298 } 299 }
299 300
300 void ManagePasswordItemsView::Refresh() { 301 void ManagePasswordItemsView::Refresh() {
301 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state()); 302 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state());
302 RemoveAllChildViews(true); 303 RemoveAllChildViews(true);
303 AddRows(); 304 AddRows();
304 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698