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

Unified Diff: chrome/browser/ui/autofill/data_model_wrapper.cc

Issue 298863012: Use upstream libaddressinput in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review. Created 6 years, 6 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: chrome/browser/ui/autofill/data_model_wrapper.cc
diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc
index 4d513a2cf0d592773c6f3720a265895300e65ecd..a57b68cf34982a2bd5630a79397f45961b10158a 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper.cc
+++ b/chrome/browser/ui/autofill/data_model_wrapper.cc
@@ -22,8 +22,9 @@
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/form_structure.h"
-#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h"
-#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_ui.h"
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h"
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_field.h"
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_formatter.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
@@ -61,7 +62,7 @@ bool DataModelWrapper::GetDisplayText(
base::Bind(&DataModelWrapper::GetInfo, base::Unretained(this)));
address_data->language_code = GetLanguageCode();
std::vector<std::string> lines;
- address_data->FormatForDisplay(&lines);
+ ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines);
// Email and phone number aren't part of address formatting.
base::string16 non_address_info;
@@ -72,8 +73,9 @@ bool DataModelWrapper::GetDisplayText(
non_address_info += base::ASCIIToUTF16("\n") + phone;
// The separator is locale-specific.
- std::string compact_separator =
- ::i18n::addressinput::GetCompactAddressLinesSeparator(GetLanguageCode());
+ std::string compact_separator = ", ";
+ // ::i18n::addressinput::GetCompactAddressLinesSeparator(
+ // GetLanguageCode());
please use gerrit instead 2014/06/05 22:22:48 Use ::i18n::addressinput::GetStreetAddressLinesAsS
please use gerrit instead 2014/06/09 23:28:16 Done.
*vertically_compact =
base::UTF8ToUTF16(JoinString(lines, compact_separator)) +
non_address_info;
@@ -391,7 +393,7 @@ base::string16 I18nAddressDataWrapper::GetInfo(const AutofillType& type) const {
return base::string16();
if (field == ::i18n::addressinput::COUNTRY) {
- return AutofillCountry(address_->country_code,
+ return AutofillCountry(address_->region_code,
g_browser_process->GetApplicationLocale()).name();
}

Powered by Google App Engine
This is Rietveld 408576698