| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 if (chromeos::NetworkHandler::IsInitialized()) { | 302 if (chromeos::NetworkHandler::IsInitialized()) { |
| 303 GetStateHandler()->RemoveObserver(this, FROM_HERE); | 303 GetStateHandler()->RemoveObserver(this, FROM_HERE); |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 void ArcNetHostImpl::OnInstanceReady() { | 307 void ArcNetHostImpl::OnInstanceReady() { |
| 308 DCHECK(thread_checker_.CalledOnValidThread()); | 308 DCHECK(thread_checker_.CalledOnValidThread()); |
| 309 | 309 |
| 310 mojom::NetHostPtr host; | 310 mojom::NetHostPtr host; |
| 311 binding_.Bind(GetProxy(&host)); | 311 binding_.Bind(GetProxy(&host)); |
| 312 arc_bridge_service()->net()->instance()->Init(std::move(host)); | 312 auto* instance = arc_bridge_service()->net()->GetInstanceForMethod("Init"); |
| 313 CHECK(instance); |
| 314 instance->Init(std::move(host)); |
| 313 } | 315 } |
| 314 | 316 |
| 315 void ArcNetHostImpl::GetNetworksDeprecated( | 317 void ArcNetHostImpl::GetNetworksDeprecated( |
| 316 bool configured_only, | 318 bool configured_only, |
| 317 bool visible_only, | 319 bool visible_only, |
| 318 const GetNetworksDeprecatedCallback& callback) { | 320 const GetNetworksDeprecatedCallback& callback) { |
| 319 DCHECK(thread_checker_.CalledOnValidThread()); | 321 DCHECK(thread_checker_.CalledOnValidThread()); |
| 320 if (configured_only && visible_only) { | 322 if (configured_only && visible_only) { |
| 321 VLOG(1) << "Illegal arguments - both configured and visible networks " | 323 VLOG(1) << "Illegal arguments - both configured and visible networks " |
| 322 "requested."; | 324 "requested."; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 bool is_enabled = GetStateHandler()->IsTechnologyEnabled( | 644 bool is_enabled = GetStateHandler()->IsTechnologyEnabled( |
| 643 chromeos::NetworkTypePattern::WiFi()); | 645 chromeos::NetworkTypePattern::WiFi()); |
| 644 net_instance->WifiEnabledStateChanged(is_enabled); | 646 net_instance->WifiEnabledStateChanged(is_enabled); |
| 645 } | 647 } |
| 646 | 648 |
| 647 void ArcNetHostImpl::OnShuttingDown() { | 649 void ArcNetHostImpl::OnShuttingDown() { |
| 648 GetStateHandler()->RemoveObserver(this, FROM_HERE); | 650 GetStateHandler()->RemoveObserver(this, FROM_HERE); |
| 649 } | 651 } |
| 650 | 652 |
| 651 } // namespace arc | 653 } // namespace arc |
| OLD | NEW |