summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_manager_unittest.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 22:10:39 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 22:10:39 +0000
commit8da04b85b1e9c88d636175c01c218adf6dc4b768 (patch)
tree2ba197d18ba61861da39e2a03dd3a5df8efd9c42 /chrome/browser/autofill/autofill_manager_unittest.cc
parent97525370580abfdde511db31db159aa064b2cbda (diff)
downloadchromium_src-8da04b85b1e9c88d636175c01c218adf6dc4b768.zip
chromium_src-8da04b85b1e9c88d636175c01c218adf6dc4b768.tar.gz
chromium_src-8da04b85b1e9c88d636175c01c218adf6dc4b768.tar.bz2
retry r168247: more autofill refactoring
makes AutofillProfile and CreditCard better resemble one another. Much code deleted. BUG=none fix: revert change to guid() that made it return a reference. Review URL: https://codereview.chromium.org/11299046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_manager_unittest.cc')
-rw-r--r--chrome/browser/autofill/autofill_manager_unittest.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index 9da139f..e355947 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -106,20 +106,20 @@ class TestPersonalDataManager : public PersonalDataManager {
credit_cards_.push_back(credit_card);
}
- virtual void RemoveProfile(const std::string& guid) OVERRIDE {
- AutofillProfile* profile = GetProfileWithGUID(guid.c_str());
-
- web_profiles_.erase(
- std::remove(web_profiles_.begin(), web_profiles_.end(), profile),
- web_profiles_.end());
- }
-
- virtual void RemoveCreditCard(const std::string& guid) OVERRIDE {
+ virtual void RemoveByGUID(const std::string& guid) OVERRIDE {
CreditCard* credit_card = GetCreditCardWithGUID(guid.c_str());
+ if (credit_card) {
+ credit_cards_.erase(
+ std::remove(credit_cards_.begin(), credit_cards_.end(), credit_card),
+ credit_cards_.end());
+ }
- credit_cards_.erase(
- std::remove(credit_cards_.begin(), credit_cards_.end(), credit_card),
- credit_cards_.end());
+ AutofillProfile* profile = GetProfileWithGUID(guid.c_str());
+ if (profile) {
+ web_profiles_.erase(
+ std::remove(web_profiles_.begin(), web_profiles_.end(), profile),
+ web_profiles_.end());
+ }
}
void ClearAutofillProfiles() {