#include "components/payments/content/service_worker_payment_app.h"
#include <limits>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "components/payments/content/payment_event_response_util.h"
#include "components/payments/content/payment_handler_host.h"
#include "components/payments/content/payment_request_converter.h"
#include "components/payments/core/features.h"
#include "components/payments/core/method_strings.h"
#include "components/payments/core/pre_purchase_query.h"
#include "content/public/browser/payment_app_provider.h"
#include "content/public/browser/payment_app_provider_util.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "ui/gfx/image/image_skia.h"
#include "url/origin.h"
namespace payments {
ServiceWorkerPaymentApp::ServiceWorkerPaymentApp(
content::WebContents* web_contents,
const GURL& top_origin,
const GURL& frame_origin,
base::WeakPtr<PaymentRequestSpec> spec,
std::unique_ptr<content::StoredPaymentApp> stored_payment_app_info,
bool is_incognito,
const base::RepeatingClosure& show_processing_spinner)
: … { … }
ServiceWorkerPaymentApp::ServiceWorkerPaymentApp(
content::WebContents* web_contents,
const GURL& top_origin,
const GURL& frame_origin,
base::WeakPtr<PaymentRequestSpec> spec,
std::unique_ptr<WebAppInstallationInfo> installable_payment_app_info,
const std::string& enabled_method,
bool is_incognito,
const base::RepeatingClosure& show_processing_spinner)
: … { … }
ServiceWorkerPaymentApp::~ServiceWorkerPaymentApp() { … }
void ServiceWorkerPaymentApp::ValidateCanMakePayment(
ValidateCanMakePaymentCallback callback) { … }
mojom::CanMakePaymentEventDataPtr
ServiceWorkerPaymentApp::CreateCanMakePaymentEventData() { … }
void ServiceWorkerPaymentApp::OnCanMakePaymentEventSkipped(
ValidateCanMakePaymentCallback callback) { … }
void ServiceWorkerPaymentApp::OnCanMakePaymentEventResponded(
ValidateCanMakePaymentCallback callback,
mojom::CanMakePaymentResponsePtr response) { … }
void ServiceWorkerPaymentApp::CallValidateCanMakePaymentCallback(
ValidateCanMakePaymentCallback callback) { … }
void ServiceWorkerPaymentApp::InvokePaymentApp(
base::WeakPtr<Delegate> delegate) { … }
void ServiceWorkerPaymentApp::OnPaymentAppWindowClosed() { … }
mojom::PaymentRequestEventDataPtr
ServiceWorkerPaymentApp::CreatePaymentRequestEventData() { … }
void ServiceWorkerPaymentApp::OnPaymentAppResponse(
mojom::PaymentHandlerResponsePtr response) { … }
bool ServiceWorkerPaymentApp::IsCompleteForPayment() const { … }
bool ServiceWorkerPaymentApp::CanPreselect() const { … }
std::u16string ServiceWorkerPaymentApp::GetMissingInfoLabel() const { … }
bool ServiceWorkerPaymentApp::HasEnrolledInstrument() const { … }
void ServiceWorkerPaymentApp::RecordUse() { … }
bool ServiceWorkerPaymentApp::NeedsInstallation() const { … }
std::string ServiceWorkerPaymentApp::GetId() const { … }
std::u16string ServiceWorkerPaymentApp::GetLabel() const { … }
std::u16string ServiceWorkerPaymentApp::GetSublabel() const { … }
bool ServiceWorkerPaymentApp::IsValidForModifier(
const std::string& method) const { … }
base::WeakPtr<PaymentApp> ServiceWorkerPaymentApp::AsWeakPtr() { … }
const SkBitmap* ServiceWorkerPaymentApp::icon_bitmap() const { … }
std::set<std::string>
ServiceWorkerPaymentApp::GetApplicationIdentifiersThatHideThisApp() const { … }
bool ServiceWorkerPaymentApp::HandlesShippingAddress() const { … }
bool ServiceWorkerPaymentApp::HandlesPayerName() const { … }
bool ServiceWorkerPaymentApp::HandlesPayerEmail() const { … }
bool ServiceWorkerPaymentApp::HandlesPayerPhone() const { … }
void ServiceWorkerPaymentApp::OnPaymentAppIdentity(const url::Origin& origin,
int64_t registration_id) { … }
ukm::SourceId ServiceWorkerPaymentApp::UkmSourceId() { … }
void ServiceWorkerPaymentApp::SetPaymentHandlerHost(
base::WeakPtr<PaymentHandlerHost> payment_handler_host) { … }
bool ServiceWorkerPaymentApp::IsWaitingForPaymentDetailsUpdate() const { … }
void ServiceWorkerPaymentApp::UpdateWith(
mojom::PaymentRequestDetailsUpdatePtr details_update) { … }
void ServiceWorkerPaymentApp::OnPaymentDetailsNotUpdated() { … }
void ServiceWorkerPaymentApp::AbortPaymentApp(
base::OnceCallback<void(bool)> abort_callback) { … }
content::PaymentAppProvider* ServiceWorkerPaymentApp::GetPaymentAppProvider() { … }
}