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

Unified Diff: chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.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/passwords_list_view_controller.mm
diff --git a/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm b/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm
index 8ecd0f96987a6281cacd90e2e48d135ce9f2cbed..d86bdaa8535dda49ad95530bd300de5c6de11217 100644
--- a/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm
+++ b/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm
@@ -384,17 +384,17 @@ NSTextField* FederationLabel(const base::string16& text) {
@synthesize firstColumnMaxWidth = firstColumnMaxWidth_;
@synthesize secondColumnMaxWidth = secondColumnMaxWidth_;
-- (id)initWithModel:(ManagePasswordsBubbleModel*)model
- forms:(const PasswordFormsVector&)password_forms {
+- (id)initWithModelAndForms:(ManagePasswordsBubbleModel*)model
+ forms:(const PasswordFormsVector*)password_forms {
if ((self = [super initWithNibName:nil bundle:nil])) {
base::scoped_nsobject<NSMutableArray> items(
- [[NSMutableArray arrayWithCapacity:password_forms.size()] retain]);
+ [[NSMutableArray arrayWithCapacity:password_forms->size()] retain]);
model_ = model;
// Create the controllers.
- for (const autofill::PasswordForm* form : password_forms) {
+ for (const auto& form : *password_forms) {
base::scoped_nsobject<ManagePasswordItemViewController> item(
[[ManagePasswordItemViewController alloc] initWithDelegate:self
- passwordForm:form]);
+ passwordForm:&form]);
[items addObject:item.get()];
}
itemViews_.reset(items.release());
@@ -402,6 +402,21 @@ NSTextField* FederationLabel(const base::string16& text) {
return self;
}
+- (id)initWithModelAndForm:(ManagePasswordsBubbleModel*)model
+ form:(const autofill::PasswordForm*)form {
+ if ((self = [super initWithNibName:nil bundle:nil])) {
+ base::scoped_nsobject<NSMutableArray> items(
+ [[NSMutableArray arrayWithCapacity:1] retain]);
+ model_ = model;
+ base::scoped_nsobject<ManagePasswordItemViewController> item(
+ [[ManagePasswordItemViewController alloc] initWithDelegate:self
+ passwordForm:form]);
+ [items addObject:item.get()];
+ itemViews_.reset(items.release());
+ }
+ return self;
+}
+
- (void)loadView {
base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]);

Powered by Google App Engine
This is Rietveld 408576698