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

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

Issue 298863012: Use upstream libaddressinput in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work in progress for suggestions impl. 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: 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 fc3f39ef259b0e1c54be6dda1f67e2a2c2851ca5..b822d3b5255ddfdd58bdd03911dd6ab433ac2ead 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -26,7 +26,9 @@
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/form_field_data.h"
#include "grit/components_strings.h"
-#include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/address_data.h"
+#include "third_party/libaddressinput/chromium/has_all_required_fields.h"
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h"
+#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_formatter.h"
#include "ui/base/l10n/l10n_util.h"
using base::ASCIIToUTF16;
@@ -298,11 +300,11 @@ base::string16 AutofillProfile::GetInfo(const AutofillType& type,
if (type.html_type() == HTML_TYPE_FULL_ADDRESS) {
scoped_ptr< ::i18n::addressinput::AddressData> address_data =
i18n::CreateAddressDataFromAutofillProfile(*this, app_locale);
- if (!address_data->HasAllRequiredFields())
+ if (!HasAllRequiredFields(*address_data))
return base::string16();
std::vector<std::string> lines;
- address_data->FormatForDisplay(&lines);
+ ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines);
return base::UTF8ToUTF16(JoinString(lines, '\n'));
}

Powered by Google App Engine
This is Rietveld 408576698