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

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

Issue 2829503002: [Payments] Normalize Shipping Address sent to merchant on Desktop. (Closed)
Patch Set: Addressed Anthony's comment 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..8856757f6f72dc239f71744c6c3d1d595b083d26 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,13 @@ namespace payments {
ChromePaymentRequestDelegate::ChromePaymentRequestDelegate(
content::WebContents* web_contents)
- : dialog_(nullptr), web_contents_(web_contents) {}
+ : dialog_(nullptr),
+ web_contents_(web_contents),
+ address_normalizer_(
please use gerrit instead 2017/04/20 20:15:20 address_normalizer_(GetAddressInputSource(), GetAd
sebsg 2017/04/20 21:06:19 Done.
+ base::MakeUnique<AddressNormalizer>(GetAddressInputSource(),
+ GetAddressInputStorage())) {}
+
+ChromePaymentRequestDelegate::~ChromePaymentRequestDelegate() {}
void ChromePaymentRequestDelegate::ShowDialog(PaymentRequest* request) {
DCHECK_EQ(nullptr, dialog_);
@@ -71,7 +78,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 +89,8 @@ ChromePaymentRequestDelegate::GetAddressInputStorage() {
return autofill::ValidationRulesStorageFactory::CreateStorage();
}
+AddressNormalizer* ChromePaymentRequestDelegate::GetAddressNormalizer() {
+ return address_normalizer_.get();
please use gerrit instead 2017/04/20 20:15:20 return &address_normaliser_;
sebsg 2017/04/20 21:06:19 Done.
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698