| 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]);
|
|
|
|
|