#include "components/payments/content/payment_handler_host.h"
#include <utility>
#include "base/functional/callback.h"
#include "base/strings/string_number_conversions.h"
#include "components/payments/core/error_strings.h"
#include "components/payments/core/native_error_strings.h"
#include "components/payments/core/payment_address.h"
#include "components/payments/core/payments_validators.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_background_services_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/origin.h"
namespace payments {
namespace {
content::DevToolsBackgroundServicesContext* GetDevTools(
content::WebContents* web_contents,
const url::Origin& sw_origin) { … }
void RunCallbackWithError(const std::string& error,
ChangePaymentRequestDetailsCallback callback) { … }
}
PaymentHandlerHost::PaymentHandlerHost(content::WebContents* web_contents,
base::WeakPtr<Delegate> delegate)
: … { … }
PaymentHandlerHost::~PaymentHandlerHost() { … }
mojo::PendingRemote<mojom::PaymentHandlerHost> PaymentHandlerHost::Bind() { … }
void PaymentHandlerHost::UpdateWith(
mojom::PaymentRequestDetailsUpdatePtr response) { … }
void PaymentHandlerHost::OnPaymentDetailsNotUpdated() { … }
void PaymentHandlerHost::Disconnect() { … }
base::WeakPtr<PaymentHandlerHost> PaymentHandlerHost::AsWeakPtr() { … }
void PaymentHandlerHost::ChangePaymentMethod(
mojom::PaymentHandlerMethodDataPtr method_data,
ChangePaymentRequestDetailsCallback callback) { … }
void PaymentHandlerHost::ChangeShippingOption(
const std::string& shipping_option_id,
ChangePaymentRequestDetailsCallback callback) { … }
void PaymentHandlerHost::ChangeShippingAddress(
mojom::PaymentAddressPtr shipping_address,
ChangePaymentRequestDetailsCallback callback) { … }
}