Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1176)

Unified Diff: components/arc/net/arc_net_host_impl.cc

Issue 1798293002: ARC: Implement SetWifiEnabledState API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/net/arc_net_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/net/arc_net_host_impl.cc
diff --git a/components/arc/net/arc_net_host_impl.cc b/components/arc/net/arc_net_host_impl.cc
index 7582d0e5e31d9ca9070b8bac68bda2174d00d89c..ab0dd8e071692d849897a57f5e76b7f6d24e6614 100644
--- a/components/arc/net/arc_net_host_impl.cc
+++ b/components/arc/net/arc_net_host_impl.cc
@@ -14,6 +14,7 @@
#include "base/time/time.h"
#include "chromeos/network/network_handler.h"
#include "chromeos/network/network_state_handler.h"
+#include "chromeos/network/network_type_pattern.h"
#include "chromeos/network/network_util.h"
#include "chromeos/network/onc/onc_utils.h"
#include "components/arc/arc_bridge_service.h"
@@ -140,10 +141,19 @@ void ArcNetHostImpl::GetWifiEnabledState(
const GetWifiEnabledStateCallback& callback) {
bool is_enabled = GetStateHandler()->IsTechnologyEnabled(
chromeos::NetworkTypePattern::WiFi());
-
callback.Run(is_enabled);
}
+void ArcNetHostImpl::SetWifiEnabledState(
+ bool is_enabled,
+ const SetWifiEnabledStateCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ GetStateHandler()->SetTechnologyEnabled(
+ chromeos::NetworkTypePattern::WiFi(), is_enabled,
+ chromeos::network_handler::ErrorCallback());
dcheng 2016/03/15 23:19:43 Out of curiosity... how are you supposed to know i
stevenjb 2016/03/15 23:31:31 There's an email thread discussing this. Right now
+ callback.Run();
+}
+
void ArcNetHostImpl::StartScan() {
GetStateHandler()->RequestScan();
}
« no previous file with comments | « components/arc/net/arc_net_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698