| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ | 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 : public NON_EXPORTED_BASE(payments::mojom::PaymentManager) { | 22 : public NON_EXPORTED_BASE(payments::mojom::PaymentManager) { |
| 23 public: | 23 public: |
| 24 PaymentManager( | 24 PaymentManager( |
| 25 PaymentAppContextImpl* payment_app_context, | 25 PaymentAppContextImpl* payment_app_context, |
| 26 mojo::InterfaceRequest<payments::mojom::PaymentManager> request); | 26 mojo::InterfaceRequest<payments::mojom::PaymentManager> request); |
| 27 | 27 |
| 28 ~PaymentManager() override; | 28 ~PaymentManager() override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 friend class PaymentAppContentUnitTestBase; | 31 friend class PaymentAppContentUnitTestBase; |
| 32 friend class PaymentManagerTest; |
| 32 | 33 |
| 33 // payments::mojom::PaymentManager methods: | 34 // payments::mojom::PaymentManager methods: |
| 34 void Init(const std::string& scope) override; | 35 void Init(const std::string& scope) override; |
| 35 void SetManifest(payments::mojom::PaymentAppManifestPtr manifest, | 36 void SetManifest(payments::mojom::PaymentAppManifestPtr manifest, |
| 36 const SetManifestCallback& callback) override; | 37 const SetManifestCallback& callback) override; |
| 37 void GetManifest(const GetManifestCallback& callback) override; | 38 void GetManifest(const GetManifestCallback& callback) override; |
| 38 void SetPaymentInstrument( | 39 void SetPaymentInstrument( |
| 39 const std::string& instrumentKey, | 40 const std::string& instrumentKey, |
| 40 payments::mojom::PaymentInstrumentPtr details, | 41 payments::mojom::PaymentInstrumentPtr details, |
| 41 const SetPaymentInstrumentCallback& callback) override; | 42 const SetPaymentInstrumentCallback& callback) override; |
| 42 void GetPaymentInstrument( | 43 void GetPaymentInstrument( |
| 43 const std::string& instrumentKey, | 44 const std::string& instrumentKey, |
| 44 const GetPaymentInstrumentCallback& callback) override; | 45 const GetPaymentInstrumentCallback& callback) override; |
| 45 | 46 |
| 46 // Called when an error is detected on binding_. | 47 // Called when an error is detected on binding_. |
| 47 void OnConnectionError(); | 48 void OnConnectionError(); |
| 48 | 49 |
| 49 // PaymentAppContextImpl owns PaymentManager | 50 // PaymentAppContextImpl owns PaymentManager |
| 50 PaymentAppContextImpl* payment_app_context_; | 51 PaymentAppContextImpl* payment_app_context_; |
| 51 | 52 |
| 52 GURL scope_; | 53 GURL scope_; |
| 53 mojo::Binding<payments::mojom::PaymentManager> binding_; | 54 mojo::Binding<payments::mojom::PaymentManager> binding_; |
| 54 base::WeakPtrFactory<PaymentManager> weak_ptr_factory_; | 55 base::WeakPtrFactory<PaymentManager> weak_ptr_factory_; |
| 55 DISALLOW_COPY_AND_ASSIGN(PaymentManager); | 56 DISALLOW_COPY_AND_ASSIGN(PaymentManager); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 } // namespace content | 59 } // namespace content |
| 59 | 60 |
| 60 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ | 61 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ |
| OLD | NEW |