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_APP_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ |
6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ | 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "components/payments/mojom/payment_app.mojom.h" | 14 #include "components/payments/mojom/payment_app.mojom.h" |
| 15 #include "content/browser/payments/payment_instrument_icon_fetcher.h" |
15 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 16 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
16 #include "content/browser/service_worker/service_worker_registration.h" | 17 #include "content/browser/service_worker/service_worker_registration.h" |
17 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
18 #include "content/common/service_worker/service_worker_status_code.h" | 19 #include "content/common/service_worker/service_worker_status_code.h" |
19 #include "content/public/browser/stored_payment_instrument.h" | 20 #include "content/public/browser/stored_payment_instrument.h" |
20 #include "mojo/public/cpp/bindings/binding.h" | 21 #include "mojo/public/cpp/bindings/binding.h" |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 class ServiceWorkerRegistration; | 25 class ServiceWorkerRegistration; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // WritePaymentInstrument callbacks | 122 // WritePaymentInstrument callbacks |
122 void DidFindRegistrationToWritePaymentInstrument( | 123 void DidFindRegistrationToWritePaymentInstrument( |
123 const std::string& instrument_key, | 124 const std::string& instrument_key, |
124 payments::mojom::PaymentInstrumentPtr instrument, | 125 payments::mojom::PaymentInstrumentPtr instrument, |
125 WritePaymentInstrumentCallback callback, | 126 WritePaymentInstrumentCallback callback, |
126 ServiceWorkerStatusCode status, | 127 ServiceWorkerStatusCode status, |
127 scoped_refptr<ServiceWorkerRegistration> registration); | 128 scoped_refptr<ServiceWorkerRegistration> registration); |
128 void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback, | 129 void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback, |
129 ServiceWorkerStatusCode status); | 130 ServiceWorkerStatusCode status); |
130 | 131 |
| 132 // PaymentInstrumentIconFetcherCallback. |
| 133 void DidFetchedPaymentInstrumentIcon( |
| 134 const std::string& instrument_key, |
| 135 payments::mojom::PaymentInstrumentPtr instrument, |
| 136 WritePaymentInstrumentCallback callback, |
| 137 scoped_refptr<ServiceWorkerRegistration> registration, |
| 138 const std::string& icon); |
| 139 |
131 // ClearPaymentInstruments callbacks | 140 // ClearPaymentInstruments callbacks |
132 void DidFindRegistrationToClearPaymentInstruments( | 141 void DidFindRegistrationToClearPaymentInstruments( |
133 const GURL& scope, | 142 const GURL& scope, |
134 ClearPaymentInstrumentsCallback callback, | 143 ClearPaymentInstrumentsCallback callback, |
135 ServiceWorkerStatusCode status, | 144 ServiceWorkerStatusCode status, |
136 scoped_refptr<ServiceWorkerRegistration> registration); | 145 scoped_refptr<ServiceWorkerRegistration> registration); |
137 void DidGetKeysToClearPaymentInstruments( | 146 void DidGetKeysToClearPaymentInstruments( |
138 int64_t registration_id, | 147 int64_t registration_id, |
139 ClearPaymentInstrumentsCallback callback, | 148 ClearPaymentInstrumentsCallback callback, |
140 const std::vector<std::string>& keys, | 149 const std::vector<std::string>& keys, |
141 payments::mojom::PaymentHandlerStatus status); | 150 payments::mojom::PaymentHandlerStatus status); |
142 void DidClearPaymentInstruments(ClearPaymentInstrumentsCallback callback, | 151 void DidClearPaymentInstruments(ClearPaymentInstrumentsCallback callback, |
143 ServiceWorkerStatusCode status); | 152 ServiceWorkerStatusCode status); |
144 | 153 |
| 154 std::unique_ptr<PaymentInstrumentIconFetcher> instrument_icon_fetcher_; |
145 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 155 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
146 base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_; | 156 base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_; |
147 | 157 |
148 DISALLOW_COPY_AND_ASSIGN(PaymentAppDatabase); | 158 DISALLOW_COPY_AND_ASSIGN(PaymentAppDatabase); |
149 }; | 159 }; |
150 | 160 |
151 } // namespace content | 161 } // namespace content |
152 | 162 |
153 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ | 163 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ |
OLD | NEW |