OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_chromeos.
h" | 5 #include "extensions/browser/api/networking_private/networking_private_chromeos.
h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 const std::string& network_type, | 286 const std::string& network_type, |
287 bool configured_only, | 287 bool configured_only, |
288 bool visible_only, | 288 bool visible_only, |
289 int limit, | 289 int limit, |
290 const NetworkListCallback& success_callback, | 290 const NetworkListCallback& success_callback, |
291 const FailureCallback& failure_callback) { | 291 const FailureCallback& failure_callback) { |
292 NetworkTypePattern pattern = | 292 NetworkTypePattern pattern = |
293 chromeos::onc::NetworkTypePatternFromOncType(network_type); | 293 chromeos::onc::NetworkTypePatternFromOncType(network_type); |
294 scoped_ptr<base::ListValue> network_properties_list = | 294 scoped_ptr<base::ListValue> network_properties_list = |
295 chromeos::network_util::TranslateNetworkListToONC( | 295 chromeos::network_util::TranslateNetworkListToONC( |
296 pattern, configured_only, visible_only, limit, false /* debugging */); | 296 pattern, configured_only, visible_only, limit); |
297 success_callback.Run(network_properties_list.Pass()); | 297 success_callback.Run(network_properties_list.Pass()); |
298 } | 298 } |
299 | 299 |
300 void NetworkingPrivateChromeOS::StartConnect( | 300 void NetworkingPrivateChromeOS::StartConnect( |
301 const std::string& guid, | 301 const std::string& guid, |
302 const VoidCallback& success_callback, | 302 const VoidCallback& success_callback, |
303 const FailureCallback& failure_callback) { | 303 const FailureCallback& failure_callback) { |
304 std::string service_path, error; | 304 std::string service_path, error; |
305 if (!GetServicePathFromGuid(guid, &service_path, &error)) { | 305 if (!GetServicePathFromGuid(guid, &service_path, &error)) { |
306 failure_callback.Run(error); | 306 failure_callback.Run(error); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 return true; | 561 return true; |
562 } | 562 } |
563 | 563 |
564 bool NetworkingPrivateChromeOS::RequestScan() { | 564 bool NetworkingPrivateChromeOS::RequestScan() { |
565 GetStateHandler()->RequestScan(); | 565 GetStateHandler()->RequestScan(); |
566 return true; | 566 return true; |
567 } | 567 } |
568 | 568 |
569 } // namespace extensions | 569 } // namespace extensions |
OLD | NEW |