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

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

Issue 442403002: Adjust displayed phone number for prefix/suffix case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove duplicate code. 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/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 26816f8f0a3e20668849938e4d46367157bdd4f2..e7969bfb661acc981cb427909c8bcee2bd6262cd 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -508,6 +508,24 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
metric_logger_->LogAddressSuggestionsCount(values.size());
has_logged_address_suggestions_count_ = true;
}
+
+ // Adjust phone number to display in prefix/suffix case.
+ FormData result = form;
+ if (type.GetStorableType() == PHONE_HOME_NUMBER) {
+ for (std::vector<FormFieldData>::iterator iter =
+ result.fields.begin();
+ iter != result.fields.end();
+ ++iter) {
+ if ((*iter) == field) {
+ for (size_t i = 0; i < values.size(); ++i) {
+ base::string16 value;
+ AutofillField::GetPhoneNumberValue(
+ *autofill_field, values[i], &(*iter), &value);
+ values[i] = value;
+ }
+ }
+ }
+ }
Ilya Sherman 2014/09/03 00:55:49 Can all of this be done in the method that assigns
ziran.sun 2014/09/04 13:10:25 I'm not sure this change is related to phone numbe
Ilya Sherman 2014/09/11 05:32:14 Sorry, you're right that I got labels and values s
ziran.sun 2014/09/22 13:46:33 Done.
}
}
}

Powered by Google App Engine
This is Rietveld 408576698