Chromium Code Reviews| 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" |
| 11 #include "chromeos/dbus/shill_manager_client.h" | 11 #include "chromeos/dbus/shill_manager_client.h" |
| 12 #include "chromeos/login/login_state.h" | 12 #include "chromeos/login/login_state.h" |
| 13 #include "chromeos/network/managed_network_configuration_handler.h" | 13 #include "chromeos/network/managed_network_configuration_handler.h" |
| 14 #include "chromeos/network/network_activation_handler.h" | |
|
pneubeck (no reviews)
2015/03/16 10:14:57
is this related?
stevenjb
2015/03/20 16:52:27
No, wrong upstream.
| |
| 14 #include "chromeos/network/network_connection_handler.h" | 15 #include "chromeos/network/network_connection_handler.h" |
| 15 #include "chromeos/network/network_device_handler.h" | 16 #include "chromeos/network/network_device_handler.h" |
| 16 #include "chromeos/network/network_event_log.h" | 17 #include "chromeos/network/network_event_log.h" |
| 17 #include "chromeos/network/network_state.h" | 18 #include "chromeos/network/network_state.h" |
| 18 #include "chromeos/network/network_state_handler.h" | 19 #include "chromeos/network/network_state_handler.h" |
| 19 #include "chromeos/network/network_util.h" | 20 #include "chromeos/network/network_util.h" |
| 20 #include "chromeos/network/onc/onc_signature.h" | 21 #include "chromeos/network/onc/onc_signature.h" |
| 21 #include "chromeos/network/onc/onc_translator.h" | 22 #include "chromeos/network/onc/onc_translator.h" |
| 22 #include "chromeos/network/onc/onc_utils.h" | 23 #include "chromeos/network/onc/onc_utils.h" |
| 23 #include "chromeos/network/portal_detector/network_portal_detector.h" | 24 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 if (!shared && !GetUserIdHash(browser_context_, &user_id_hash, &error)) { | 196 if (!shared && !GetUserIdHash(browser_context_, &user_id_hash, &error)) { |
| 196 failure_callback.Run(error); | 197 failure_callback.Run(error); |
| 197 return; | 198 return; |
| 198 } | 199 } |
| 199 | 200 |
| 200 GetManagedConfigurationHandler()->CreateConfiguration( | 201 GetManagedConfigurationHandler()->CreateConfiguration( |
| 201 user_id_hash, *properties, success_callback, | 202 user_id_hash, *properties, success_callback, |
| 202 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); | 203 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); |
| 203 } | 204 } |
| 204 | 205 |
| 206 void NetworkingPrivateChromeOS::ForgetNetwork( | |
| 207 const std::string& guid, | |
| 208 const VoidCallback& success_callback, | |
| 209 const FailureCallback& failure_callback) { | |
| 210 std::string service_path, error; | |
| 211 if (!GetServicePathFromGuid(guid, &service_path, &error)) { | |
| 212 failure_callback.Run(error); | |
| 213 return; | |
| 214 } | |
| 215 | |
| 216 GetManagedConfigurationHandler()->RemoveConfiguration( | |
| 217 service_path, success_callback, | |
| 218 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); | |
| 219 } | |
| 220 | |
| 205 void NetworkingPrivateChromeOS::GetNetworks( | 221 void NetworkingPrivateChromeOS::GetNetworks( |
| 206 const std::string& network_type, | 222 const std::string& network_type, |
| 207 bool configured_only, | 223 bool configured_only, |
| 208 bool visible_only, | 224 bool visible_only, |
| 209 int limit, | 225 int limit, |
| 210 const NetworkListCallback& success_callback, | 226 const NetworkListCallback& success_callback, |
| 211 const FailureCallback& failure_callback) { | 227 const FailureCallback& failure_callback) { |
| 212 NetworkTypePattern pattern = | 228 NetworkTypePattern pattern = |
| 213 chromeos::onc::NetworkTypePatternFromOncType(network_type); | 229 chromeos::onc::NetworkTypePatternFromOncType(network_type); |
| 214 scoped_ptr<base::ListValue> network_properties_list = | 230 scoped_ptr<base::ListValue> network_properties_list = |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 | 336 |
| 321 return true; | 337 return true; |
| 322 } | 338 } |
| 323 | 339 |
| 324 bool NetworkingPrivateChromeOS::RequestScan() { | 340 bool NetworkingPrivateChromeOS::RequestScan() { |
| 325 GetStateHandler()->RequestScan(); | 341 GetStateHandler()->RequestScan(); |
| 326 return true; | 342 return true; |
| 327 } | 343 } |
| 328 | 344 |
| 329 } // namespace extensions | 345 } // namespace extensions |
| OLD | NEW |