diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 22:01:17 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 22:01:17 +0000 |
commit | 9c6d006761c3313f7fe81ff304d10a6c02400622 (patch) | |
tree | 238158837a6f8800c5d2a0a2faa9434fffbbd718 /chrome/browser/autofill/personal_data_manager.cc | |
parent | 58555ce035571ee7d8620dd3e57cc7bf1adfd9b2 (diff) | |
download | chromium_src-9c6d006761c3313f7fe81ff304d10a6c02400622.zip chromium_src-9c6d006761c3313f7fe81ff304d10a6c02400622.tar.gz chromium_src-9c6d006761c3313f7fe81ff304d10a6c02400622.tar.bz2 |
AutoFill: Segregate profile and credit card filling.
* Refactor suggestions filling into Get[Profile,CreditCard]Suggestions.
* Don't fill the default credit card when the AutoFill shortcut is initiated.
* Don't fill the default credit card when filling the profile.
BUG=41334
TEST=none
Review URL: http://codereview.chromium.org/1619029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/personal_data_manager.cc')
-rw-r--r-- | chrome/browser/autofill/personal_data_manager.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc index 664bbed..254fd06 100644 --- a/chrome/browser/autofill/personal_data_manager.cc +++ b/chrome/browser/autofill/personal_data_manager.cc @@ -364,7 +364,6 @@ void PersonalDataManager::GetPossibleFieldTypes(const string16& text, InitializeIfNeeded(); string16 clean_info = StringToLowerASCII(CollapseWhitespace(text, false)); - if (clean_info.empty()) { possible_types->insert(EMPTY_TYPE); return; @@ -377,6 +376,7 @@ void PersonalDataManager::GetPossibleFieldTypes(const string16& text, DLOG(ERROR) << "NULL information in profiles list"; continue; } + profile->GetPossibleFieldTypes(clean_info, possible_types); } @@ -387,6 +387,7 @@ void PersonalDataManager::GetPossibleFieldTypes(const string16& text, DLOG(ERROR) << "NULL information in credit cards list"; continue; } + credit_card->GetPossibleFieldTypes(clean_info, possible_types); } @@ -400,6 +401,10 @@ bool PersonalDataManager::HasPassword() { } const std::vector<AutoFillProfile*>& PersonalDataManager::profiles() { + // |profile_| is NULL in AutoFillManagerTest. + if (!profile_) + return web_profiles_.get(); + bool auxiliary_profiles_enabled = profile_->GetPrefs()->GetBoolean( prefs::kAutoFillAuxiliaryProfilesEnabled); if (auxiliary_profiles_enabled) { |