| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NET_ARC_NET_HOST_IMPL_H_ | 5 #ifndef COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ |
| 6 #define COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ | 6 #define COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/scoped_file.h" | 12 #include "base/files/scoped_file.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "chromeos/network/network_state_handler_observer.h" | 15 #include "chromeos/network/network_state_handler_observer.h" |
| 16 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
| 17 #include "components/arc/arc_service.h" | 17 #include "components/arc/arc_service.h" |
| 18 #include "components/arc/common/net.mojom.h" | 18 #include "components/arc/common/net.mojom.h" |
| 19 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
| 20 | 20 |
| 21 namespace arc { | 21 namespace arc { |
| 22 | 22 |
| 23 class ArcBridgeService; | 23 class ArcBridgeService; |
| 24 | 24 |
| 25 // Private implementation of ArcNetHost. | 25 // Private implementation of ArcNetHost. |
| 26 class ArcNetHostImpl : public ArcService, | 26 class ArcNetHostImpl : public ArcService, |
| 27 public ArcBridgeService::Observer, | 27 public ArcBridgeService::Observer, |
| 28 public chromeos::NetworkStateHandlerObserver, | 28 public chromeos::NetworkStateHandlerObserver, |
| 29 public NetHost { | 29 public mojom::NetHost { |
| 30 public: | 30 public: |
| 31 // The constructor will register an Observer with ArcBridgeService. | 31 // The constructor will register an Observer with ArcBridgeService. |
| 32 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); | 32 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); |
| 33 ~ArcNetHostImpl() override; | 33 ~ArcNetHostImpl() override; |
| 34 | 34 |
| 35 // Called when a GetNetworks call is sent from ARC. | 35 // Called when a GetNetworks call is sent from ARC. |
| 36 void GetNetworksDeprecated( | 36 void GetNetworksDeprecated( |
| 37 bool configured_only, | 37 bool configured_only, |
| 38 bool visible_only, | 38 bool visible_only, |
| 39 const GetNetworksDeprecatedCallback& callback) override; | 39 const GetNetworksDeprecatedCallback& callback) override; |
| 40 | 40 |
| 41 // Called when a GetNetworks call is sent from ARC. | 41 // Called when a GetNetworks call is sent from ARC. |
| 42 void GetNetworks(GetNetworksRequestType type, | 42 void GetNetworks(mojom::GetNetworksRequestType type, |
| 43 const GetNetworksCallback& callback) override; | 43 const GetNetworksCallback& callback) override; |
| 44 | 44 |
| 45 // Called when a GetWifiEnabledState call is sent from ARC. | 45 // Called when a GetWifiEnabledState call is sent from ARC. |
| 46 void GetWifiEnabledState( | 46 void GetWifiEnabledState( |
| 47 const GetWifiEnabledStateCallback& callback) override; | 47 const GetWifiEnabledStateCallback& callback) override; |
| 48 | 48 |
| 49 // Called when a SetWifiEnabledState call is sent from ARC. | 49 // Called when a SetWifiEnabledState call is sent from ARC. |
| 50 void SetWifiEnabledState( | 50 void SetWifiEnabledState( |
| 51 bool is_enabled, | 51 bool is_enabled, |
| 52 const SetWifiEnabledStateCallback& callback) override; | 52 const SetWifiEnabledStateCallback& callback) override; |
| 53 | 53 |
| 54 // Called when a StartScan call is sent from ARC. | 54 // Called when a StartScan call is sent from ARC. |
| 55 void StartScan() override; | 55 void StartScan() override; |
| 56 | 56 |
| 57 // Overriden from chromeos::NetworkStateHandlerObserver. | 57 // Overriden from chromeos::NetworkStateHandlerObserver. |
| 58 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override; | 58 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override; |
| 59 | 59 |
| 60 // Overriden from chromeos::NetworkStateHandlerObserver. | 60 // Overriden from chromeos::NetworkStateHandlerObserver. |
| 61 void OnShuttingDown() override; | 61 void OnShuttingDown() override; |
| 62 | 62 |
| 63 // Overridden from ArcBridgeService::Observer: | 63 // Overridden from ArcBridgeService::Observer: |
| 64 void OnNetInstanceReady() override; | 64 void OnNetInstanceReady() override; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 base::ThreadChecker thread_checker_; | 67 base::ThreadChecker thread_checker_; |
| 68 mojo::Binding<arc::NetHost> binding_; | 68 mojo::Binding<arc::mojom::NetHost> binding_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); | 70 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace arc | 73 } // namespace arc |
| 74 | 74 |
| 75 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ | 75 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ |
| OLD | NEW |