diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 02:47:37 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-05 02:47:37 +0000 |
commit | f749da537323d5dd900e636edeb111d8f52e7e9d (patch) | |
tree | 2d1da8ab40e8dc3aec06d53f29d2423702021d02 /chrome/browser/autofill/autofill_dialog_controller_mac.h | |
parent | cd69619bc053d527b7c82aac81c605157b28d01f (diff) | |
download | chromium_src-f749da537323d5dd900e636edeb111d8f52e7e9d.zip chromium_src-f749da537323d5dd900e636edeb111d8f52e7e9d.tar.gz chromium_src-f749da537323d5dd900e636edeb111d8f52e7e9d.tar.bz2 |
AutoFill profile shouldn't be saved when cancelled during initial setup.
Relanding after revert of: 46424
http://codereview.chromium.org/1902003
Fixing compile error on Windows.
For first encounter with fillable form, the AutoFillManager::OnInfoBarAccepted()
call now passes the new profile and credit card information to the dialog directly
instead of saving it to the database and then invoking the dialog. This facilitates
"Cancel" in the dialog where the new information is not persisted.
This was a good opportunity to refactor the deferred PersonalDataManager::Observer() logic
out of the preferences dialog and into the AutoFillDialogController itself.
This also consolidates the Windows, Mac, and Linux interfaces for the ShowAutoFillDialog()
call. More work is required on Linux and Windows to properly conform to this interface and
fix bug 41010. The Linux and Windows implementations will need to respect the new input
parameters |imported_profile| and |imported_credit_card|.
BUG=41010
TEST=AutoFillDialogControllerTest.WaitForDataToLoad, AutoFillDialogControllerTest.ImportedParameters
Review URL: http://codereview.chromium.org/1952002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46430 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.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.h b/chrome/browser/autofill/autofill_dialog_controller_mac.h index 1d90836e..220634b 100644 --- a/chrome/browser/autofill/autofill_dialog_controller_mac.h +++ b/chrome/browser/autofill/autofill_dialog_controller_mac.h @@ -8,10 +8,15 @@ #import <Cocoa/Cocoa.h> #include <vector> #include "base/scoped_nsobject.h" +#include "base/scoped_ptr.h" #include "chrome/browser/autofill/autofill_dialog.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/credit_card.h" +namespace AutoFillDialogControllerInternal { +class PersonalDataManagerObserver; +} // AutoFillDialogControllerInternal + @class AutoFillAddressViewController; @class AutoFillCreditCardViewController; class Profile; @@ -42,11 +47,17 @@ class Profile; scoped_nsobject<NSString> defaultCreditCardLabel_; AutoFillDialogObserver* observer_; // Weak, not retained. + Profile* profile_; // Weak, not retained. + AutoFillProfile* importedProfile_; // Weak, not retained. + CreditCard* importedCreditCard_; // Weak, not retained. std::vector<AutoFillProfile> profiles_; std::vector<CreditCard> creditCards_; - Profile* profile_; // Weak, not retained. BOOL auxiliaryEnabled_; scoped_nsobject<WindowSizeAutosaver> sizeSaver_; + + // Manages PersonalDataManager loading. + scoped_ptr<AutoFillDialogControllerInternal::PersonalDataManagerObserver> + personalDataManagerObserver_; } // Property representing state of Address Book "me" card usage. Checkbox is @@ -64,13 +75,15 @@ class Profile; // call to |save|. If |observer| is non-NULL then its |OnAutoFillDialogApply| // method is invoked during |save| with the new address and credit card // information. -// |profiles| and |creditCards| must have non-NULL entries (zero or more). -// These provide the initial data that is presented to the user. // |profile| must be non-NULL. +// AutoFill profile and credit card data is initialized from the +// |PersonalDataManager| that is associated with the input |profile|. +// If |importedProfile| or |importedCreditCard| parameters are supplied then +// the |PersonalDataManager| data is ignored. Both may be NULL. + (void)showAutoFillDialogWithObserver:(AutoFillDialogObserver*)observer - autoFillProfiles:(const std::vector<AutoFillProfile*>&)profiles - creditCards:(const std::vector<CreditCard*>&)creditCards - profile:(Profile*)profile; + profile:(Profile*)profile + importedProfile:(AutoFillProfile*)importedProfile + importedCreditCard:(CreditCard*)importedCreditCard; // IBActions for the dialog buttons. - (IBAction)save:(id)sender; @@ -105,14 +118,14 @@ class Profile; // Note: controller is autoreleased when |-closeDialog| is called. + (AutoFillDialogController*)controllerWithObserver: (AutoFillDialogObserver*)observer - autoFillProfiles:(const std::vector<AutoFillProfile*>&)profiles - creditCards:(const std::vector<CreditCard*>&)creditCards - profile:(Profile*)profile; + profile:(Profile*)profile + importedProfile:(AutoFillProfile*)importedProfile + importedCreditCard:(CreditCard*)importedCreditCard; - (id)initWithObserver:(AutoFillDialogObserver*)observer - autoFillProfiles:(const std::vector<AutoFillProfile*>&)profiles - creditCards:(const std::vector<CreditCard*>&)creditCards - profile:(Profile*)profile; + profile:(Profile*)profile + importedProfile:(AutoFillProfile*)importedProfile + importedCreditCard:(CreditCard*)importedCreditCard; - (NSMutableArray*)addressFormViewControllers; - (NSMutableArray*)creditCardFormViewControllers; - (void)closeDialog; |