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

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

Issue 1553833002: Display phone number with formatting in Autofill profile summary label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests Created 4 years, 12 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/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index b828bb614983ffc7a6914042129dcc80c2c41b20..e055fa6c349125eae49f82edf41becaebc7d33ca 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -859,7 +859,7 @@ base::string16 AutofillProfile::ConstructInferredLabel(
}
AutofillType autofill_type(*it);
- const base::string16& field_value = GetInfo(autofill_type, app_locale);
+ base::string16 field_value = GetInfo(autofill_type, app_locale);
if (field_value.empty())
continue;
@@ -878,7 +878,13 @@ base::string16 AutofillProfile::ConstructInferredLabel(
remaining_fields.begin();
it != remaining_fields.end() && num_fields_to_use > 0;
++it) {
- const base::string16& field_value = GetInfo(AutofillType(*it), app_locale);
+ base::string16 field_value;
+ // Special case whole numbers: we want the user-formatted (raw) version, not
+ // the canonicalized version we'll fill into the page.
+ if (*it == PHONE_HOME_WHOLE_NUMBER)
+ field_value = GetRawInfo(*it);
+ else
+ field_value = GetInfo(AutofillType(*it), app_locale);
if (field_value.empty())
continue;

Powered by Google App Engine
This is Rietveld 408576698