Commit af38db52 authored by Anthony Vallee-Dubois's avatar Anthony Vallee-Dubois Committed by Commit Bot

[Web Payments] Display multiline addresses correctly in editor.

Bug: 735103
Change-Id: I54ac93cf34a37144dbf257d5f3768af64e319151
Reviewed-on: https://chromium-review.googlesource.com/595027Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Commit-Queue: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491744}
parent 262c6b42
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "chrome/browser/ui/views/payments/validating_combobox.h" #include "chrome/browser/ui/views/payments/validating_combobox.h"
#include "chrome/browser/ui/views/payments/validating_textfield.h" #include "chrome/browser/ui/views/payments/validating_textfield.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/autofill/core/browser/address_i18n.h"
#include "components/autofill/core/browser/autofill_address_util.h" #include "components/autofill/core/browser/autofill_address_util.h"
#include "components/autofill/core/browser/autofill_country.h" #include "components/autofill/core/browser/autofill_country.h"
#include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/autofill_type.h"
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
#include "components/payments/core/payments_profile_comparator.h" #include "components/payments/core/payments_profile_comparator.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "third_party/libaddressinput/messages.h" #include "third_party/libaddressinput/messages.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" #include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield.h"
...@@ -127,6 +130,15 @@ base::string16 ShippingAddressEditorViewController::GetInitialValueForType( ...@@ -127,6 +130,15 @@ base::string16 ShippingAddressEditorViewController::GetInitialValueForType(
return initial_region; return initial_region;
} }
if (type == autofill::ADDRESS_HOME_STREET_ADDRESS) {
std::string street_address_line;
i18n::addressinput::GetStreetAddressLinesAsSingleLine(
*autofill::i18n::CreateAddressDataFromAutofillProfile(
temporary_profile_, state()->GetApplicationLocale()),
&street_address_line);
return base::UTF8ToUTF16(street_address_line);
}
return temporary_profile_.GetInfo(autofill::AutofillType(type), return temporary_profile_.GetInfo(autofill::AutofillType(type),
state()->GetApplicationLocale()); state()->GetApplicationLocale());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment