Chromium Code Reviews| Index: chrome/browser/payments/payment_request_impl.h |
| diff --git a/chrome/browser/payments/payment_request_impl.h b/chrome/browser/payments/payment_request_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fd203200e677ce486d1223f20ae4ca06d40a4736 |
| --- /dev/null |
| +++ b/chrome/browser/payments/payment_request_impl.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// 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_ |
| + |
| +#include "components/payments/payment_request.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace payments { |
| + |
| +class PaymentRequestDialog; |
| + |
| +class PaymentRequestImpl : payments::mojom::PaymentRequest, |
| + public base::RefCounted<PaymentRequestImpl> { |
| + public: |
| + PaymentRequestImpl( |
| + content::WebContents* web_contents, |
| + mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| + |
| + private: |
| + friend class base::RefCounted<PaymentRequestImpl>; |
|
Lei Zhang
2016/11/16 00:59:33
Most often, existing code just put these in the pr
Kevin Bailey
2016/11/16 14:13:47
I moved it here because Rouslan suggested that the
Lei Zhang
2016/11/16 18:39:30
At the time of that suggestion, the destructor was
Kevin Bailey
2016/11/16 22:34:09
I understand. Done. I assume we still want the des
|
| + ~PaymentRequestImpl() override; |
| + |
| + public: |
| + // payments::mojom::PaymentRequest "stub" |
| + void Init(payments::mojom::PaymentRequestClientPtr client, |
| + std::vector<payments::mojom::PaymentMethodDataPtr> methodData, |
| + payments::mojom::PaymentDetailsPtr details, |
| + payments::mojom::PaymentOptionsPtr options) override; |
| + void Show() override {} |
| + void UpdateWith(payments::mojom::PaymentDetailsPtr details) override {} |
| + void Abort() override {} |
| + void Complete(payments::mojom::PaymentComplete result) override {} |
| + void onError(); |
|
Lei Zhang
2016/11/16 00:59:33
OnError() ? Is this suppose to be part of the mojo
Kevin Bailey
2016/11/16 14:13:47
I capitalized it in case that's what you're hintin
Lei Zhang
2016/11/16 18:39:30
There's no override keyword, so I wasn't sure if i
Kevin Bailey
2016/11/16 22:34:09
I didn't space it away either. Fixed.
|
| + |
| + private: |
| + content::WebContents* web_contents_; |
| + mojo::Binding<payments::mojom::PaymentRequest> binding_; |
| + PaymentRequestDialog* dialog_; |
| + DISALLOW_COPY_AND_ASSIGN(PaymentRequestImpl); |
| +}; |
| + |
| +} // namespace payments |
| + |
| +void CreatePaymentRequestHandler( |
| + content::WebContents* web_contents, |
| + mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); |
| + |
| +#endif // CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_IMPL_H_ |