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

Unified Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc

Issue 2888413006: [Payment Request] Moves autofill utility function to autofill_address_util.h (Closed)
Patch Set: Addressed comment Created 3 years, 7 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_address_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
index 486e308e03f624cd9a3e1f60c89a31570b161647..ebe0812446bbfce7a5174adea32fc73e132b0b4d 100644
--- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
@@ -35,32 +35,6 @@ namespace payments {
namespace {
-// Converts a field type in string format as returned by
-// autofill::GetAddressComponents into the appropriate autofill::ServerFieldType
-// enum.
-autofill::ServerFieldType GetFieldTypeFromString(const std::string& type) {
- if (type == autofill::kFullNameField)
- return autofill::NAME_FULL;
- if (type == autofill::kCompanyNameField)
- return autofill::COMPANY_NAME;
- if (type == autofill::kAddressLineField)
- return autofill::ADDRESS_HOME_STREET_ADDRESS;
- if (type == autofill::kDependentLocalityField)
- return autofill::ADDRESS_HOME_DEPENDENT_LOCALITY;
- if (type == autofill::kCityField)
- return autofill::ADDRESS_HOME_CITY;
- if (type == autofill::kStateField)
- return autofill::ADDRESS_HOME_STATE;
- if (type == autofill::kPostalCodeField)
- return autofill::ADDRESS_HOME_ZIP;
- if (type == autofill::kSortingCodeField)
- return autofill::ADDRESS_HOME_SORTING_CODE;
- if (type == autofill::kCountryField)
- return autofill::ADDRESS_HOME_COUNTRY;
- NOTREACHED();
- return autofill::UNKNOWN_TYPE;
-}
-
// size_t doesn't have a defined maximum value, so this is a trick to create one
// as is done for std::string::npos.
// http://www.cplusplus.com/reference/string/string/npos
@@ -334,7 +308,7 @@ void ShippingAddressEditorViewController::UpdateEditorFields() {
else
DCHECK_EQ(autofill::kShortField, field_length);
autofill::ServerFieldType server_field_type =
- GetFieldTypeFromString(field_type);
+ autofill::GetFieldTypeFromString(field_type);
EditorField::ControlType control_type =
EditorField::ControlType::TEXTFIELD;
if (server_field_type == autofill::ADDRESS_HOME_COUNTRY ||
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_address_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698