| 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_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ |
| 6 #define COMPONENTS_ARC_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ | 6 #define COMPONENTS_ARC_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/arc/arc_bridge_service.h" | 9 #include "components/arc/arc_bridge_service.h" |
| 10 #include "components/arc/arc_service.h" | 10 #include "components/arc/arc_service.h" |
| 11 #include "components/arc/instance_holder.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 13 |
| 13 namespace arc { | 14 namespace arc { |
| 14 | 15 |
| 15 // This class handles OBB mount/unmount requests from Android. | 16 // This class handles OBB mount/unmount requests from Android. |
| 16 class ArcObbMounterBridge : public ArcService, | 17 class ArcObbMounterBridge |
| 17 public ArcBridgeService::Observer, | 18 : public ArcService, |
| 18 public mojom::ObbMounterHost { | 19 public InstanceHolder<mojom::ObbMounterInstance>::Observer, |
| 20 public mojom::ObbMounterHost { |
| 19 public: | 21 public: |
| 20 explicit ArcObbMounterBridge(ArcBridgeService* bridge_service); | 22 explicit ArcObbMounterBridge(ArcBridgeService* bridge_service); |
| 21 ~ArcObbMounterBridge() override; | 23 ~ArcObbMounterBridge() override; |
| 22 | 24 |
| 23 // ArcBridgeService::Observer overrides: | 25 // InstanceHolder<mojom::ObbMounterInstance>::Observer overrides: |
| 24 void OnObbMounterInstanceReady() override; | 26 void OnInstanceReady(mojom::ObbMounterInstance* obb_mounter_instance, |
| 27 uint32_t version) override; |
| 25 | 28 |
| 26 // mojom::ObbMounterHost overrides: | 29 // mojom::ObbMounterHost overrides: |
| 27 void MountObb(const mojo::String& obb_file, | 30 void MountObb(const mojo::String& obb_file, |
| 28 const mojo::String& target_path, | 31 const mojo::String& target_path, |
| 29 int32_t owner_gid, | 32 int32_t owner_gid, |
| 30 const MountObbCallback& callback) override; | 33 const MountObbCallback& callback) override; |
| 31 void UnmountObb(const mojo::String& target_path, | 34 void UnmountObb(const mojo::String& target_path, |
| 32 const UnmountObbCallback& callback) override; | 35 const UnmountObbCallback& callback) override; |
| 33 | 36 |
| 34 private: | 37 private: |
| 35 mojo::Binding<mojom::ObbMounterHost> binding_; | 38 mojo::Binding<mojom::ObbMounterHost> binding_; |
| 36 | 39 |
| 37 DISALLOW_COPY_AND_ASSIGN(ArcObbMounterBridge); | 40 DISALLOW_COPY_AND_ASSIGN(ArcObbMounterBridge); |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 } // namespace arc | 43 } // namespace arc |
| 41 | 44 |
| 42 #endif // COMPONENTS_ARC_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ | 45 #endif // COMPONENTS_ARC_OBB_MOUNTER_ARC_OBB_MOUNTER_BRIDGE_H_ |
| OLD | NEW |