Chromium Code Reviews| 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 COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ |
| 6 #define COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ | 6 #define COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/arc/arc_service.h" | 11 #include "components/arc/arc_service.h" |
| 12 #include "components/arc/common/kiosk.mojom.h" | 12 #include "components/arc/common/kiosk.mojom.h" |
| 13 #include "components/arc/instance_holder.h" | 13 #include "components/arc/instance_holder.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 | 15 |
| 16 namespace arc { | 16 namespace arc { |
| 17 | 17 |
| 18 class ArcBridgeService; | 18 class ArcBridgeService; |
| 19 | 19 |
| 20 class ArcKioskBridge : public ArcService, | 20 class ArcKioskBridge : public ArcService, |
| 21 public InstanceHolder<mojom::KioskInstance>::Observer, | 21 public InstanceHolder<mojom::KioskInstance>::Observer, |
| 22 public mojom::KioskHost { | 22 public mojom::KioskHost { |
| 23 public: | 23 public: |
| 24 explicit ArcKioskBridge(ArcBridgeService* bridge_service); | 24 // Received IPCs are passed to this delegate. |
| 25 class Delegate { | |
| 26 public: | |
| 27 virtual ~Delegate() = default; | |
| 28 virtual void OnMaintenanceSessionCreated() = 0; | |
| 29 virtual void OnMaintenanceSessionFinished() = 0; | |
| 30 }; | |
| 31 | |
| 32 ArcKioskBridge(ArcBridgeService* bridge_service, Delegate* delegate); | |
|
hidehiko
2016/12/19 13:53:33
Could you briefly comment that |delegate| needs to
Sergey Poromov
2016/12/19 17:28:38
Done.
| |
| 25 ~ArcKioskBridge() override; | 33 ~ArcKioskBridge() override; |
| 26 | 34 |
| 27 // InstanceHolder<mojom::KioskInstance>::Observer overrides. | 35 // InstanceHolder<mojom::KioskInstance>::Observer overrides. |
| 28 void OnInstanceReady() override; | 36 void OnInstanceReady() override; |
| 29 | 37 |
| 30 // mojom::KioskHost overrides. | 38 // mojom::KioskHost overrides. |
| 31 void OnMaintenanceSessionCreated(int32_t session_id) override; | 39 void OnMaintenanceSessionCreated(int32_t session_id) override; |
| 32 void OnMaintenanceSessionFinished(int32_t session_id, bool success) override; | 40 void OnMaintenanceSessionFinished(int32_t session_id, bool success) override; |
| 33 | 41 |
| 34 private: | 42 private: |
| 35 mojo::Binding<mojom::KioskHost> binding_; | 43 mojo::Binding<mojom::KioskHost> binding_; |
| 44 Delegate* const delegate_; | |
| 36 | 45 |
| 37 DISALLOW_COPY_AND_ASSIGN(ArcKioskBridge); | 46 DISALLOW_COPY_AND_ASSIGN(ArcKioskBridge); |
| 38 }; | 47 }; |
| 39 | 48 |
| 40 } // namespace arc | 49 } // namespace arc |
| 41 | 50 |
| 42 #endif // COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ | 51 #endif // COMPONENTS_ARC_KIOSK_ARC_KIOSK_BRIDGE_H_ |
| OLD | NEW |