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

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

Issue 1751793002: ARC: Remove error status setting in GetNetworks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added enum instead of booleans for GetNetworks. Created 4 years, 10 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 da7f4024d1c4a90eef73399225a938c9290a91c6..a9d28b80986a9b4a4833f88f83f56b6f8cfa8627 100644
--- a/components/arc/net/arc_net_host_impl.cc
+++ b/components/arc/net/arc_net_host_impl.cc
@@ -52,11 +52,36 @@ void ArcNetHostImpl::OnNetInstanceReady() {
arc_bridge_service()->net_instance()->Init(std::move(host));
}
-void ArcNetHostImpl::GetNetworks(bool configured_only,
- bool visible_only,
+void ArcNetHostImpl::GetNetworksDeprecated(
+ bool configured_only,
+ bool visible_only,
+ const GetNetworksDeprecatedCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ if (configured_only && visible_only) {
+ VLOG(1) << "Illegal arguments - both configured and visible networks "
+ "requested.";
+ return;
+ }
+
+ GetNetworksRequestType type = GetNetworksRequestType::CONFIGURED_ONLY;
+ if (visible_only) {
+ type = GetNetworksRequestType::VISIBLE_ONLY;
+ }
+
+ GetNetworks(type, callback);
+}
+
+void ArcNetHostImpl::GetNetworks(GetNetworksRequestType type,
const GetNetworksCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
NetworkDataPtr data = NetworkData::New();
- data->status = NetworkResult::SUCCESS;
+ bool configured_only = true;
+ bool visible_only = false;
+ if (type == GetNetworksRequestType::VISIBLE_ONLY) {
+ configured_only = false;
+ visible_only = true;
+ }
dcheng 2016/03/03 05:56:20 It might be slightly shorter to just write: bool
// Retrieve list of nearby wifi networks
chromeos::NetworkTypePattern network_pattern =
« 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