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_api.h" | 5 #include "extensions/browser/api/networking_private/networking_private_api.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 "components/onc/onc_constants.h" | 10 #include "components/onc/onc_constants.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 private_api::ToString(private_api::NETWORK_TYPE_CELLULAR)); | 338 private_api::ToString(private_api::NETWORK_TYPE_CELLULAR)); |
| 339 } else { | 339 } else { |
| 340 LOG(ERROR) << "networkingPrivate: Unexpected type: " << type; | 340 LOG(ERROR) << "networkingPrivate: Unexpected type: " << type; |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 SetResult(enabled_networks_list.release()); | 343 SetResult(enabled_networks_list.release()); |
| 344 return true; | 344 return true; |
| 345 } | 345 } |
| 346 | 346 |
| 347 //////////////////////////////////////////////////////////////////////////////// | 347 //////////////////////////////////////////////////////////////////////////////// |
| 348 // NetworkingPrivateGetDeviceStatesFunction | |
| 349 | |
| 350 NetworkingPrivateGetDeviceStatesFunction:: | |
| 351 ~NetworkingPrivateGetDeviceStatesFunction() { | |
| 352 } | |
| 353 | |
| 354 bool NetworkingPrivateGetDeviceStatesFunction::RunSync() { | |
| 355 scoped_ptr<NetworkingPrivateDelegate::DeviceStateList> device_states( | |
| 356 GetDelegate(browser_context())->GetDeviceStateList()); | |
| 357 LOG(ERROR) << "Get device states."; | |
|
pneubeck (no reviews)
2015/04/09 09:41:22
debug left over
stevenjb
2015/04/09 16:20:25
Done.
| |
| 358 if (!device_states) { | |
| 359 LOG(ERROR) << "No device states."; | |
|
pneubeck (no reviews)
2015/04/09 09:41:22
probably a warning?
stevenjb
2015/04/09 16:20:25
Done.
| |
| 360 error_ = networking_private::kErrorNotSupported; | |
| 361 return false; | |
| 362 } | |
| 363 | |
| 364 scoped_ptr<base::ListValue> device_state_list(new base::ListValue); | |
| 365 for (const private_api::DeviceStateProperties* properties : *device_states) | |
| 366 device_state_list->Append(properties->ToValue().release()); | |
| 367 LOG(ERROR) << "Device states: " << device_state_list->GetSize(); | |
|
pneubeck (no reviews)
2015/04/09 09:41:22
debug left over
stevenjb
2015/04/09 16:20:25
Done.
| |
| 368 SetResult(device_state_list.release()); | |
| 369 return true; | |
| 370 } | |
| 371 | |
| 372 //////////////////////////////////////////////////////////////////////////////// | |
| 348 // NetworkingPrivateEnableNetworkTypeFunction | 373 // NetworkingPrivateEnableNetworkTypeFunction |
| 349 | 374 |
| 350 NetworkingPrivateEnableNetworkTypeFunction:: | 375 NetworkingPrivateEnableNetworkTypeFunction:: |
| 351 ~NetworkingPrivateEnableNetworkTypeFunction() { | 376 ~NetworkingPrivateEnableNetworkTypeFunction() { |
| 352 } | 377 } |
| 353 | 378 |
| 354 bool NetworkingPrivateEnableNetworkTypeFunction::RunSync() { | 379 bool NetworkingPrivateEnableNetworkTypeFunction::RunSync() { |
| 355 scoped_ptr<private_api::EnableNetworkType::Params> params = | 380 scoped_ptr<private_api::EnableNetworkType::Params> params = |
| 356 private_api::EnableNetworkType::Params::Create(*args_); | 381 private_api::EnableNetworkType::Params::Create(*args_); |
| 357 EXTENSION_FUNCTION_VALIDATE(params); | 382 EXTENSION_FUNCTION_VALIDATE(params); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 SendResponse(true); | 701 SendResponse(true); |
| 677 } | 702 } |
| 678 | 703 |
| 679 void NetworkingPrivateGetCaptivePortalStatusFunction::Failure( | 704 void NetworkingPrivateGetCaptivePortalStatusFunction::Failure( |
| 680 const std::string& error) { | 705 const std::string& error) { |
| 681 error_ = error; | 706 error_ = error; |
| 682 SendResponse(false); | 707 SendResponse(false); |
| 683 } | 708 } |
| 684 | 709 |
| 685 } // namespace extensions | 710 } // namespace extensions |
| OLD | NEW |