| 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 <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 content::WebContents* web_contents, | 45 content::WebContents* web_contents, |
| 46 std::unique_ptr<PaymentRequestDelegate> delegate, | 46 std::unique_ptr<PaymentRequestDelegate> delegate, |
| 47 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); | 47 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| 48 | 48 |
| 49 // Destroys the given |request|. | 49 // Destroys the given |request|. |
| 50 void DestroyRequest(PaymentRequest* request); | 50 void DestroyRequest(PaymentRequest* request); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 explicit PaymentRequestWebContentsManager(content::WebContents* web_contents); | 53 explicit PaymentRequestWebContentsManager(content::WebContents* web_contents); |
| 54 friend class content::WebContentsUserData<PaymentRequestWebContentsManager>; | 54 friend class content::WebContentsUserData<PaymentRequestWebContentsManager>; |
| 55 friend class PaymentRequestInteractiveTestBase; | 55 friend class PaymentRequestBrowserTestBase; |
| 56 | 56 |
| 57 // Owns all the PaymentRequest for this WebContents. Since the | 57 // Owns all the PaymentRequest for this WebContents. Since the |
| 58 // PaymentRequestWebContentsManager's lifetime is tied to the WebContents, | 58 // PaymentRequestWebContentsManager's lifetime is tied to the WebContents, |
| 59 // these requests only get destroyed when the WebContents goes away, or when | 59 // these requests only get destroyed when the WebContents goes away, or when |
| 60 // the requests themselves call DestroyRequest(). | 60 // the requests themselves call DestroyRequest(). |
| 61 std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>> | 61 std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>> |
| 62 payment_requests_; | 62 payment_requests_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PaymentRequestWebContentsManager); | 64 DISALLOW_COPY_AND_ASSIGN(PaymentRequestWebContentsManager); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace payments | 67 } // namespace payments |
| 68 | 68 |
| 69 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ | 69 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ |
| OLD | NEW |