OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/cros/cros_network_functions.h" | 5 #include "chrome/browser/chromeos/cros/cros_network_functions.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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_tokenizer.h" | 10 #include "base/string_tokenizer.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 profile_entry_path)); | 501 profile_entry_path)); |
502 } | 502 } |
503 | 503 |
504 void CrosRequestHiddenWifiNetworkProperties( | 504 void CrosRequestHiddenWifiNetworkProperties( |
505 const std::string& ssid, | 505 const std::string& ssid, |
506 const std::string& security, | 506 const std::string& security, |
507 const NetworkPropertiesCallback& callback) { | 507 const NetworkPropertiesCallback& callback) { |
508 base::DictionaryValue properties; | 508 base::DictionaryValue properties; |
509 properties.SetWithoutPathExpansion( | 509 properties.SetWithoutPathExpansion( |
510 flimflam::kModeProperty, | 510 flimflam::kModeProperty, |
511 base::Value::CreateStringValue(flimflam::kModeManaged)); | 511 new base::StringValue(flimflam::kModeManaged)); |
512 properties.SetWithoutPathExpansion( | 512 properties.SetWithoutPathExpansion( |
513 flimflam::kTypeProperty, | 513 flimflam::kTypeProperty, |
514 base::Value::CreateStringValue(flimflam::kTypeWifi)); | 514 new base::StringValue(flimflam::kTypeWifi)); |
515 properties.SetWithoutPathExpansion( | 515 properties.SetWithoutPathExpansion( |
516 flimflam::kSSIDProperty, | 516 flimflam::kSSIDProperty, |
517 base::Value::CreateStringValue(ssid)); | 517 new base::StringValue(ssid)); |
518 properties.SetWithoutPathExpansion( | 518 properties.SetWithoutPathExpansion( |
519 flimflam::kSecurityProperty, | 519 flimflam::kSecurityProperty, |
520 base::Value::CreateStringValue(security)); | 520 new base::StringValue(security)); |
521 // shill.Manger.GetService() will apply the property changes in | 521 // shill.Manger.GetService() will apply the property changes in |
522 // |properties| and return a new or existing service to OnGetService(). | 522 // |properties| and return a new or existing service to OnGetService(). |
523 // OnGetService will then call GetProperties which will then call callback. | 523 // OnGetService will then call GetProperties which will then call callback. |
524 DBusThreadManager::Get()->GetShillManagerClient()->GetService( | 524 DBusThreadManager::Get()->GetShillManagerClient()->GetService( |
525 properties, base::Bind(&OnGetService, callback), | 525 properties, base::Bind(&OnGetService, callback), |
526 base::Bind(&IgnoreErrors)); | 526 base::Bind(&IgnoreErrors)); |
527 } | 527 } |
528 | 528 |
529 void CrosRequestVirtualNetworkProperties( | 529 void CrosRequestVirtualNetworkProperties( |
530 const std::string& service_name, | 530 const std::string& service_name, |
531 const std::string& server_hostname, | 531 const std::string& server_hostname, |
532 const std::string& provider_type, | 532 const std::string& provider_type, |
533 const NetworkPropertiesCallback& callback) { | 533 const NetworkPropertiesCallback& callback) { |
534 base::DictionaryValue properties; | 534 base::DictionaryValue properties; |
535 properties.SetWithoutPathExpansion( | 535 properties.SetWithoutPathExpansion( |
536 flimflam::kTypeProperty, | 536 flimflam::kTypeProperty, |
537 base::Value::CreateStringValue(flimflam::kTypeVPN)); | 537 new base::StringValue(flimflam::kTypeVPN)); |
538 properties.SetWithoutPathExpansion( | 538 properties.SetWithoutPathExpansion( |
539 flimflam::kProviderNameProperty, | 539 flimflam::kProviderNameProperty, |
540 base::Value::CreateStringValue(service_name)); | 540 new base::StringValue(service_name)); |
541 properties.SetWithoutPathExpansion( | 541 properties.SetWithoutPathExpansion( |
542 flimflam::kProviderHostProperty, | 542 flimflam::kProviderHostProperty, |
543 base::Value::CreateStringValue(server_hostname)); | 543 new base::StringValue(server_hostname)); |
544 properties.SetWithoutPathExpansion( | 544 properties.SetWithoutPathExpansion( |
545 flimflam::kProviderTypeProperty, | 545 flimflam::kProviderTypeProperty, |
546 base::Value::CreateStringValue(provider_type)); | 546 new base::StringValue(provider_type)); |
547 // The actual value of Domain does not matter, so just use service_name. | 547 // The actual value of Domain does not matter, so just use service_name. |
548 properties.SetWithoutPathExpansion( | 548 properties.SetWithoutPathExpansion( |
549 flimflam::kVPNDomainProperty, | 549 flimflam::kVPNDomainProperty, |
550 base::Value::CreateStringValue(service_name)); | 550 new base::StringValue(service_name)); |
551 | 551 |
552 // shill.Manger.GetService() will apply the property changes in | 552 // shill.Manger.GetService() will apply the property changes in |
553 // |properties| and pass a new or existing service to OnGetService(). | 553 // |properties| and pass a new or existing service to OnGetService(). |
554 // OnGetService will then call GetProperties which will then call callback. | 554 // OnGetService will then call GetProperties which will then call callback. |
555 DBusThreadManager::Get()->GetShillManagerClient()->GetService( | 555 DBusThreadManager::Get()->GetShillManagerClient()->GetService( |
556 properties, base::Bind(&OnGetService, callback), | 556 properties, base::Bind(&OnGetService, callback), |
557 base::Bind(&IgnoreErrors)); | 557 base::Bind(&IgnoreErrors)); |
558 } | 558 } |
559 | 559 |
560 void CrosRequestNetworkServiceDisconnect(const std::string& service_path) { | 560 void CrosRequestNetworkServiceDisconnect(const std::string& service_path) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 const std::string& carrier, | 904 const std::string& carrier, |
905 const NetworkOperationCallback& callback) { | 905 const NetworkOperationCallback& callback) { |
906 DBusThreadManager::Get()->GetShillDeviceClient()->SetCarrier( | 906 DBusThreadManager::Get()->GetShillDeviceClient()->SetCarrier( |
907 dbus::ObjectPath(device_path), carrier, | 907 dbus::ObjectPath(device_path), carrier, |
908 base::Bind(callback, device_path, NETWORK_METHOD_ERROR_NONE, | 908 base::Bind(callback, device_path, NETWORK_METHOD_ERROR_NONE, |
909 std::string()), | 909 std::string()), |
910 base::Bind(&OnNetworkActionError, callback, device_path)); | 910 base::Bind(&OnNetworkActionError, callback, device_path)); |
911 } | 911 } |
912 | 912 |
913 } // namespace chromeos | 913 } // namespace chromeos |
OLD | NEW |