| 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..1c000ec33ed3be157d6b0a498eb3cf24856a95b8 100644
|
| --- a/components/payments/content/payment_request_web_contents_manager.h
|
| +++ b/components/payments/content/payment_request_web_contents_manager.h
|
| @@ -5,8 +5,8 @@
|
| #ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_
|
| #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_
|
|
|
| +#include <map>
|
| #include <memory>
|
| -#include <unordered_map>
|
|
|
| #include "base/macros.h"
|
| #include "components/payments/content/payment_request.h"
|
| @@ -50,6 +50,12 @@ class PaymentRequestWebContentsManager
|
| // Destroys the given |request|.
|
| void DestroyRequest(PaymentRequest* request);
|
|
|
| + // Called when |request| has received the show() call. If the |request| can be
|
| + // shown, then returns true and assumes that |request| is now showing until
|
| + // DestroyRequest(|request|) is called with the same pointer. (Only one
|
| + // request at a time can be shown per tab.)
|
| + bool CanShow(PaymentRequest* request);
|
| +
|
| private:
|
| explicit PaymentRequestWebContentsManager(content::WebContents* web_contents);
|
| friend class content::WebContentsUserData<PaymentRequestWebContentsManager>;
|
| @@ -59,8 +65,11 @@ class PaymentRequestWebContentsManager
|
| // PaymentRequestWebContentsManager's lifetime is tied to the WebContents,
|
| // these requests only get destroyed when the WebContents goes away, or when
|
| // the requests themselves call DestroyRequest().
|
| - std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>>
|
| - payment_requests_;
|
| + std::map<PaymentRequest*, std::unique_ptr<PaymentRequest>> 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);
|
| };
|
|
|