| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 ServiceWorkerStatusCode status, | 116 ServiceWorkerStatusCode status, |
| 116 scoped_refptr<ServiceWorkerRegistration> registration); | 117 scoped_refptr<ServiceWorkerRegistration> registration); |
| 117 void DidHasPaymentInstrument(DeletePaymentInstrumentCallback callback, | 118 void DidHasPaymentInstrument(DeletePaymentInstrumentCallback callback, |
| 118 const std::vector<std::string>& data, | 119 const std::vector<std::string>& data, |
| 119 ServiceWorkerStatusCode status); | 120 ServiceWorkerStatusCode status); |
| 120 | 121 |
| 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, |
| 126 const std::string& decoded_instrument_icon, |
| 125 WritePaymentInstrumentCallback callback, | 127 WritePaymentInstrumentCallback callback, |
| 126 ServiceWorkerStatusCode status, | 128 ServiceWorkerStatusCode status, |
| 127 scoped_refptr<ServiceWorkerRegistration> registration); | 129 scoped_refptr<ServiceWorkerRegistration> registration); |
| 128 void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback, | 130 void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback, |
| 129 ServiceWorkerStatusCode status); | 131 ServiceWorkerStatusCode status); |
| 130 | 132 |
| 133 // PaymentInstrumentIconFetcherCallback. |
| 134 void DidFetchedPaymentInstrumentIcon( |
| 135 const GURL& scope, |
| 136 const std::string& instrument_key, |
| 137 payments::mojom::PaymentInstrumentPtr instrument, |
| 138 WritePaymentInstrumentCallback callback, |
| 139 const std::string& icon); |
| 140 |
| 131 // ClearPaymentInstruments callbacks | 141 // ClearPaymentInstruments callbacks |
| 132 void DidFindRegistrationToClearPaymentInstruments( | 142 void DidFindRegistrationToClearPaymentInstruments( |
| 133 const GURL& scope, | 143 const GURL& scope, |
| 134 ClearPaymentInstrumentsCallback callback, | 144 ClearPaymentInstrumentsCallback callback, |
| 135 ServiceWorkerStatusCode status, | 145 ServiceWorkerStatusCode status, |
| 136 scoped_refptr<ServiceWorkerRegistration> registration); | 146 scoped_refptr<ServiceWorkerRegistration> registration); |
| 137 void DidGetKeysToClearPaymentInstruments( | 147 void DidGetKeysToClearPaymentInstruments( |
| 138 int64_t registration_id, | 148 int64_t registration_id, |
| 139 ClearPaymentInstrumentsCallback callback, | 149 ClearPaymentInstrumentsCallback callback, |
| 140 const std::vector<std::string>& keys, | 150 const std::vector<std::string>& keys, |
| 141 payments::mojom::PaymentHandlerStatus status); | 151 payments::mojom::PaymentHandlerStatus status); |
| 142 void DidClearPaymentInstruments(ClearPaymentInstrumentsCallback callback, | 152 void DidClearPaymentInstruments(ClearPaymentInstrumentsCallback callback, |
| 143 ServiceWorkerStatusCode status); | 153 ServiceWorkerStatusCode status); |
| 144 | 154 |
| 155 scoped_refptr<PaymentInstrumentIconFetcher> instrument_icon_fetcher_; |
| 145 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 156 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 146 base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_; | 157 base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_; |
| 147 | 158 |
| 148 DISALLOW_COPY_AND_ASSIGN(PaymentAppDatabase); | 159 DISALLOW_COPY_AND_ASSIGN(PaymentAppDatabase); |
| 149 }; | 160 }; |
| 150 | 161 |
| 151 } // namespace content | 162 } // namespace content |
| 152 | 163 |
| 153 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ | 164 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_DATABASE_H_ |
| OLD | NEW |