Chromium Code Reviews| Index: components/payments/payment_request_impl.h |
| diff --git a/chrome/browser/payments/payment_request_impl.h b/components/payments/payment_request_impl.h |
| similarity index 73% |
| rename from chrome/browser/payments/payment_request_impl.h |
| rename to components/payments/payment_request_impl.h |
| index d87d8bee3ec6c8b6875ebe07b8b7b12334f2d246..8cc7890fdac429d98d90c7f0f70475effdff3e2c 100644 |
| --- a/chrome/browser/payments/payment_request_impl.h |
| +++ b/components/payments/payment_request_impl.h |
| @@ -2,8 +2,10 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |
| -#define CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |
| +#ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |
| +#define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |
| + |
| +#include <memory> |
| #include "components/payments/payment_request.mojom.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| @@ -14,12 +16,17 @@ class WebContents; |
| namespace payments { |
| -class PaymentRequestImpl : payments::mojom::PaymentRequest, |
| - public base::RefCounted<PaymentRequestImpl> { |
| +class PaymentRequestDelegate; |
| +class PaymentRequestWebContentsManager; |
| + |
| +class PaymentRequestImpl : payments::mojom::PaymentRequest { |
| public: |
| PaymentRequestImpl( |
| content::WebContents* web_contents, |
| + std::unique_ptr<PaymentRequestDelegate> delegate, |
| + PaymentRequestWebContentsManager* manager, |
| mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| + ~PaymentRequestImpl() override; |
| // payments::mojom::PaymentRequest "stub" |
| void Init(payments::mojom::PaymentRequestClientPtr client, |
| @@ -39,10 +46,9 @@ class PaymentRequestImpl : payments::mojom::PaymentRequest, |
| content::WebContents* web_contents() { return web_contents_; } |
| private: |
| - friend class base::RefCounted<PaymentRequestImpl>; |
| - ~PaymentRequestImpl() override; |
| - |
| content::WebContents* web_contents_; |
| + std::unique_ptr<PaymentRequestDelegate> delegate_; |
| + PaymentRequestWebContentsManager* manager_; // Weakly owned. |
|
please use gerrit instead
2017/01/06 21:49:09
Did you mean to say that |manager_| owns PaymentRe
Mathieu
2017/01/07 05:03:07
Done, clarified comment.
|
| mojo::Binding<payments::mojom::PaymentRequest> binding_; |
| payments::mojom::PaymentRequestClientPtr client_; |
| payments::mojom::PaymentDetailsPtr details_; |
| @@ -52,8 +58,4 @@ class PaymentRequestImpl : payments::mojom::PaymentRequest, |
| } // namespace payments |
| -void CreatePaymentRequestHandler( |
| - content::WebContents* web_contents, |
| - mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| - |
| -#endif // CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |
| +#endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |