| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ | 5 #ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ |
| 6 #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ | 6 #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "components/payments/payment_request.h" | 10 #include "components/payments/payment_request.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 content::WebContents* web_contents, | 39 content::WebContents* web_contents, |
| 40 std::unique_ptr<PaymentRequestDelegate> delegate, | 40 std::unique_ptr<PaymentRequestDelegate> delegate, |
| 41 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); | 41 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| 42 | 42 |
| 43 // Destroys the given |request|. | 43 // Destroys the given |request|. |
| 44 void DestroyRequest(PaymentRequest* request); | 44 void DestroyRequest(PaymentRequest* request); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 explicit PaymentRequestWebContentsManager(content::WebContents* web_contents); | 47 explicit PaymentRequestWebContentsManager(content::WebContents* web_contents); |
| 48 friend class content::WebContentsUserData<PaymentRequestWebContentsManager>; | 48 friend class content::WebContentsUserData<PaymentRequestWebContentsManager>; |
| 49 friend class PaymentRequestWebContentsManagerBrowserTest; | 49 friend class PaymentRequestInteractiveTestBase; |
| 50 | 50 |
| 51 // Owns all the PaymentRequest for this WebContents. Since the | 51 // Owns all the PaymentRequest for this WebContents. Since the |
| 52 // PaymentRequestWebContentsManager's lifetime is tied to the WebContents, | 52 // PaymentRequestWebContentsManager's lifetime is tied to the WebContents, |
| 53 // these requests only get destroyed when the WebContents goes away, or when | 53 // these requests only get destroyed when the WebContents goes away, or when |
| 54 // the requests themselves call DestroyRequest(). | 54 // the requests themselves call DestroyRequest(). |
| 55 std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>> | 55 std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>> |
| 56 payment_requests_; | 56 payment_requests_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace payments | 59 } // namespace payments |
| 60 | 60 |
| 61 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ | 61 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ |
| OLD | NEW |