| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ | |
| 6 #define CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "components/payments/content/payment_app.mojom.h" | |
| 13 #include "content/common/content_export.h" | |
| 14 #include "mojo/public/cpp/bindings/binding.h" | |
| 15 #include "url/gurl.h" | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 class PaymentAppContextImpl; | |
| 20 | |
| 21 class CONTENT_EXPORT PaymentAppManager | |
| 22 : public NON_EXPORTED_BASE(payments::mojom::PaymentAppManager) { | |
| 23 public: | |
| 24 PaymentAppManager( | |
| 25 PaymentAppContextImpl* payment_app_context, | |
| 26 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request); | |
| 27 | |
| 28 ~PaymentAppManager() override; | |
| 29 | |
| 30 private: | |
| 31 friend class PaymentAppContentUnitTestBase; | |
| 32 | |
| 33 // payments::mojom::PaymentAppManager methods: | |
| 34 void Init(const std::string& scope) override; | |
| 35 void SetManifest(payments::mojom::PaymentAppManifestPtr manifest, | |
| 36 const SetManifestCallback& callback) override; | |
| 37 void GetManifest(const GetManifestCallback& callback) override; | |
| 38 | |
| 39 // Called when an error is detected on binding_. | |
| 40 void OnConnectionError(); | |
| 41 | |
| 42 // PaymentAppContextImpl owns PaymentAppManager | |
| 43 PaymentAppContextImpl* payment_app_context_; | |
| 44 | |
| 45 GURL scope_; | |
| 46 mojo::Binding<payments::mojom::PaymentAppManager> binding_; | |
| 47 base::WeakPtrFactory<PaymentAppManager> weak_ptr_factory_; | |
| 48 DISALLOW_COPY_AND_ASSIGN(PaymentAppManager); | |
| 49 }; | |
| 50 | |
| 51 } // namespace content | |
| 52 | |
| 53 #endif // CONTENT_BROWSER_PAYMENTS_PAYMENT_APP_MANAGER_H_ | |
| OLD | NEW |