Index: chrome/browser/payments/chrome_payment_request_delegate.cc |
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc |
index 44126e7a6d82c7147011ead9bdee0e8fe8379eff..8353b7626b68f36e7dd357018880869382ad531c 100644 |
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc |
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc |
@@ -12,6 +12,7 @@ |
#include "chrome/browser/ui/browser_dialogs.h" |
#include "components/autofill/core/browser/personal_data_manager.h" |
#include "components/payments/content/payment_request_dialog.h" |
+#include "components/payments/core/address_normalizer.h" |
#include "content/public/browser/web_contents.h" |
#include "third_party/libaddressinput/chromium/chrome_metadata_source.h" |
#include "third_party/libaddressinput/chromium/chrome_storage_impl.h" |
@@ -20,7 +21,12 @@ namespace payments { |
ChromePaymentRequestDelegate::ChromePaymentRequestDelegate( |
content::WebContents* web_contents) |
- : dialog_(nullptr), web_contents_(web_contents) {} |
+ : dialog_(nullptr), web_contents_(web_contents) { |
+ address_normalizer_ = base::MakeUnique<AddressNormalizer>( |
anthonyvd
2017/04/20 16:59:22
nit: initialize this in the initialization list ab
sebsg
2017/04/20 19:18:39
Done.
|
+ GetAddressInputSource(), GetAddressInputStorage()); |
+} |
+ |
+ChromePaymentRequestDelegate::~ChromePaymentRequestDelegate() {} |
void ChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) { |
DCHECK_EQ(nullptr, dialog_); |
@@ -71,7 +77,7 @@ void ChromePaymentRequestDelegate::DoFullCardRequest( |
dialog_->ShowCvcUnmaskPrompt(credit_card, result_delegate, web_contents_); |
} |
-std::unique_ptr<const ::i18n::addressinput::Source> |
+std::unique_ptr<::i18n::addressinput::Source> |
ChromePaymentRequestDelegate::GetAddressInputSource() { |
return base::WrapUnique(new autofill::ChromeMetadataSource( |
I18N_ADDRESS_VALIDATION_DATA_URL, |
@@ -82,4 +88,8 @@ ChromePaymentRequestDelegate::GetAddressInputStorage() { |
return autofill::ValidationRulesStorageFactory::CreateStorage(); |
} |
+AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() { |
+ return address_normalizer_.get(); |
+} |
+ |
} // namespace payments |