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

Unified Diff: components/autofill/core/browser/address_i18n.cc

Issue 490373002: Add back organization field for autofill settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Git migration. Created 6 years, 4 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
Index: components/autofill/core/browser/address_i18n.cc
diff --git a/components/autofill/core/browser/address_i18n.cc b/components/autofill/core/browser/address_i18n.cc
index 5de53637787f0da507975f775b3d26adec1ab5ad..24af61ae1a37a47030b35df8116bbfdd40952466 100644
--- a/components/autofill/core/browser/address_i18n.cc
+++ b/components/autofill/core/browser/address_i18n.cc
@@ -34,6 +34,8 @@ scoped_ptr<AddressData> CreateAddressData(
scoped_ptr<AddressData> address_data(new AddressData());
address_data->recipient = base::UTF16ToUTF8(
get_info.Run(AutofillType(NAME_FULL)));
+ address_data->organization = base::UTF16ToUTF8(
+ get_info.Run(AutofillType(COMPANY_NAME)));
address_data->region_code = base::UTF16ToUTF8(
get_info.Run(AutofillType(HTML_TYPE_COUNTRY_CODE, HTML_MODE_NONE)));
address_data->administrative_area = base::UTF16ToUTF8(
@@ -81,6 +83,8 @@ ServerFieldType TypeForField(AddressField address_field, bool billing) {
case ::i18n::addressinput::STREET_ADDRESS:
return billing ? ADDRESS_BILLING_STREET_ADDRESS
: ADDRESS_HOME_STREET_ADDRESS;
+ case ::i18n::addressinput::ORGANIZATION:
+ return COMPANY_NAME;
case ::i18n::addressinput::RECIPIENT:
return billing ? NAME_BILLING_FULL : NAME_FULL;
}
@@ -129,6 +133,10 @@ bool FieldForType(ServerFieldType server_type, AddressField* field) {
if (field)
*field = ::i18n::addressinput::STREET_ADDRESS;
return true;
+ case COMPANY_NAME:
+ if (field)
+ *field = ::i18n::addressinput::ORGANIZATION;
+ return true;
case NAME_BILLING_FULL:
case NAME_FULL:
if (field)
« no previous file with comments | « chrome/browser/ui/webui/options/autofill_options_handler.cc ('k') | components/autofill/core/browser/address_i18n_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698