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

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: Fix broken include path. 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 [[AutofillSectionContainer alloc] initWithController:controller_
22 forSection:section]);
23 [details_ addObject:sectionContainer];
24 }
25
26 - (void)loadView {
27 details_.reset([[NSMutableArray alloc] init]);
28
29 [self addSection:autofill::SECTION_EMAIL];
30 [self addSection:autofill::SECTION_CC];
31 [self addSection:autofill::SECTION_BILLING];
32 // TODO(groby): Add SECTION_CC_BILLING once toggling is enabled.
33 [self addSection:autofill::SECTION_SHIPPING];
34
35 [self setView:[[NSView alloc] init]];
36
37 NSRect rect = NSZeroRect;
38 for(AutofillSectionContainer* container in
39 [details_ reverseObjectEnumerator]) {
40 [[container view] setFrameOrigin:NSMakePoint(0, NSMaxY(rect))];
41 rect = NSUnionRect(rect, [[container view] frame]);
42 [[self view] addSubview:[container view]];
43 }
44 [[self view] setFrame:rect];
45 }
46
47 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698