| 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> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class DictionaryValue; | 24 class DictionaryValue; |
| 25 | 25 |
| 26 } // namespace base | 26 } // namespace base |
| 27 | 27 |
| 28 namespace arc { | 28 namespace arc { |
| 29 | 29 |
| 30 class ArcBridgeService; | 30 class ArcBridgeService; |
| 31 | 31 |
| 32 // Private implementation of ArcNetHost. | 32 // Private implementation of ArcNetHost. |
| 33 class ArcNetHostImpl : public ArcService, | 33 class ArcNetHostImpl |
| 34 public ArcBridgeService::Observer, | 34 : public ArcService, |
| 35 public chromeos::NetworkStateHandlerObserver, | 35 public ArcBridgeService::InstanceObserver<mojom::NetInstance>, |
| 36 public mojom::NetHost { | 36 public chromeos::NetworkStateHandlerObserver, |
| 37 public mojom::NetHost { |
| 37 public: | 38 public: |
| 38 // The constructor will register an Observer with ArcBridgeService. | 39 // The constructor will register an Observer with ArcBridgeService. |
| 39 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); | 40 explicit ArcNetHostImpl(ArcBridgeService* arc_bridge_service); |
| 40 ~ArcNetHostImpl() override; | 41 ~ArcNetHostImpl() override; |
| 41 | 42 |
| 42 // ARC -> Chrome calls: | 43 // ARC -> Chrome calls: |
| 43 | 44 |
| 44 void GetNetworksDeprecated( | 45 void GetNetworksDeprecated( |
| 45 bool configured_only, | 46 bool configured_only, |
| 46 bool visible_only, | 47 bool visible_only, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 70 void StartDisconnect(const mojo::String& guid, | 71 void StartDisconnect(const mojo::String& guid, |
| 71 const StartDisconnectCallback& callback) override; | 72 const StartDisconnectCallback& callback) override; |
| 72 | 73 |
| 73 // Overriden from chromeos::NetworkStateHandlerObserver. | 74 // Overriden from chromeos::NetworkStateHandlerObserver. |
| 74 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override; | 75 void ScanCompleted(const chromeos::DeviceState* /*unused*/) override; |
| 75 void OnShuttingDown() override; | 76 void OnShuttingDown() override; |
| 76 void DefaultNetworkChanged(const chromeos::NetworkState* network) override; | 77 void DefaultNetworkChanged(const chromeos::NetworkState* network) override; |
| 77 void DeviceListChanged() override; | 78 void DeviceListChanged() override; |
| 78 void GetDefaultNetwork(const GetDefaultNetworkCallback& callback) override; | 79 void GetDefaultNetwork(const GetDefaultNetworkCallback& callback) override; |
| 79 | 80 |
| 80 // Overridden from ArcBridgeService::Observer: | 81 // Overridden from ArcBridgeService::InterfaceObserver<mojom::NetInstance>: |
| 81 void OnNetInstanceReady() override; | 82 void OnInstanceReady(mojom::NetInstance* net_instance, |
| 83 uint32_t version) override; |
| 82 | 84 |
| 83 private: | 85 private: |
| 84 void DefaultNetworkSuccessCallback(const std::string& service_path, | 86 void DefaultNetworkSuccessCallback(const std::string& service_path, |
| 85 const base::DictionaryValue& dictionary); | 87 const base::DictionaryValue& dictionary); |
| 86 base::ThreadChecker thread_checker_; | 88 base::ThreadChecker thread_checker_; |
| 87 mojo::Binding<arc::mojom::NetHost> binding_; | 89 mojo::Binding<arc::mojom::NetHost> binding_; |
| 88 base::WeakPtrFactory<ArcNetHostImpl> weak_factory_; | 90 base::WeakPtrFactory<ArcNetHostImpl> weak_factory_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); | 92 DISALLOW_COPY_AND_ASSIGN(ArcNetHostImpl); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace arc | 95 } // namespace arc |
| 94 | 96 |
| 95 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ | 97 #endif // COMPONENTS_ARC_NET_ARC_NET_HOST_IMPL_H_ |
| OLD | NEW |