Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: chrome/browser/autofill/auto_fill_editor_gtk.cc

Issue 3031030: [GTK] Don't offer profiles for billing addresses that have no address ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/auto_fill_editor_gtk.cc
===================================================================
--- chrome/browser/autofill/auto_fill_editor_gtk.cc (revision 53940)
+++ chrome/browser/autofill/auto_fill_editor_gtk.cc (working copy)
@@ -631,7 +631,7 @@
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 @@
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698