| Index: components/payments/content/payment_request.cc
|
| diff --git a/components/payments/payment_request.cc b/components/payments/content/payment_request.cc
|
| similarity index 93%
|
| rename from components/payments/payment_request.cc
|
| rename to components/payments/content/payment_request.cc
|
| index 7dda081e0a79f506d87998cf2ee943651a302b27..0a83cf2c5afd7ef3d4b6ffe48c37e57d90770c37 100644
|
| --- a/components/payments/payment_request.cc
|
| +++ b/components/payments/content/payment_request.cc
|
| @@ -2,25 +2,21 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/payments/payment_request.h"
|
| +#include "components/payments/content/payment_request.h"
|
| +
|
| +#include <unordered_map>
|
| +#include <utility>
|
|
|
| #include "base/memory/ptr_util.h"
|
| -#include "components/payments/payment_details_validation.h"
|
| -#include "components/payments/payment_request_web_contents_manager.h"
|
| +#include "components/autofill/core/browser/personal_data_manager.h"
|
| +#include "components/payments/content/payment_details_validation.h"
|
| +#include "components/payments/content/payment_request_web_contents_manager.h"
|
| +#include "components/payments/core/currency_formatter.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| -using payments::mojom::BasicCardNetwork;
|
| -
|
| namespace payments {
|
|
|
| -namespace {
|
| -
|
| -// Identifier for the basic card payment method in the PaymentMethodData.
|
| -const char* const kBasicCardMethodName = "basic-card";
|
| -
|
| -} // namespace
|
| -
|
| PaymentRequest::PaymentRequest(
|
| content::WebContents* web_contents,
|
| std::unique_ptr<PaymentRequestDelegate> delegate,
|
| @@ -40,7 +36,6 @@ PaymentRequest::PaymentRequest(
|
| // set_connection_error_with_reason_handler with Binding::CloseWithReason.
|
| binding_.set_connection_error_handler(base::Bind(
|
| &PaymentRequest::OnConnectionTerminated, base::Unretained(this)));
|
| -
|
| }
|
|
|
| PaymentRequest::~PaymentRequest() {}
|
| @@ -120,12 +115,12 @@ CurrencyFormatter* PaymentRequest::GetOrCreateCurrencyFormatter(
|
| }
|
|
|
| const std::vector<autofill::AutofillProfile*>&
|
| - PaymentRequest::shipping_profiles() {
|
| +PaymentRequest::shipping_profiles() {
|
| return shipping_profiles_;
|
| }
|
|
|
| const std::vector<autofill::AutofillProfile*>&
|
| - PaymentRequest::contact_profiles() {
|
| +PaymentRequest::contact_profiles() {
|
| return contact_profiles_;
|
| }
|
|
|
| @@ -180,6 +175,8 @@ void PaymentRequest::PopulateValidatedMethodData(
|
| return;
|
| }
|
|
|
| + // Identifier for the basic card payment method in the PaymentMethodData.
|
| + const char* const kBasicCardMethodName = "basic-card";
|
| std::set<std::string> card_networks{"amex", "diners", "discover",
|
| "jcb", "mastercard", "mir",
|
| "unionpay", "visa"};
|
| @@ -218,6 +215,7 @@ void PaymentRequest::PopulateValidatedMethodData(
|
| } else {
|
| // The merchant has specified a few basic card supported networks. Use
|
| // the mapping to transform to known basic-card types.
|
| + using ::payments::mojom::BasicCardNetwork;
|
| std::unordered_map<BasicCardNetwork, std::string> networks = {
|
| {BasicCardNetwork::AMEX, "amex"},
|
| {BasicCardNetwork::DINERS, "diners"},
|
|
|