[Web Payment][Desktop] Send abort event to payment handler.
Before this patch, aborting payment on desktop would succeed only before
the payment app has been invoked. The invoked payment app was not
consulted whether it could be aborted.
This patch delegates abort handling on desktop to the payment app.
This patch also removes the identity callback from the desktop
implementation of PaymentRequest, because aborting requires
ServiceWorkerPaymentApp to know the service worker registration ID,
which is also used for payment handler host logging, and
ServiceWorkerPaymentApp now has a reference to the payment handler
host.
After this patch, the invoked payment handler receives the abort event
and determines whether abort should be performed. (Android already does
that.)
Bug: 1083242
Change-Id: I267ad820ef06b17fb88bd8b948c22b0e07145fae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208105
Commit-Queue: Rouslan Solomakhin <[email protected]>
Reviewed-by: Liquan (Max) Gu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#771337}
diff --git a/components/payments/content/payment_request.h b/components/payments/content/payment_request.h
index ed4152d..697f719 100644
--- a/components/payments/content/payment_request.h
+++ b/components/payments/content/payment_request.h
@@ -101,9 +101,6 @@
void OnShippingAddressSelected(mojom::PaymentAddressPtr address) override;
void OnPayerInfoSelected(mojom::PayerDetailPtr payer_info) override;
- void SetInvokedServiceWorkerIdentity(const url::Origin& origin,
- int64_t registration_id);
-
// Called when the user explicitly cancelled the flow. Will send a message
// to the renderer which will indirectly destroy this object (through
// OnConnectionTerminated).
@@ -187,6 +184,8 @@
void RespondToHasEnrolledInstrumentQuery(bool has_enrolled_instrument,
bool warn_localhost_or_file);
+ void OnAbortResult(bool aborted);
+
content::WebContents* web_contents_;
const content::GlobalFrameRoutingId initiator_frame_routing_id_;
DeveloperConsoleLogger log_;