diff options
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | build/ios/grit_whitelist.txt | 1 | ||||
-rw-r--r-- | chrome/app/address_input_strings.grdp | 7 | ||||
-rw-r--r-- | chrome/browser/ui/autofill/autofill_dialog_i18n_input.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/autofill/data_model_wrapper.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/autofill_options_handler.cc | 3 | ||||
-rw-r--r-- | components/autofill/core/browser/address_i18n.cc | 8 | ||||
-rw-r--r-- | components/autofill/core/browser/address_i18n_unittest.cc | 4 | ||||
-rw-r--r-- | components/autofill/core/browser/autofill_profile_unittest.cc | 78 | ||||
-rw-r--r-- | third_party/libaddressinput/README.chromium | 4 | ||||
-rw-r--r-- | third_party/libaddressinput/chromium/addressinput_util.cc | 4 |
11 files changed, 75 insertions, 41 deletions
@@ -36,7 +36,7 @@ vars = { 'boringssl_git': 'https://boringssl.googlesource.com', # After changing nacl_revision, run 'glient sync' and check native_client/DEPS # to update other nacl_*_revision's. - 'libaddressinput_revision': '5e0f1290b83e59c0b3b0b3d23c060f1b134a1364', + 'libaddressinput_revision': 'b52a2aeb63a28914850f3ed81cd7fd26ecdd4cdc', # from svn revision 333 'libvpx_revision': 'ace65784417788374f0b19ce5a8abd06c9ccd007', 'sfntly_revision': '1bdaae8fc788a5ac8936d68bf24f37d977a13dac', 'skia_revision': '3e42a4638559d71481ba598857f2d0c715c8d4b3', diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt index 32c8ca7..63df896 100644 --- a/build/ios/grit_whitelist.txt +++ b/build/ios/grit_whitelist.txt @@ -613,6 +613,7 @@ IDS_LIBADDRESSINPUT_MISSING_REQUIRED_POSTAL_CODE_EXAMPLE_AND_URL IDS_LIBADDRESSINPUT_MISSING_REQUIRED_ZIP_CODE_EXAMPLE IDS_LIBADDRESSINPUT_MISSING_REQUIRED_ZIP_CODE_EXAMPLE_AND_URL IDS_LIBADDRESSINPUT_OBLAST +IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL IDS_LIBADDRESSINPUT_PARISH IDS_LIBADDRESSINPUT_POSTAL_CODE_LABEL IDS_LIBADDRESSINPUT_PO_BOX_FORBIDDEN_VALUE diff --git a/chrome/app/address_input_strings.grdp b/chrome/app/address_input_strings.grdp index 1b89e66..945205e 100644 --- a/chrome/app/address_input_strings.grdp +++ b/chrome/app/address_input_strings.grdp @@ -123,6 +123,13 @@ limitations under the License. State </message> <message + name="IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL" + desc="Label for the field of organization, firm, company, or institution + in an address. Examples of values in this field: Google, + Department of Transportation, University of Cambridge."> + Organization + </message> + <message name="IDS_LIBADDRESSINPUT_RECIPIENT_LABEL" desc="Label for the field for a person's name in an address."> Name diff --git a/chrome/browser/ui/autofill/autofill_dialog_i18n_input.cc b/chrome/browser/ui/autofill/autofill_dialog_i18n_input.cc index 5c31721..582a2b3 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_i18n_input.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_i18n_input.cc @@ -60,6 +60,9 @@ void BuildAddressInputs(common::AddressType address_type, for (size_t i = 0; i < components.size(); ++i) { const AddressUiComponent& component = components[i]; + // Interactive autofill dialog does not display organization. + if (component.field == ::i18n::addressinput::ORGANIZATION) + continue; ServerFieldType server_type = i18n::TypeForField(component.field, billing); DetailInput::Length length = LengthFromHint(component.length_hint); base::string16 placeholder = base::UTF8ToUTF16(component.name); diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc index ebb79a2..aa07d1c 100644 --- a/chrome/browser/ui/autofill/data_model_wrapper.cc +++ b/chrome/browser/ui/autofill/data_model_wrapper.cc @@ -61,6 +61,8 @@ bool DataModelWrapper::GetDisplayText( i18n::CreateAddressData( base::Bind(&DataModelWrapper::GetInfo, base::Unretained(this))); address_data->language_code = GetLanguageCode(); + // Interactive autofill dialog does not display organization field. + address_data->organization.clear(); std::vector<std::string> lines; ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines); diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc index 55bea13..755ef01 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.cc +++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc @@ -128,6 +128,9 @@ void GetAddressComponents(const std::string& country_code, case i18n::addressinput::STREET_ADDRESS: component->SetString(kField, kAddressLineField); break; + case i18n::addressinput::ORGANIZATION: + component->SetString(kField, kCompanyNameField); + break; case i18n::addressinput::RECIPIENT: component->SetString(kField, kFullNameField); component->SetString( diff --git a/components/autofill/core/browser/address_i18n.cc b/components/autofill/core/browser/address_i18n.cc index 5de5363..24af61a 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) diff --git a/components/autofill/core/browser/address_i18n_unittest.cc b/components/autofill/core/browser/address_i18n_unittest.cc index 72ec64a..d360b1d 100644 --- a/components/autofill/core/browser/address_i18n_unittest.cc +++ b/components/autofill/core/browser/address_i18n_unittest.cc @@ -26,6 +26,7 @@ using ::i18n::addressinput::ADMIN_AREA; using ::i18n::addressinput::COUNTRY; using ::i18n::addressinput::DEPENDENT_LOCALITY; using ::i18n::addressinput::LOCALITY; +using ::i18n::addressinput::ORGANIZATION; using ::i18n::addressinput::POSTAL_CODE; using ::i18n::addressinput::RECIPIENT; using ::i18n::addressinput::SORTING_CODE; @@ -44,6 +45,7 @@ TEST(AddressI18nTest, FieldTypeMirrorConversions) { {true, ADDRESS_BILLING_SORTING_CODE, SORTING_CODE}, {true, ADDRESS_BILLING_ZIP, POSTAL_CODE}, {true, ADDRESS_BILLING_STREET_ADDRESS, STREET_ADDRESS}, + {true, COMPANY_NAME, ORGANIZATION}, {true, NAME_BILLING_FULL, RECIPIENT}, {false, ADDRESS_HOME_COUNTRY, COUNTRY}, {false, ADDRESS_HOME_STATE, ADMIN_AREA}, @@ -52,6 +54,7 @@ TEST(AddressI18nTest, FieldTypeMirrorConversions) { {false, ADDRESS_HOME_SORTING_CODE, SORTING_CODE}, {false, ADDRESS_HOME_ZIP, POSTAL_CODE}, {false, ADDRESS_HOME_STREET_ADDRESS, STREET_ADDRESS}, + {false, COMPANY_NAME, ORGANIZATION}, {false, NAME_FULL, RECIPIENT}, }; @@ -115,6 +118,7 @@ TEST(AddressI18nTest, CreateAddressDataFromAutofillProfile) { expected.locality = "Elysium"; expected.postal_code = "91111"; expected.language_code = "en"; + expected.organization = "Underworld"; expected.recipient = "John H. Doe"; EXPECT_EQ(expected, *actual); diff --git a/components/autofill/core/browser/autofill_profile_unittest.cc b/components/autofill/core/browser/autofill_profile_unittest.cc index 1e31d0e..d5ea7cb 100644 --- a/components/autofill/core/browser/autofill_profile_unittest.cc +++ b/components/autofill/core/browser/autofill_profile_unittest.cc @@ -365,13 +365,13 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_CH) { "H. R. Giger, Brandschenkestrasse 110", "H. R. Giger, Brandschenkestrasse 110, Zurich", "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", - "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, Switzerland", - "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, Switzerland, " - "hrgiger@beispiel.com", - "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, Switzerland, " - "hrgiger@beispiel.com, +41446681800", - "H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, Switzerland, " - "hrgiger@beispiel.com, +41446681800, Beispiel Inc", + "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich", + "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " + "Switzerland", + "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " + "Switzerland, hrgiger@beispiel.com", + "Beispiel Inc, H. R. Giger, Brandschenkestrasse 110, CH-8002 Zurich, " + "Switzerland, hrgiger@beispiel.com, +41446681800", }; std::vector<base::string16> labels; @@ -410,13 +410,16 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_FR) { "Antoine de Saint-Exupéry, 8 Rue de Londres, Paris", "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris", "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX", - "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX, France", - "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX, France, " - "antoine@exemple.com", - "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX, France, " - "antoine@exemple.com, +33142685300", - "Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris CEDEX, France, " - "antoine@exemple.com, +33142685300, Exemple Inc", + "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " + "CEDEX", + "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " + "CEDEX, France", + "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " + "CEDEX, France, antoine@exemple.com", + "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " + "CEDEX, France, antoine@exemple.com, +33142685300", + "Exemple Inc, Antoine de Saint-Exupéry, 8 Rue de Londres, 75009 Paris " + "CEDEX, France, antoine@exemple.com, +33142685300", }; std::vector<base::string16> labels; @@ -460,16 +463,16 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_KR) { "Gangnam-Gu, Seoul", "Park Jae-sang, Gangnam Finance Center, 152 Teheran-ro, Yeoksam-Dong, " "Gangnam-Gu, Seoul, 135-984", - "Park Jae-sang, Gangnam Finance Center, 152 Teheran-ro, Yeoksam-Dong, " - "Gangnam-Gu, Seoul, 135-984, South Korea", - "Park Jae-sang, Gangnam Finance Center, 152 Teheran-ro, Yeoksam-Dong, " - "Gangnam-Gu, Seoul, 135-984, South Korea, park@yeleul.com", - "Park Jae-sang, Gangnam Finance Center, 152 Teheran-ro, Yeoksam-Dong, " - "Gangnam-Gu, Seoul, 135-984, South Korea, park@yeleul.com, " - "+8225319000", - "Park Jae-sang, Gangnam Finance Center, 152 Teheran-ro, Yeoksam-Dong, " - "Gangnam-Gu, Seoul, 135-984, South Korea, park@yeleul.com, " - "+8225319000, Yeleul Inc", + "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " + "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984", + "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " + "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea", + "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " + "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " + "park@yeleul.com", + "Park Jae-sang, Yeleul Inc, Gangnam Finance Center, 152 Teheran-ro, " + "Yeoksam-Dong, Gangnam-Gu, Seoul, 135-984, South Korea, " + "park@yeleul.com, +8225319000", }; std::vector<base::string16> labels; @@ -508,14 +511,14 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_JP_Latn) { "Tokyo", "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " "Tokyo, 106-6126", - "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " - "Tokyo, 106-6126, Japan", - "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " - "Tokyo, 106-6126, Japan, miku@rei.com", - "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " - "Tokyo, 106-6126, Japan, miku@rei.com, +81363849000", - "Miku Hatsune, Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, " - "Tokyo, 106-6126, Japan, miku@rei.com, +81363849000, Rei Inc", + "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " + "Minato-ku, Tokyo, 106-6126", + "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " + "Minato-ku, Tokyo, 106-6126, Japan", + "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " + "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com", + "Miku Hatsune, Rei Inc, Roppongi Hills Mori Tower, 6-10-1 Roppongi, " + "Minato-ku, Tokyo, 106-6126, Japan, miku@rei.com, +81363849000", }; std::vector<base::string16> labels; @@ -552,13 +555,12 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_JP_ja) { "港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", "東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音", - "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音, Japan", - "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音, Japan, " + "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音", + "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan", + "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " "miku@rei.com", - "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音, Japan, " + "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1例ミク 初音, Japan, " "miku@rei.com, 0363849000", - "〒106-6126東京都港区六本木ヒルズ森タワー六本木 6-10-1ミク 初音, Japan, " - "miku@rei.com, 0363849000, 例", }; std::vector<base::string16> labels; @@ -1193,6 +1195,7 @@ TEST(AutofillProfileTest, FullAddress) { AutofillType full_address(HTML_TYPE_FULL_ADDRESS, HTML_MODE_NONE); base::string16 formatted_address(ASCIIToUTF16( "Marion Mitchell Morrison\n" + "Fox\n" "123 Zoo St.\n" "unit 5\n" "Hollywood, CA 91601")); @@ -1209,6 +1212,7 @@ TEST(AutofillProfileTest, FullAddress) { base::string16(), "en-US"); EXPECT_EQ(ASCIIToUTF16("Marion Mitchell Morrison\n" + "Fox\n" "123 Zoo St.\n" "Hollywood, CA 91601"), profile.GetInfo(full_address, "en-US")); diff --git a/third_party/libaddressinput/README.chromium b/third_party/libaddressinput/README.chromium index 41a3945..ac60837 100644 --- a/third_party/libaddressinput/README.chromium +++ b/third_party/libaddressinput/README.chromium @@ -2,8 +2,8 @@ Name: The library to input, validate, and display addresses. Short Name: libaddressinput URL: https://code.google.com/p/libaddressinput/ Version: 0 -Date: 10 August 2014 -Revision: 327 +Date: 21 August 2014 +Revision: 333 License: Apache 2.0 License File: LICENSE Security Critical: no diff --git a/third_party/libaddressinput/chromium/addressinput_util.cc b/third_party/libaddressinput/chromium/addressinput_util.cc index d9e6725..bda2778 100644 --- a/third_party/libaddressinput/chromium/addressinput_util.cc +++ b/third_party/libaddressinput/chromium/addressinput_util.cc @@ -57,7 +57,9 @@ void ValidateRequiredFields( ::i18n::addressinput::SORTING_CODE, ::i18n::addressinput::POSTAL_CODE, ::i18n::addressinput::STREET_ADDRESS, - ::i18n::addressinput::RECIPIENT}; + // ORGANIZATION is never required. + ::i18n::addressinput::RECIPIENT + }; for (size_t i = 0; i < arraysize(kFields); ++i) { AddressField field = kFields[i]; |