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

Unified Diff: components/payments/content/payment_request_spec.h

Issue 2815723002: [Web Payments] Add Spinners and timeout while waiting for UpdateWith (Closed)
Patch Set: Address comments. 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: components/payments/content/payment_request_spec.h
diff --git a/components/payments/content/payment_request_spec.h b/components/payments/content/payment_request_spec.h
index 39bbda8f7bb5bb8bd78cda5aa5a5427c15d348d5..de0187a5aaa7259afcab1281bccf8be0c884232d 100644
--- a/components/payments/content/payment_request_spec.h
+++ b/components/payments/content/payment_request_spec.h
@@ -25,6 +25,14 @@ extern const char kBasicCardMethodName[];
// certain occasions by the merchant (see API).
class PaymentRequestSpec : public PaymentOptionsProvider {
public:
+ // This enum represents which bit of information was changed to trigger an
+ // update roundtrip with the website.
+ enum class UpdateReason {
+ NONE,
+ SHIPPING_OPTION,
+ SHIPPING_ADDRESS,
+ };
+
// Any class call add itself as Observer via AddObserver() and receive
// notification about spec events.
class Observer {
@@ -32,6 +40,11 @@ class PaymentRequestSpec : public PaymentOptionsProvider {
// Called when the provided spec (details, options, method_data) is invalid.
virtual void OnInvalidSpecProvided() = 0;
+ // Called when the website is notified that the user selected shipping
+ // options or a shipping address. This will be followed by a call to
+ // OnSpecUpdated or the PaymentRequest being aborted due to a timeout.
+ virtual void OnStartUpdating(UpdateReason reason) {}
+
// Called when the provided spec has changed.
virtual void OnSpecUpdated() = 0;
@@ -87,6 +100,8 @@ class PaymentRequestSpec : public PaymentOptionsProvider {
const mojom::PaymentDetails& details() const { return *details_.get(); }
+ void StartWaitingForUpdateWith(UpdateReason reason);
+
private:
friend class PaymentRequestDialogView;
void add_observer_for_testing(Observer* observer_for_testing) {
« no previous file with comments | « chrome/browser/ui/views/payments/payment_sheet_view_controller.cc ('k') | components/payments/content/payment_request_spec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698