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

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

Issue 2253233005: Change ScopedVector to vector<unique_ptr> in the password's UI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android+ Created 4 years, 4 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 09464ec839572ff665e5286d946017f1bd251f0c..4178bfee60a25f56708d851414e2527be5f4fe4d 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -301,9 +301,8 @@ ManagePasswordsBubbleView::PendingView::PendingView(
// Create the pending credential item, save button and refusal combobox.
ManagePasswordItemsView* item = nullptr;
if (!parent->model()->pending_password().username_value.empty()) {
- std::vector<const autofill::PasswordForm*> credentials(
- 1, &parent->model()->pending_password());
- item = new ManagePasswordItemsView(parent_->model(), credentials);
+ item = new ManagePasswordItemsView(parent_->model(),
+ &parent->model()->pending_password());
}
save_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_BUTTON));
@@ -412,18 +411,10 @@ 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.
-
- 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();
-
BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET);
- if (!only_PSL_matches) {
+ if (!parent_->model()->local_credentials().empty()) {
ManagePasswordItemsView* item = new ManagePasswordItemsView(
- parent_->model(), parent_->model()->local_credentials().get());
+ parent_->model(), &parent_->model()->local_credentials());
layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0,
views::kUnrelatedControlVerticalSpacing);
layout->AddView(item);
@@ -655,14 +646,11 @@ ManagePasswordsBubbleView::UpdatePendingView::UpdatePendingView(
// Create the pending credential item, update button.
View* item = nullptr;
if (parent->model()->ShouldShowMultipleAccountUpdateUI()) {
- selection_view_ = new CredentialsSelectionView(
- parent->model(), parent->model()->local_credentials().get(),
- parent->model()->pending_password().username_value);
+ selection_view_ = new CredentialsSelectionView(parent->model());
item = selection_view_;
} else {
- std::vector<const autofill::PasswordForm*> forms;
- forms.push_back(&parent->model()->pending_password());
- item = new ManagePasswordItemsView(parent_->model(), forms);
+ item = new ManagePasswordItemsView(parent_->model(),
+ &parent->model()->pending_password());
}
nope_button_ = views::MdTextButton::CreateSecondaryUiButton(
this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_CANCEL_BUTTON));

Powered by Google App Engine
This is Rietveld 408576698