| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
| 12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" | 12 #import "chrome/browser/ui/cocoa/autofill/autofill_layout.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 class AutofillDialogController; | 15 class AutofillDialogController; |
| 16 } | 16 } |
| 17 | 17 |
| 18 @class AutofillSectionView; | 18 @class AutofillSectionView; |
| 19 @class AutofillSuggestionContainer; | 19 @class AutofillSuggestionContainer; |
| 20 @class LayoutView; | 20 @class LayoutView; |
| 21 @class MenuButton; | 21 @class MenuButton; |
| 22 @class MenuController; | 22 @class MenuController; |
| 23 | 23 |
| 24 // View controller for a section of the payment details. Contains a label | 24 // View controller for a section of the payment details. Contains a label |
| 25 // describing the section as well as associated inputs and controls. Built | 25 // describing the section as well as associated inputs and controls. Built |
| 26 // dynamically based on data retrieved from AutofillDialogController. | 26 // dynamically based on data retrieved from AutofillDialogController. |
| 27 @interface AutofillSectionContainer : | 27 @interface AutofillSectionContainer : |
| 28 NSViewController<AutofillLayout> { | 28 NSViewController<AutofillLayout> { |
| 29 @private | 29 @private |
| 30 scoped_nsobject<LayoutView> inputs_; | 30 base::scoped_nsobject<LayoutView> inputs_; |
| 31 scoped_nsobject<MenuButton> suggestButton_; | 31 base::scoped_nsobject<MenuButton> suggestButton_; |
| 32 scoped_nsobject<AutofillSuggestionContainer> suggestContainer_; | 32 base::scoped_nsobject<AutofillSuggestionContainer> suggestContainer_; |
| 33 scoped_nsobject<NSTextField> label_; | 33 base::scoped_nsobject<NSTextField> label_; |
| 34 scoped_nsobject<AutofillSectionView> view_; // The view for the container. | 34 base::scoped_nsobject<AutofillSectionView> view_; // The view for the |
| 35 // container. |
| 35 | 36 |
| 36 scoped_nsobject<MenuController> menuController_; | 37 base::scoped_nsobject<MenuController> menuController_; |
| 37 autofill::DialogSection section_; | 38 autofill::DialogSection section_; |
| 38 autofill::AutofillDialogController* controller_; // Not owned. | 39 autofill::AutofillDialogController* controller_; // Not owned. |
| 39 } | 40 } |
| 40 | 41 |
| 41 @property(readonly, nonatomic) autofill::DialogSection section; | 42 @property(readonly, nonatomic) autofill::DialogSection section; |
| 42 | 43 |
| 43 // Designated initializer. Queries |controller| for the list of desired input | 44 // Designated initializer. Queries |controller| for the list of desired input |
| 44 // fields for |section|. | 45 // fields for |section|. |
| 45 - (id)initWithController:(autofill::AutofillDialogController*)controller | 46 - (id)initWithController:(autofill::AutofillDialogController*)controller |
| 46 forSection:(autofill::DialogSection)section; | 47 forSection:(autofill::DialogSection)section; |
| 47 | 48 |
| 48 // Populates |output| with mappings from field identification to input value. | 49 // Populates |output| with mappings from field identification to input value. |
| 49 - (void)getInputs:(autofill::DetailOutputMap*)output; | 50 - (void)getInputs:(autofill::DetailOutputMap*)output; |
| 50 | 51 |
| 51 // Called when the controller-maintained suggestions model has changed. | 52 // Called when the controller-maintained suggestions model has changed. |
| 52 - (void)modelChanged; | 53 - (void)modelChanged; |
| 53 | 54 |
| 54 // Called when the contents of a section have changed. | 55 // Called when the contents of a section have changed. |
| 55 - (void)update; | 56 - (void)update; |
| 56 | 57 |
| 57 @end | 58 @end |
| 58 | 59 |
| 59 @interface AutofillSectionContainer (ForTesting) | 60 @interface AutofillSectionContainer (ForTesting) |
| 60 - (NSControl*)getField:(autofill::AutofillFieldType)type; | 61 - (NSControl*)getField:(autofill::AutofillFieldType)type; |
| 61 @end | 62 @end |
| 62 | 63 |
| 63 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ | 64 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_SECTION_CONTAINER_H_ |
| OLD | NEW |