summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_dialog_controller_mac.h
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 22:47:42 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 22:47:42 +0000
commit74262ecb34f2b2fa1cf20802138a23f31a181e44 (patch)
tree450fa3da797b5141fbdddd28bab608dc487b844e /chrome/browser/autofill/autofill_dialog_controller_mac.h
parentfd11f1752b5296b7f640616193ae3663802e0736 (diff)
downloadchromium_src-74262ecb34f2b2fa1cf20802138a23f31a181e44.zip
chromium_src-74262ecb34f2b2fa1cf20802138a23f31a181e44.tar.gz
chromium_src-74262ecb34f2b2fa1cf20802138a23f31a181e44.tar.bz2
These changes connect the AutoFill UI on the Mac with the back-end data store. Changes to a user's address and credit card information are now persisted. Other changes are:
- Selectively disables the preferences "Setup autofill..." button when the PersonalDataManager is not available. - Allows the user to add or remove address or credit card entries in the AutoFill dialog. - The billing and shipping popup menus in the credit card entries now properly reflect the list of addresses. Notes on nib changes: - AutoFillAddressFormView.xib : added Delete button, wired to trigger |deleteAddress:| action. - AutoFillDialog.xib changed window size to encompass new controls. Added "Add Address" and "Add Credit Card" buttons. Wired them up to |addNewAddress:| and |addNewCreditCard:| actions, respectively. - Preferences.xib : |autoFillSettingsButton_| outlet wired up to facilitate disabling when no |PersonalDataManager| is available. - AutoFillCreditCardFormView.xib : added "Delete" button and wired up to |deleteCreditCard:| action. Removed outlets to menus that were only there for temporary disablement reasons. Set up bindings for billing and shipping address menu items and for their selected item. BUG=33029 TEST=unit_tests --gtest_filter=AutoFillDialogControllerTest.* Note new: Google Test filter = AutoFillDialogControllerTest.*:AutoFillAddressModelTest.*:AutoFillAddressViewControllerTest.*:AutoFillCreditCardModelTest.*:AutoFillCreditCardViewControllerTest.*:DisclosureViewControllerTest.*:SectionSeparatorViewTest.*:VerticalLayoutViewTest.* Review URL: http://codereview.chromium.org/650163 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_dialog_controller_mac.h')
-rw-r--r--chrome/browser/autofill/autofill_dialog_controller_mac.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.h b/chrome/browser/autofill/autofill_dialog_controller_mac.h
index 6e1d8e3..322e4cc 100644
--- a/chrome/browser/autofill/autofill_dialog_controller_mac.h
+++ b/chrome/browser/autofill/autofill_dialog_controller_mac.h
@@ -26,18 +26,17 @@
IBOutlet SectionSeparatorView* addressSectionBox_;
IBOutlet NSView* creditCardSection_;
- // TODO(dhollowa): one each of these for now. Will be n of each
- // controller eventually, for n addresses and n credit cards.
// Note on ownership: the controllers are strongly owned by the dialog
// controller. Their views are inserted into the dialog's view hierarcy
// but are retained by these controllers as well.
- // See http://crbug.com/33029.
- scoped_nsobject<AutoFillAddressViewController>
- addressFormViewController_;
- scoped_nsobject<AutoFillCreditCardViewController>
- creditCardFormViewController_;
- AutoFillDialogObserver* observer_; // (weak) not retained
+ // Array of |AutoFillAddressViewController|.
+ scoped_nsobject<NSMutableArray> addressFormViewControllers_;
+
+ // Array of |AutoFillCreditCardViewController|.
+ scoped_nsobject<NSMutableArray> creditCardFormViewControllers_;
+
+ AutoFillDialogObserver* observer_; // Weak, not retained.
std::vector<AutoFillProfile> profiles_;
std::vector<CreditCard> creditCards_;
}
@@ -59,6 +58,22 @@
- (IBAction)save:(id)sender;
- (IBAction)cancel:(id)sender;
+// IBActions for adding new items.
+- (IBAction)addNewAddress:(id)sender;
+- (IBAction)addNewCreditCard:(id)sender;
+
+// IBActions for deleting items. |sender| is expected to be either a
+// |AutoFillAddressViewController| or a |AutoFillCreditCardViewController|.
+- (IBAction)deleteAddress:(id)sender;
+- (IBAction)deleteCreditCard:(id)sender;
+
+// IBAction for sender to alert dialog that an address label has changed.
+- (IBAction)notifyAddressChange:(id)sender;
+
+// Returns an array of strings representing the addresses in the
+// |addressFormViewControllers_|.
+- (NSArray*)addressStrings;
+
@end
// Interface exposed for unit testing.
@@ -74,8 +89,8 @@
- (id)initWithObserver:(AutoFillDialogObserver*)observer
autoFillProfiles:(const std::vector<AutoFillProfile*>&)profiles
creditCards:(const std::vector<CreditCard*>&)creditCards;
-- (AutoFillAddressViewController*)addressFormViewController;
-- (AutoFillCreditCardViewController*)creditCardFormViewController;
+- (NSMutableArray*)addressFormViewControllers;
+- (NSMutableArray*)creditCardFormViewControllers;
- (void)closeDialog;
@end