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

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

Issue 2888413006: [Payment Request] Moves autofill utility function to autofill_address_util.h (Closed)
Patch Set: 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 | « components/autofill/core/browser/autofill_address_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_address_util.cc
diff --git a/components/autofill/core/browser/autofill_address_util.cc b/components/autofill/core/browser/autofill_address_util.cc
index c232e0026513379e93b646177282b74d02c7b41f..058a7dc0da251eede853b094fa09d79a5a844c08 100644
--- a/components/autofill/core/browser/autofill_address_util.cc
+++ b/components/autofill/core/browser/autofill_address_util.cc
@@ -11,7 +11,6 @@
#include "base/values.h"
#include "components/autofill/core/browser/autofill_country.h"
#include "components/autofill/core/browser/country_combobox_model.h"
-#include "components/autofill/core/browser/field_types.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui_component.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/localization.h"
@@ -43,6 +42,29 @@ const char kCountryField[] = "country";
const char kShortField[] = "short";
const char kLongField[] = "long";
+ServerFieldType GetFieldTypeFromString(const std::string& type) {
+ if (type == kFullNameField)
+ return NAME_FULL;
+ if (type == kCompanyNameField)
+ return COMPANY_NAME;
+ if (type == kAddressLineField)
+ return ADDRESS_HOME_STREET_ADDRESS;
+ if (type == kDependentLocalityField)
+ return ADDRESS_HOME_DEPENDENT_LOCALITY;
+ if (type == kCityField)
+ return ADDRESS_HOME_CITY;
+ if (type == kStateField)
+ return ADDRESS_HOME_STATE;
+ if (type == kPostalCodeField)
+ return ADDRESS_HOME_ZIP;
+ if (type == kSortingCodeField)
+ return ADDRESS_HOME_SORTING_CODE;
+ if (type == kCountryField)
+ return ADDRESS_HOME_COUNTRY;
+ NOTREACHED();
please use gerrit instead 2017/05/19 18:46:53 #include "base/logging.h"
Moe 2017/05/19 19:09:12 Done.
+ return UNKNOWN_TYPE;
+}
+
// Fills |components| with the address UI components that should be used to
// input an address for |country_code| when UI BCP 47 language code is
// |ui_language_code|. If |components_language_code| is not NULL, then sets it
« no previous file with comments | « components/autofill/core/browser/autofill_address_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698