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

Unified Diff: chrome/browser/ui/cocoa/passwords/credentials_selection_view.mm

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/cocoa/passwords/credentials_selection_view.mm
diff --git a/chrome/browser/ui/cocoa/passwords/credentials_selection_view.mm b/chrome/browser/ui/cocoa/passwords/credentials_selection_view.mm
index ee2669afbf65bf90008fe10a1c3eac6d0514ae99..69841b66f9ac1b61bec54c79613e06ebef9eb646 100644
--- a/chrome/browser/ui/cocoa/passwords/credentials_selection_view.mm
+++ b/chrome/browser/ui/cocoa/passwords/credentials_selection_view.mm
@@ -15,7 +15,7 @@
namespace {
NSPopUpButton* CreateUsernamesPopUpButton(
- const std::vector<const autofill::PasswordForm*>& forms,
+ const std::vector<autofill::PasswordForm>& forms,
const base::string16& best_matched_username) {
DCHECK(!forms.empty());
std::vector<base::string16> usernames;
@@ -23,11 +23,11 @@ NSPopUpButton* CreateUsernamesPopUpButton(
size_t preffered_form_index = forms.size();
for (size_t index = 0; index < forms.size(); ++index) {
- usernames.push_back(forms[index]->username_value);
- if (forms[index]->username_value == best_matched_username) {
+ usernames.push_back(forms[index].username_value);
+ if (forms[index].username_value == best_matched_username) {
best_matched_username_index = index;
}
- if (forms[index]->preferred) {
+ if (forms[index].preferred) {
preffered_form_index = index;
}
}
@@ -61,7 +61,7 @@ NSPopUpButton* CreateUsernamesPopUpButton(
// Create the pop up button with usernames and the password field.
usernamePopUpButton_.reset([CreateUsernamesPopUpButton(
- model_->local_credentials().get(),
+ model_->local_credentials(),
model_->pending_password().username_value) retain]);
passwordField_.reset(
[PasswordLabel(model_->pending_password().password_value) retain]);
@@ -111,7 +111,7 @@ NSPopUpButton* CreateUsernamesPopUpButton(
- (const autofill::PasswordForm*)getSelectedCredentials {
int selected_index = [usernamePopUpButton_ indexOfSelectedItem];
CHECK(selected_index >= 0);
- return model_->local_credentials()[selected_index];
+ return &model_->local_credentials()[selected_index];
}
@end

Powered by Google App Engine
This is Rietveld 408576698