| 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_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ | 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "components/payments/payment_app.mojom.h" | 12 #include "components/payments/payment_app.mojom.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/service_worker/service_worker_status_code.h" | 14 #include "content/common/service_worker/service_worker_status_code.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 class PaymentAppContext; | 19 class PaymentAppContextImpl; |
| 20 class ServiceWorkerRegistration; | 20 class ServiceWorkerRegistration; |
| 21 | 21 |
| 22 class CONTENT_EXPORT PaymentAppManager | 22 class CONTENT_EXPORT PaymentAppManager |
| 23 : public NON_EXPORTED_BASE(payments::mojom::PaymentAppManager) { | 23 : public NON_EXPORTED_BASE(payments::mojom::PaymentAppManager) { |
| 24 public: | 24 public: |
| 25 PaymentAppManager( | 25 PaymentAppManager( |
| 26 PaymentAppContext* payment_app_context, | 26 PaymentAppContextImpl* payment_app_context, |
| 27 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); | 27 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); |
| 28 | 28 |
| 29 ~PaymentAppManager() override; | 29 ~PaymentAppManager() override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 friend class PaymentAppManagerTest; | 32 friend class PaymentAppManagerTest; |
| 33 | 33 |
| 34 // payments::mojom::PaymentAppManager methods: | 34 // payments::mojom::PaymentAppManager methods: |
| 35 void SetManifest(const std::string& scope, | 35 void SetManifest(const std::string& scope, |
| 36 payments::mojom::PaymentAppManifestPtr manifest, | 36 payments::mojom::PaymentAppManifestPtr manifest, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 52 const GetManifestCallback& callback, | 52 const GetManifestCallback& callback, |
| 53 ServiceWorkerStatusCode status, | 53 ServiceWorkerStatusCode status, |
| 54 scoped_refptr<ServiceWorkerRegistration> registration); | 54 scoped_refptr<ServiceWorkerRegistration> registration); |
| 55 void DidGetManifest(const GetManifestCallback& callback, | 55 void DidGetManifest(const GetManifestCallback& callback, |
| 56 const std::vector<std::string>& data, | 56 const std::vector<std::string>& data, |
| 57 ServiceWorkerStatusCode status); | 57 ServiceWorkerStatusCode status); |
| 58 | 58 |
| 59 // Called when an error is detected on binding_. | 59 // Called when an error is detected on binding_. |
| 60 void OnConnectionError(); | 60 void OnConnectionError(); |
| 61 | 61 |
| 62 // PaymentAppContext owns PaymentAppManager | 62 // PaymentAppContextImpl owns PaymentAppManager |
| 63 PaymentAppContext* payment_app_context_; | 63 PaymentAppContextImpl* payment_app_context_; |
| 64 | 64 |
| 65 mojo::Binding<payments::mojom::PaymentAppManager> binding_; | 65 mojo::Binding<payments::mojom::PaymentAppManager> binding_; |
| 66 | 66 |
| 67 base::WeakPtrFactory<PaymentAppManager> weak_ptr_factory_; | 67 base::WeakPtrFactory<PaymentAppManager> weak_ptr_factory_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(PaymentAppManager); | 69 DISALLOW_COPY_AND_ASSIGN(PaymentAppManager); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace content | 72 } // namespace content |
| 73 | 73 |
| 74 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ | 74 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ |
| OLD | NEW |