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

Unified Diff: chrome/browser/payments/chrome_payment_request_delegate.cc

Issue 2829503002: [Payments] Normalize Shipping Address sent to merchant on Desktop. (Closed)
Patch Set: Be more strict on country code Created 3 years, 8 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/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..9fc817a502c2037dec8142874f7f3d1e2b82b7cd 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -20,7 +20,11 @@ namespace payments {
ChromePaymentRequestDelegate::ChromePaymentRequestDelegate(
content::WebContents* web_contents)
- : dialog_(nullptr), web_contents_(web_contents) {}
+ : dialog_(nullptr),
+ web_contents_(web_contents),
+ address_normalizer_(GetAddressInputSource(), GetAddressInputStorage()) {}
+
+ChromePaymentRequestDelegate::~ChromePaymentRequestDelegate() {}
void ChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) {
DCHECK_EQ(nullptr, dialog_);
@@ -71,7 +75,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 +86,8 @@ ChromePaymentRequestDelegate::GetAddressInputStorage() {
return autofill::ValidationRulesStorageFactory::CreateStorage();
}
+AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() {
+ return &address_normalizer_;
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698