Use address formatter from libaddressinput for autofill profile labels.
commitb67e2777c19bf66b4a74cfe4bbbb92b12504bcbc
authorrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 19 Aug 2014 02:04:33 +0000 (19 02:04 +0000)
committerrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 19 Aug 2014 02:06:05 +0000 (19 02:06 +0000)
tree4d4bb2ea8662b28b07d9f56d4b828dff37b97fab
parent820447cf0773f58caccfa6fd352696479c396c42
Use address formatter from libaddressinput for autofill profile labels.

This patch modifies AutofillProfile::ConstructInferredLabel() to use
i18n::addressinput::GetFormattedNationalAddressLine() instead of manual
comma-separated concatenation.

Screenshots in http://crbug.com/270261#c41.

Examples of label changes:

- "Los Angeles, CA, 90291"
+ "Los Angeles, CA 90291"

- "Brandschenkestrasse 110, Zürich, 8002"
+ "Brandschenkestrasse 110, CH-8002 Zürich"

- "都港区六本木, 東京都, 106-6126"
+ "〒106-6126東京都都港区六本木"

If libaddressinput cannot handle a field (e.g. phone, email, sorting
code in US, state in CH), then ConstructInferredLabel falls back to
commas.

BUG=270261
TBR=estade@chromium.org

Review URL: https://codereview.chromium.org/436913002

Cr-Commit-Position: refs/heads/master@{#290452}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290452 0039d316-1c4b-4281-b951-d872f2087c98
components/autofill/core/browser/address_i18n_unittest.cc [new file with mode: 0644]
components/autofill/core/browser/autofill_profile.cc
components/autofill/core/browser/autofill_profile_unittest.cc
components/components_tests.gyp