| 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 15 matching lines...) Expand all Loading... |
| 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 PaymentAppProviderTest; | 32 friend class PaymentAppProviderTest; |
| 33 friend class PaymentManagerTest; | 33 friend class PaymentManagerTest; |
| 34 | 34 |
| 35 // payments::mojom::PaymentManager methods: | 35 // payments::mojom::PaymentManager methods: |
| 36 void Init(const std::string& scope) override; | 36 void Init(const std::string& context, const std::string& scope) override; |
| 37 void DeletePaymentInstrument( | 37 void DeletePaymentInstrument( |
| 38 const std::string& instrument_key, | 38 const std::string& instrument_key, |
| 39 DeletePaymentInstrumentCallback callback) override; | 39 DeletePaymentInstrumentCallback callback) override; |
| 40 void GetPaymentInstrument(const std::string& instrument_key, | 40 void GetPaymentInstrument(const std::string& instrument_key, |
| 41 GetPaymentInstrumentCallback callback) override; | 41 GetPaymentInstrumentCallback callback) override; |
| 42 void KeysOfPaymentInstruments( | 42 void KeysOfPaymentInstruments( |
| 43 KeysOfPaymentInstrumentsCallback callback) override; | 43 KeysOfPaymentInstrumentsCallback callback) override; |
| 44 void HasPaymentInstrument(const std::string& instrument_key, | 44 void HasPaymentInstrument(const std::string& instrument_key, |
| 45 HasPaymentInstrumentCallback callback) override; | 45 HasPaymentInstrumentCallback callback) override; |
| 46 void SetPaymentInstrument(const std::string& instrument_key, | 46 void SetPaymentInstrument(const std::string& instrument_key, |
| 47 payments::mojom::PaymentInstrumentPtr details, | 47 payments::mojom::PaymentInstrumentPtr details, |
| 48 SetPaymentInstrumentCallback callback) override; | 48 SetPaymentInstrumentCallback callback) override; |
| 49 void ClearPaymentInstruments( | 49 void ClearPaymentInstruments( |
| 50 ClearPaymentInstrumentsCallback callback) override; | 50 ClearPaymentInstrumentsCallback callback) override; |
| 51 | 51 |
| 52 // Called when an error is detected on binding_. | 52 // Called when an error is detected on binding_. |
| 53 void OnConnectionError(); | 53 void OnConnectionError(); |
| 54 | 54 |
| 55 void SetPaymentInstrumentIntermediateCallback( |
| 56 PaymentManager::SetPaymentInstrumentCallback callback, |
| 57 payments::mojom::PaymentHandlerStatus status); |
| 58 |
| 55 // PaymentAppContextImpl owns PaymentManager | 59 // PaymentAppContextImpl owns PaymentManager |
| 56 PaymentAppContextImpl* payment_app_context_; | 60 PaymentAppContextImpl* payment_app_context_; |
| 57 | 61 |
| 62 bool should_set_payment_app_info_; |
| 63 GURL context_; |
| 58 GURL scope_; | 64 GURL scope_; |
| 59 mojo::Binding<payments::mojom::PaymentManager> binding_; | 65 mojo::Binding<payments::mojom::PaymentManager> binding_; |
| 60 base::WeakPtrFactory<PaymentManager> weak_ptr_factory_; | 66 base::WeakPtrFactory<PaymentManager> weak_ptr_factory_; |
| 61 DISALLOW_COPY_AND_ASSIGN(PaymentManager); | 67 DISALLOW_COPY_AND_ASSIGN(PaymentManager); |
| 62 }; | 68 }; |
| 63 | 69 |
| 64 } // namespace content | 70 } // namespace content |
| 65 | 71 |
| 66 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ | 72 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_MANAGER_H_ |
| OLD | NEW |