summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:19:12 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 18:19:12 +0000
commit0f841b0202af2e943cb7c74be63c06fad09e3abc (patch)
tree16c26aeff9cc27c7bb4a3d51c90a0e6be5e022aa /chrome
parent2caf4d005cb3b86b61ae559f08f2493e19129e3f (diff)
downloadchromium_src-0f841b0202af2e943cb7c74be63c06fad09e3abc.zip
chromium_src-0f841b0202af2e943cb7c74be63c06fad09e3abc.tar.gz
chromium_src-0f841b0202af2e943cb7c74be63c06fad09e3abc.tar.bz2
[GTK] Don't offer profiles for billing addresses that have no address
data. BUG=http://crbug.com/50081 TEST=as in bug Review URL: http://codereview.chromium.org/3031030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill/auto_fill_editor_gtk.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/browser/autofill/auto_fill_editor_gtk.cc b/chrome/browser/autofill/auto_fill_editor_gtk.cc
index 0934b5f..c6fab96 100644
--- a/chrome/browser/autofill/auto_fill_editor_gtk.cc
+++ b/chrome/browser/autofill/auto_fill_editor_gtk.cc
@@ -631,7 +631,7 @@ AutoFillCreditCardEditor::AutoFillCreditCardEditor(
SetWidgetValues(credit_card);
} else {
// We're creating a new credit card. Select a default billing address (if
- // there are any) and select Januay of next year.
+ // there are any) and select January of next year.
PersonalDataManager* data_manager = profile_->GetPersonalDataManager();
if (!data_manager->profiles().empty())
gtk_combo_box_set_active(GTK_COMBO_BOX(address_), 0);
@@ -661,6 +661,20 @@ GtkListStore* AutoFillCreditCardEditor::CreateAddressStore() {
for (std::vector<AutoFillProfile*>::const_iterator i =
data_manager->profiles().begin();
i != data_manager->profiles().end(); ++i) {
+ FieldTypeSet fields;
+ (*i)->GetAvailableFieldTypes(&fields);
+ if (fields.find(ADDRESS_HOME_LINE1) == fields.end() &&
+ fields.find(ADDRESS_HOME_LINE2) == fields.end() &&
+ fields.find(ADDRESS_HOME_APT_NUM) == fields.end() &&
+ fields.find(ADDRESS_HOME_CITY) == fields.end() &&
+ fields.find(ADDRESS_HOME_STATE) == fields.end() &&
+ fields.find(ADDRESS_HOME_ZIP) == fields.end() &&
+ fields.find(ADDRESS_HOME_COUNTRY) == fields.end()) {
+ // No address information in this profile; it's useless as a billing
+ // address.
+ continue;
+ }
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(
store, &iter,