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

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

Issue 2864013002: Verify behavior of PaymentRequest.show() method, part 1. (Closed)
Patch Set: Promise test Created 3 years, 7 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_web_contents_manager.h
diff --git a/components/payments/content/payment_request_web_contents_manager.h b/components/payments/content/payment_request_web_contents_manager.h
index be08a3da0035226eb91044d9d85b61fd37c81ff8..6918520a9bf41ca10be847b02d0551cb2a90ed02 100644
--- a/components/payments/content/payment_request_web_contents_manager.h
+++ b/components/payments/content/payment_request_web_contents_manager.h
@@ -50,6 +50,10 @@ class PaymentRequestWebContentsManager
// Destroys the given |request|.
void DestroyRequest(PaymentRequest* request);
+ // Called when |request| has received the show() call. Returns true if the
+ // |request| can be shown. (Only one request at a time can be shown per tab.)
Mathieu 2017/05/08 13:01:42 you should add that this manager will now assume t
please use gerrit instead 2017/05/08 13:12:35 Done.
+ bool CanShow(PaymentRequest* request);
+
private:
explicit PaymentRequestWebContentsManager(content::WebContents* web_contents);
friend class content::WebContentsUserData<PaymentRequestWebContentsManager>;
@@ -62,6 +66,10 @@ class PaymentRequestWebContentsManager
std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>>
Mathieu 2017/05/08 13:01:42 per Brett's email to chromium-dev, unordered_map i
please use gerrit instead 2017/05/08 13:12:35 Done.
payment_requests_;
+ // The currently displayed instance of PaymentRequest. Points to one of the
+ // elements in payment_requests_. Can be null.
+ PaymentRequest* showing_;
+
DISALLOW_COPY_AND_ASSIGN(PaymentRequestWebContentsManager);
};

Powered by Google App Engine
This is Rietveld 408576698