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

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

Issue 2803443003: [Payments] Added region load failure tolerance and tests to PR editor. (Closed)
Patch Set: Removed unneeded include. 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 57604ce218da93d631c558abc2b23a7244792b46..bd23df5eb07fa7c9ab63c434df803cde7070e57a 100644
--- a/chrome/browser/payments/chrome_payment_request_delegate.cc
+++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -5,11 +5,15 @@
#include "chrome/browser/payments/chrome_payment_request_delegate.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
+#include "chrome/browser/autofill/validation_rules_storage_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#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 "content/public/browser/web_contents.h"
+#include "third_party/libaddressinput/chromium/chrome_metadata_source.h"
+#include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
namespace payments {
@@ -58,4 +62,15 @@ void ChromePaymentRequestDelegate::DoFullCardRequest(
dialog_->ShowCvcUnmaskPrompt(credit_card, result_delegate, web_contents_);
}
+std::unique_ptr<const ::i18n::addressinput::Source>
+ChromePaymentRequestDelegate::GetAddressInputSource() {
+ return base::WrapUnique(new autofill::ChromeMetadataSource(
+ I18N_ADDRESS_VALIDATION_DATA_URL,
+ GetPersonalDataManager()->GetURLRequestContextGetter()));
+}
+std::unique_ptr<::i18n::addressinput::Storage>
+ChromePaymentRequestDelegate::GetAddressInputStorage() {
+ return autofill::ValidationRulesStorageFactory::CreateStorage();
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698