| 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 #include "components/arc/net/arc_net_host_impl.h" | 5 #include "components/arc/net/arc_net_host_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 chromeos::network_handler::ErrorCallback()); | 170 chromeos::network_handler::ErrorCallback()); |
| 171 callback.Run(true); | 171 callback.Run(true); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ArcNetHostImpl::StartScan() { | 175 void ArcNetHostImpl::StartScan() { |
| 176 GetStateHandler()->RequestScan(); | 176 GetStateHandler()->RequestScan(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void ArcNetHostImpl::ScanCompleted(const chromeos::DeviceState* /*unused*/) { | 179 void ArcNetHostImpl::ScanCompleted(const chromeos::DeviceState* /*unused*/) { |
| 180 if (!arc_bridge_service()->net_instance()) { |
| 181 VLOG(2) << "NetInstance not ready yet"; |
| 182 return; |
| 183 } |
| 180 if (arc_bridge_service()->net_version() < 1) { | 184 if (arc_bridge_service()->net_version() < 1) { |
| 181 VLOG(1) << "ArcBridgeService does not support ScanCompleted."; | 185 VLOG(1) << "NetInstance does not support ScanCompleted."; |
| 182 return; | 186 return; |
| 183 } | 187 } |
| 184 | 188 |
| 185 arc_bridge_service()->net_instance()->ScanCompleted(); | 189 arc_bridge_service()->net_instance()->ScanCompleted(); |
| 186 } | 190 } |
| 187 | 191 |
| 188 void ArcNetHostImpl::OnShuttingDown() { | 192 void ArcNetHostImpl::OnShuttingDown() { |
| 189 GetStateHandler()->RemoveObserver(this, FROM_HERE); | 193 GetStateHandler()->RemoveObserver(this, FROM_HERE); |
| 190 } | 194 } |
| 191 | 195 |
| 192 } // namespace arc | 196 } // namespace arc |
| OLD | NEW |