diff options
author | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 19:20:39 +0000 |
---|---|---|
committer | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 19:20:39 +0000 |
commit | 530d72d25d1005799558b934be8b1175703762f2 (patch) | |
tree | b120258663a926a4d8b8e5458eaf3ec78d8a4ff9 /chrome/browser/ui | |
parent | 8e3cd86e323e5574a238c117e10af73ef5bea52a (diff) | |
download | chromium_src-530d72d25d1005799558b934be8b1175703762f2.zip chromium_src-530d72d25d1005799558b934be8b1175703762f2.tar.gz chromium_src-530d72d25d1005799558b934be8b1175703762f2.tar.bz2 |
Revert 168247 - more autofill refactoring
makes AutofillProfile and CreditCard better resemble one another. Much code deleted.
BUG=none
Review URL: https://codereview.chromium.org/11312259
TBR=estade@chromium.org
Failed some Autofill related sync tests:
http://build.chromium.org/p/chromium.mac/builders/Mac10.6%20Sync/builds/24913
Review URL: https://codereview.chromium.org/11413043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/webui/options/autofill_options_handler.cc | 24 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/autofill_options_handler.h | 10 |
2 files changed, 27 insertions, 7 deletions
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc index 4976c82..29f00d6 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.cc +++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc @@ -318,8 +318,12 @@ void AutofillOptionsHandler::InitializePage() { void AutofillOptionsHandler::RegisterMessages() { web_ui()->RegisterMessageCallback( - "removeData", - base::Bind(&AutofillOptionsHandler::RemoveData, + "removeAddress", + base::Bind(&AutofillOptionsHandler::RemoveAddress, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "removeCreditCard", + base::Bind(&AutofillOptionsHandler::RemoveCreditCard, base::Unretained(this))); web_ui()->RegisterMessageCallback( "loadAddressEditor", @@ -436,7 +440,19 @@ void AutofillOptionsHandler::LoadAutofillData() { credit_cards); } -void AutofillOptionsHandler::RemoveData(const ListValue* args) { +void AutofillOptionsHandler::RemoveAddress(const ListValue* args) { + DCHECK(IsPersonalDataLoaded()); + + std::string guid; + if (!args->GetString(0, &guid)) { + NOTREACHED(); + return; + } + + personal_data_->RemoveProfile(guid); +} + +void AutofillOptionsHandler::RemoveCreditCard(const ListValue* args) { DCHECK(IsPersonalDataLoaded()); std::string guid; @@ -445,7 +461,7 @@ void AutofillOptionsHandler::RemoveData(const ListValue* args) { return; } - personal_data_->RemoveByGUID(guid); + personal_data_->RemoveCreditCard(guid); } void AutofillOptionsHandler::LoadAddressEditor(const ListValue* args) { diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.h b/chrome/browser/ui/webui/options/autofill_options_handler.h index b88639f..6356487 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.h +++ b/chrome/browser/ui/webui/options/autofill_options_handler.h @@ -44,9 +44,13 @@ class AutofillOptionsHandler : public OptionsPageUIHandler, // Loads Autofill addresses and credit cards using the PersonalDataManager. void LoadAutofillData(); - // Removes data from the PersonalDataManager. - // |args| - A string, the GUID of the address or credit card to remove. - void RemoveData(const base::ListValue* args); + // Removes an address from the PersonalDataManager. + // |args| - A string, the GUID of the address to remove. + void RemoveAddress(const base::ListValue* args); + + // Removes a credit card from the PersonalDataManager. + // |args| - A string, the GUID of the credit card to remove. + void RemoveCreditCard(const base::ListValue* args); // Requests profile data for a specific address. Calls into WebUI with the // loaded profile data to open the address editor. |