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 #include "content/browser/payments/payment_manager.h" | 5 #include "content/browser/payments/payment_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/optional.h" | 10 #include "base/optional.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void PaymentManager::DeletePaymentInstrument( | 60 void PaymentManager::DeletePaymentInstrument( |
61 const std::string& instrument_key, | 61 const std::string& instrument_key, |
62 const PaymentManager::DeletePaymentInstrumentCallback& callback) { | 62 const PaymentManager::DeletePaymentInstrumentCallback& callback) { |
63 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 63 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
64 | 64 |
65 payment_app_context_->payment_app_database()->DeletePaymentInstrument( | 65 payment_app_context_->payment_app_database()->DeletePaymentInstrument( |
66 scope_, instrument_key, callback); | 66 scope_, instrument_key, callback); |
67 } | 67 } |
68 | 68 |
| 69 void PaymentManager::GetPaymentInstrument( |
| 70 const std::string& instrument_key, |
| 71 const PaymentManager::GetPaymentInstrumentCallback& callback) { |
| 72 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 73 |
| 74 payment_app_context_->payment_app_database()->ReadPaymentInstrument( |
| 75 scope_, instrument_key, callback); |
| 76 } |
| 77 |
| 78 void PaymentManager::KeysOfPaymentInstruments( |
| 79 const PaymentManager::KeysOfPaymentInstrumentsCallback& callback) { |
| 80 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 81 |
| 82 payment_app_context_->payment_app_database()->KeysOfPaymentInstruments( |
| 83 scope_, callback); |
| 84 } |
| 85 |
| 86 void PaymentManager::HasPaymentInstrument( |
| 87 const std::string& instrument_key, |
| 88 const PaymentManager::HasPaymentInstrumentCallback& callback) { |
| 89 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 90 |
| 91 payment_app_context_->payment_app_database()->HasPaymentInstrument( |
| 92 scope_, instrument_key, callback); |
| 93 } |
| 94 |
69 void PaymentManager::SetPaymentInstrument( | 95 void PaymentManager::SetPaymentInstrument( |
70 const std::string& instrument_key, | 96 const std::string& instrument_key, |
71 payments::mojom::PaymentInstrumentPtr details, | 97 payments::mojom::PaymentInstrumentPtr details, |
72 const PaymentManager::SetPaymentInstrumentCallback& callback) { | 98 const PaymentManager::SetPaymentInstrumentCallback& callback) { |
73 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 99 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
74 | 100 |
75 payment_app_context_->payment_app_database()->WritePaymentInstrument( | 101 payment_app_context_->payment_app_database()->WritePaymentInstrument( |
76 scope_, instrument_key, std::move(details), callback); | 102 scope_, instrument_key, std::move(details), callback); |
77 } | 103 } |
78 | 104 |
79 void PaymentManager::HasPaymentInstrument( | |
80 const std::string& instrument_key, | |
81 const HasPaymentInstrumentCallback& callback) { | |
82 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
83 | |
84 payment_app_context_->payment_app_database()->HasPaymentInstrument( | |
85 scope_, instrument_key, callback); | |
86 } | |
87 | |
88 void PaymentManager::GetPaymentInstrument( | |
89 const std::string& instrument_key, | |
90 const PaymentManager::GetPaymentInstrumentCallback& callback) { | |
91 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
92 | |
93 payment_app_context_->payment_app_database()->ReadPaymentInstrument( | |
94 scope_, instrument_key, callback); | |
95 } | |
96 | |
97 void PaymentManager::OnConnectionError() { | 105 void PaymentManager::OnConnectionError() { |
98 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 106 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
99 payment_app_context_->PaymentManagerHadConnectionError(this); | 107 payment_app_context_->PaymentManagerHadConnectionError(this); |
100 } | 108 } |
101 | 109 |
102 } // namespace content | 110 } // namespace content |
OLD | NEW |