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

Side by Side Diff: chrome/browser/autofill/autofill_dialog_controller_mac.h

Issue 3039014: AutoFill Profiles dialog handles multi-select and delete on Mac (Closed)
Patch Set: Merge with trunk. Created 10 years, 5 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 // A window controller for managing the autofill options dialog. 28 // A window controller for managing the autofill options dialog.
29 // Application modally presents a dialog allowing the user to store 29 // Application modally presents a dialog allowing the user to store
30 // personal address and credit card information. 30 // personal address and credit card information.
31 @interface AutoFillDialogController : NSWindowController <NSTableViewDelegate> { 31 @interface AutoFillDialogController : NSWindowController <NSTableViewDelegate> {
32 @private 32 @private
33 // Outlet to the main NSTableView object listing both addresses and credit 33 // Outlet to the main NSTableView object listing both addresses and credit
34 // cards with section headers for both. 34 // cards with section headers for both.
35 IBOutlet AutoFillTableView* tableView_; 35 IBOutlet AutoFillTableView* tableView_;
36 36
37 // Outlet to "Edit..." button. Here for unit testing purposes.
38 IBOutlet NSButton* editButton_;
39
37 // This observer is passed in by the caller of the dialog. When the dialog 40 // This observer is passed in by the caller of the dialog. When the dialog
38 // is dismissed |observer_| is called with new values for the addresses and 41 // is dismissed |observer_| is called with new values for the addresses and
39 // credit cards. 42 // credit cards.
40 // Weak, not retained. 43 // Weak, not retained.
41 AutoFillDialogObserver* observer_; 44 AutoFillDialogObserver* observer_;
42 45
43 // Reference to input parameter. 46 // Reference to input parameter.
44 // Weak, not retained. 47 // Weak, not retained.
45 Profile* profile_; 48 Profile* profile_;
46 49
(...skipping 14 matching lines...) Expand all
61 // State of checkbox for enabling AutoFill in general. 64 // State of checkbox for enabling AutoFill in general.
62 BOOL autoFillEnabled_; 65 BOOL autoFillEnabled_;
63 66
64 // State of checkbox for enabling Mac Address Book integration. 67 // State of checkbox for enabling Mac Address Book integration.
65 BOOL auxiliaryEnabled_; 68 BOOL auxiliaryEnabled_;
66 69
67 // State for |itemIsSelected| property used in bindings for "Edit..." and 70 // State for |itemIsSelected| property used in bindings for "Edit..." and
68 // "Remove" buttons. 71 // "Remove" buttons.
69 BOOL itemIsSelected_; 72 BOOL itemIsSelected_;
70 73
74 // State for |multipleSelected| property used in bindings for "Edit..."
75 // button.
76 BOOL multipleSelected_;
77
71 // Utility object to save and restore dialog position. 78 // Utility object to save and restore dialog position.
72 scoped_nsobject<WindowSizeAutosaver> sizeSaver_; 79 scoped_nsobject<WindowSizeAutosaver> sizeSaver_;
73 80
74 // Transient reference to address "Add" / "Edit" sheet for address 81 // Transient reference to address "Add" / "Edit" sheet for address
75 // information. 82 // information.
76 scoped_nsobject<AutoFillAddressSheetController> addressSheetController; 83 scoped_nsobject<AutoFillAddressSheetController> addressSheetController;
77 84
78 // Transient reference to address "Add" / "Edit" sheet for credit card 85 // Transient reference to address "Add" / "Edit" sheet for credit card
79 // information. 86 // information.
80 scoped_nsobject<AutoFillCreditCardSheetController> creditCardSheetController; 87 scoped_nsobject<AutoFillCreditCardSheetController> creditCardSheetController;
81 88
82 // Manages PersonalDataManager loading. 89 // Manages PersonalDataManager loading.
83 scoped_ptr<AutoFillDialogControllerInternal::PersonalDataManagerObserver> 90 scoped_ptr<AutoFillDialogControllerInternal::PersonalDataManagerObserver>
84 personalDataManagerObserver_; 91 personalDataManagerObserver_;
85 } 92 }
86 93
87 // Property representing state of the AutoFill enabled preference. Checkbox is 94 // Property representing state of the AutoFill enabled preference. Checkbox is
88 // bound to this in nib. Also, enabled state of other controls are also bound 95 // bound to this in nib. Also, enabled state of other controls are also bound
89 // to this property. 96 // to this property.
90 @property (nonatomic) BOOL autoFillEnabled; 97 @property (nonatomic) BOOL autoFillEnabled;
91 98
92 // Property representing state of Address Book "me" card usage. Checkbox is 99 // Property representing state of Address Book "me" card usage. Checkbox is
93 // bound to this in nib. 100 // bound to this in nib.
94 @property (nonatomic) BOOL auxiliaryEnabled; 101 @property (nonatomic) BOOL auxiliaryEnabled;
95 102
96 // Property representing selection state in |tableView_|. Enabled state of 103 // Property representing selection state in |tableView_|. Enabled state of
97 // edit and delete buttons are bound to this property. 104 // edit and delete buttons are bound to this property.
98 @property (nonatomic) BOOL itemIsSelected; 105 @property (nonatomic) BOOL itemIsSelected;
99 106
107 // Property representing multiple selection state in |tableView_|. Enabled
108 // state of edit button is bound to this property.
109 @property (nonatomic) BOOL multipleSelected;
110
100 // Main interface for displaying an application modal AutoFill dialog on screen. 111 // Main interface for displaying an application modal AutoFill dialog on screen.
101 // This class method creates a new |AutoFillDialogController| and runs it as a 112 // This class method creates a new |AutoFillDialogController| and runs it as a
102 // modal dialog. The controller autoreleases itself when the dialog is closed. 113 // modal dialog. The controller autoreleases itself when the dialog is closed.
103 // |observer| can be NULL, but if it is, then no notification is sent during 114 // |observer| can be NULL, but if it is, then no notification is sent during
104 // call to |save|. If |observer| is non-NULL then its |OnAutoFillDialogApply| 115 // call to |save|. If |observer| is non-NULL then its |OnAutoFillDialogApply|
105 // method is invoked during |save| with the new address and credit card 116 // method is invoked during |save| with the new address and credit card
106 // information. 117 // information.
107 // |profile| must be non-NULL. 118 // |profile| must be non-NULL.
108 // AutoFill profile and credit card data is initialized from the 119 // AutoFill profile and credit card data is initialized from the
109 // |PersonalDataManager| that is associated with the input |profile|. 120 // |PersonalDataManager| that is associated with the input |profile|.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 172
162 - (id)initWithObserver:(AutoFillDialogObserver*)observer 173 - (id)initWithObserver:(AutoFillDialogObserver*)observer
163 profile:(Profile*)profile 174 profile:(Profile*)profile
164 importedProfile:(AutoFillProfile*)importedProfile 175 importedProfile:(AutoFillProfile*)importedProfile
165 importedCreditCard:(CreditCard*)importedCreditCard; 176 importedCreditCard:(CreditCard*)importedCreditCard;
166 - (void)closeDialog; 177 - (void)closeDialog;
167 - (AutoFillAddressSheetController*)addressSheetController; 178 - (AutoFillAddressSheetController*)addressSheetController;
168 - (AutoFillCreditCardSheetController*)creditCardSheetController; 179 - (AutoFillCreditCardSheetController*)creditCardSheetController;
169 - (void)selectAddressAtIndex:(size_t)i; 180 - (void)selectAddressAtIndex:(size_t)i;
170 - (void)selectCreditCardAtIndex:(size_t)i; 181 - (void)selectCreditCardAtIndex:(size_t)i;
182 - (void)addSelectedAddressAtIndex:(size_t)i;
183 - (void)addSelectedCreditCardAtIndex:(size_t)i;
184 - (BOOL)editButtonEnabled;
171 @end 185 @end
172 186
173 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_ 187 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_MAC_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698