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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_details_container.mm

Issue 14704004: [Autofill] Add Details Section (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h"
6
7 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
8 #import "chrome/browser/ui/cocoa/autofill/autofill_section_container.h"
9
10 @implementation AutofillDetailsContainer
11
12 - (id)initWithController:(autofill::AutofillDialogController*)controller {
13 if (self = [super init]) {
14 controller_ = controller;
15 }
16 return self;
17 }
18
19 - (void)addSection:(autofill::DialogSection)section {
20 scoped_nsobject<AutofillSectionContainer> sectionContainer;
21 sectionContainer.reset(
22 [[AutofillSectionContainer alloc] initWithController:controller_
23 forSection:section]);
24 [details_ addObject:sectionContainer];
25 }
26
27 - (void)loadView {
28 details_.reset([[NSMutableArray alloc] init]);
29
30 [self addSection:autofill::SECTION_EMAIL];
31 [self addSection:autofill::SECTION_CC];
32 [self addSection:autofill::SECTION_BILLING];
33 // TODO(groby): Add SECTION_CC_BILLING once toggling is enabled.
34 [self addSection:autofill::SECTION_SHIPPING];
35
36 [self setView:[[NSView alloc] init]];
37
38 NSRect rect = NSZeroRect;
39 for(AutofillSectionContainer* container in
40 [details_ reverseObjectEnumerator]) {
41 [[container view] setFrameOrigin:NSMakePoint(0, NSMaxY(rect))];
42 rect = NSUnionRect(rect, [[container view] frame]);
43 [[self view] addSubview:[container view]];
44 }
45 [[self view] setFrame:rect];
46 }
47
48 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698