Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
| 6 | 6 |
| 7 #include <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
| 8 #include <dbus/dbus-gtype-specialized.h> | 8 #include <dbus/dbus-gtype-specialized.h> |
| 9 #include <glib-object.h> | 9 #include <glib-object.h> |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <list> | 12 #include <list> |
| 13 #include <map> | 13 #include <map> |
| 14 #include <set> | 14 #include <set> |
| 15 #include <utility> | 15 #include <utility> |
| 16 | 16 |
| 17 #include "base/bind.h" | 17 #include "base/bind.h" |
| 18 #include "base/i18n/icu_encoding_detection.h" | 18 #include "base/i18n/icu_encoding_detection.h" |
| 19 #include "base/i18n/icu_string_conversions.h" | 19 #include "base/i18n/icu_string_conversions.h" |
| 20 #include "base/i18n/time_formatting.h" | 20 #include "base/i18n/time_formatting.h" |
| 21 #include "base/json/json_writer.h" // for debug output only. | |
| 21 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
| 22 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
| 23 #include "base/string_number_conversions.h" | 24 #include "base/string_number_conversions.h" |
| 24 #include "base/string_tokenizer.h" | 25 #include "base/string_tokenizer.h" |
| 25 #include "base/string_util.h" | 26 #include "base/string_util.h" |
| 26 #include "base/stringprintf.h" | 27 #include "base/stringprintf.h" |
| 27 #include "base/utf_string_conversion_utils.h" | 28 #include "base/utf_string_conversion_utils.h" |
| 28 #include "base/utf_string_conversions.h" | 29 #include "base/utf_string_conversions.h" |
| 29 #include "base/values.h" | 30 #include "base/values.h" |
| 30 #include "chrome/browser/chromeos/cros_settings.h" | 31 #include "chrome/browser/chromeos/cros_settings.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 case Value::TYPE_BINARY: | 309 case Value::TYPE_BINARY: |
| 309 case Value::TYPE_LIST: | 310 case Value::TYPE_LIST: |
| 310 // Other Value types shouldn't be passed through this mechanism. | 311 // Other Value types shouldn't be passed through this mechanism. |
| 311 NOTREACHED() << "Unconverted Value of type: " << value->GetType(); | 312 NOTREACHED() << "Unconverted Value of type: " << value->GetType(); |
| 312 return new GValue(); | 313 return new GValue(); |
| 313 } | 314 } |
| 314 NOTREACHED() << "Value conversion failed, type: " << value->GetType(); | 315 NOTREACHED() << "Value conversion failed, type: " << value->GetType(); |
| 315 return new GValue(); | 316 return new GValue(); |
| 316 } | 317 } |
| 317 | 318 |
| 319 GHashTable* ConvertDictionaryValueToGValueMap(const DictionaryValue* dict) { | |
| 320 GHashTable* ghash = | |
| 321 g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | |
| 322 for (DictionaryValue::key_iterator it = dict->begin_keys(); | |
| 323 it != dict->end_keys(); ++it) { | |
| 324 std::string key = *it; | |
| 325 Value* val = NULL; | |
| 326 if (dict->Get(key, &val)) { | |
| 327 g_hash_table_insert(ghash, | |
| 328 g_strdup(const_cast<char*>(key.c_str())), | |
| 329 ConvertValueToGValue(val)); | |
| 330 } | |
| 331 } | |
| 332 return ghash; | |
| 333 } | |
| 334 | |
| 318 } // namespace | 335 } // namespace |
| 319 | 336 |
| 320 //////////////////////////////////////////////////////////////////////////////// | 337 //////////////////////////////////////////////////////////////////////////////// |
| 321 // FoundCellularNetwork | 338 // FoundCellularNetwork |
| 322 | 339 |
| 323 FoundCellularNetwork::FoundCellularNetwork() {} | 340 FoundCellularNetwork::FoundCellularNetwork() {} |
| 324 | 341 |
| 325 FoundCellularNetwork::~FoundCellularNetwork() {} | 342 FoundCellularNetwork::~FoundCellularNetwork() {} |
| 326 | 343 |
| 327 //////////////////////////////////////////////////////////////////////////////// | 344 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 auto_connect_(false), | 390 auto_connect_(false), |
| 374 save_credentials_(false), | 391 save_credentials_(false), |
| 375 priority_order_(0), | 392 priority_order_(0), |
| 376 added_(false), | 393 added_(false), |
| 377 notify_failure_(false), | 394 notify_failure_(false), |
| 378 profile_type_(PROFILE_NONE), | 395 profile_type_(PROFILE_NONE), |
| 379 service_path_(service_path), | 396 service_path_(service_path), |
| 380 type_(type) { | 397 type_(type) { |
| 381 } | 398 } |
| 382 | 399 |
| 383 Network::~Network() {} | 400 Network::~Network() { |
| 401 for (PropertyMap::const_iterator props = property_map_.begin(); | |
| 402 props != property_map_.end(); ++props) { | |
| 403 delete props->second; | |
| 404 } | |
| 405 } | |
| 384 | 406 |
| 385 void Network::SetNetworkParser(NetworkParser* parser) { | 407 void Network::SetNetworkParser(NetworkParser* parser) { |
| 386 network_parser_.reset(parser); | 408 network_parser_.reset(parser); |
| 387 } | 409 } |
| 388 | 410 |
| 411 void Network::UpdatePropertyMap(PropertyIndex index, const base::Value& value) { | |
| 412 // Add the property to property_map_. Delete previous value if necessary. | |
| 413 Value*& entry = property_map_[index]; | |
| 414 delete entry; | |
| 415 entry = value.DeepCopy(); | |
| 416 if (VLOG_IS_ON(2)) { | |
| 417 std::string value_json; | |
| 418 base::JSONWriter::Write(&value, true, &value_json); | |
| 419 VLOG(2) << "Updated property map on network: " | |
| 420 << unique_id() << "[" << index << "] = " << value_json; | |
| 421 } | |
| 422 } | |
| 423 | |
| 389 void Network::SetState(ConnectionState new_state) { | 424 void Network::SetState(ConnectionState new_state) { |
| 390 if (new_state == state_) | 425 if (new_state == state_) |
| 391 return; | 426 return; |
| 392 ConnectionState old_state = state_; | 427 ConnectionState old_state = state_; |
| 393 state_ = new_state; | 428 state_ = new_state; |
| 394 if (!IsConnectingState(new_state)) | 429 if (!IsConnectingState(new_state)) |
| 395 set_connection_started(false); | 430 set_connection_started(false); |
| 396 if (new_state == STATE_FAILURE) { | 431 if (new_state == STATE_FAILURE) { |
| 397 if (old_state != STATE_UNKNOWN && | 432 if (old_state != STATE_UNKNOWN && |
| 398 old_state != STATE_IDLE) { | 433 old_state != STATE_IDLE) { |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1456 // Called from ConnectToWifiNetwork. | 1491 // Called from ConnectToWifiNetwork. |
| 1457 // Calls ConnectToWifiNetworkUsingConnectData if network request succeeds. | 1492 // Calls ConnectToWifiNetworkUsingConnectData if network request succeeds. |
| 1458 virtual void CallRequestWifiNetworkAndConnect( | 1493 virtual void CallRequestWifiNetworkAndConnect( |
| 1459 const std::string& ssid, ConnectionSecurity security) = 0; | 1494 const std::string& ssid, ConnectionSecurity security) = 0; |
| 1460 // Called from ConnectToVirtualNetwork*. | 1495 // Called from ConnectToVirtualNetwork*. |
| 1461 // Calls ConnectToVirtualNetworkUsingConnectData if network request succeeds. | 1496 // Calls ConnectToVirtualNetworkUsingConnectData if network request succeeds. |
| 1462 virtual void CallRequestVirtualNetworkAndConnect( | 1497 virtual void CallRequestVirtualNetworkAndConnect( |
| 1463 const std::string& service_name, | 1498 const std::string& service_name, |
| 1464 const std::string& server_hostname, | 1499 const std::string& server_hostname, |
| 1465 ProviderType provider_type) = 0; | 1500 ProviderType provider_type) = 0; |
| 1501 // Call to configure a wifi service. The identifier is either a service_path | |
| 1502 // or a GUID. |info| is a dictionary of property values. | |
| 1503 virtual void CallConfigureService(const std::string& identifier, | |
| 1504 const DictionaryValue* info) = 0; | |
| 1466 // Called from NetworkConnectStart. | 1505 // Called from NetworkConnectStart. |
| 1467 // Calls NetworkConnectCompleted when the connection attept completes. | 1506 // Calls NetworkConnectCompleted when the connection attept completes. |
| 1468 virtual void CallConnectToNetwork(Network* network) = 0; | 1507 virtual void CallConnectToNetwork(Network* network) = 0; |
| 1469 // Called from DeleteRememberedNetwork. | 1508 // Called from DeleteRememberedNetwork. |
| 1470 virtual void CallDeleteRememberedNetwork( | 1509 virtual void CallDeleteRememberedNetwork( |
| 1471 const std::string& profile_path, const std::string& service_path) = 0; | 1510 const std::string& profile_path, const std::string& service_path) = 0; |
| 1472 | 1511 |
| 1473 // Called from Enable*NetworkDevice. | 1512 // Called from Enable*NetworkDevice. |
| 1474 // Asynchronously enables or disables the specified device type. | 1513 // Asynchronously enables or disables the specified device type. |
| 1475 virtual void CallEnableNetworkDeviceType( | 1514 virtual void CallEnableNetworkDeviceType( |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2784 for (int i = 0; i < parser.GetCertificatesSize(); i++) { | 2823 for (int i = 0; i < parser.GetCertificatesSize(); i++) { |
| 2785 // Insert each of the available certs into the certificate DB. | 2824 // Insert each of the available certs into the certificate DB. |
| 2786 if (!parser.ParseCertificate(i)) { | 2825 if (!parser.ParseCertificate(i)) { |
| 2787 DLOG(WARNING) << "Cannot parse certificate in ONC file"; | 2826 DLOG(WARNING) << "Cannot parse certificate in ONC file"; |
| 2788 return false; | 2827 return false; |
| 2789 } | 2828 } |
| 2790 } | 2829 } |
| 2791 | 2830 |
| 2792 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) { | 2831 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) { |
| 2793 // Parse Open Network Configuration blob into a temporary Network object. | 2832 // Parse Open Network Configuration blob into a temporary Network object. |
| 2794 Network* network = parser.ParseNetwork(i); | 2833 scoped_ptr<Network> network(parser.ParseNetwork(i)); |
| 2795 if (!network) { | 2834 if (!network.get()) { |
| 2796 DLOG(WARNING) << "Cannot parse networks in ONC file"; | 2835 DLOG(WARNING) << "Cannot parse networks in ONC file"; |
| 2797 return false; | 2836 return false; |
| 2798 } | 2837 } |
| 2799 | 2838 |
| 2800 // TODO(chocobo): Pass parsed network values to flimflam update network. | 2839 DictionaryValue dict; |
| 2840 for (Network::PropertyMap::const_iterator props = | |
| 2841 network->property_map_.begin(); | |
| 2842 props != network->property_map_.end(); ++props) { | |
| 2843 std::string key = | |
| 2844 NativeNetworkParser::property_mapper()->GetKey(props->first); | |
| 2845 if (!key.empty()) | |
| 2846 dict.SetWithoutPathExpansion(key, props->second->DeepCopy()); | |
| 2847 } | |
| 2848 | |
| 2849 CallConfigureService(network->unique_id(), &dict); | |
| 2801 } | 2850 } |
| 2802 return parser.GetNetworkConfigsSize() != 0; | 2851 return parser.GetNetworkConfigsSize() != 0; |
| 2803 } | 2852 } |
| 2804 | 2853 |
| 2805 //////////////////////////////////////////////////////////////////////////// | 2854 //////////////////////////////////////////////////////////////////////////// |
| 2806 // Testing functions. | 2855 // Testing functions. |
| 2807 | 2856 |
| 2808 bool NetworkLibraryImplBase::SetActiveNetwork( | 2857 bool NetworkLibraryImplBase::SetActiveNetwork( |
| 2809 ConnectionType type, const std::string& service_path) { | 2858 ConnectionType type, const std::string& service_path) { |
| 2810 Network* network = NULL; | 2859 Network* network = NULL; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3289 ////////////////////////////////////////////////////////////////////////////// | 3338 ////////////////////////////////////////////////////////////////////////////// |
| 3290 // NetworkLibraryImplBase implementation. | 3339 // NetworkLibraryImplBase implementation. |
| 3291 | 3340 |
| 3292 virtual void MonitorNetworkStart(const std::string& service_path) OVERRIDE; | 3341 virtual void MonitorNetworkStart(const std::string& service_path) OVERRIDE; |
| 3293 virtual void MonitorNetworkStop(const std::string& service_path) OVERRIDE; | 3342 virtual void MonitorNetworkStop(const std::string& service_path) OVERRIDE; |
| 3294 virtual void MonitorNetworkDeviceStart( | 3343 virtual void MonitorNetworkDeviceStart( |
| 3295 const std::string& device_path) OVERRIDE; | 3344 const std::string& device_path) OVERRIDE; |
| 3296 virtual void MonitorNetworkDeviceStop( | 3345 virtual void MonitorNetworkDeviceStop( |
| 3297 const std::string& device_path) OVERRIDE; | 3346 const std::string& device_path) OVERRIDE; |
| 3298 | 3347 |
| 3348 virtual void CallConfigureService(const std::string& identifier, | |
| 3349 const DictionaryValue* info) OVERRIDE; | |
| 3299 virtual void CallConnectToNetwork(Network* network) OVERRIDE; | 3350 virtual void CallConnectToNetwork(Network* network) OVERRIDE; |
| 3300 virtual void CallRequestWifiNetworkAndConnect( | 3351 virtual void CallRequestWifiNetworkAndConnect( |
| 3301 const std::string& ssid, ConnectionSecurity security) OVERRIDE; | 3352 const std::string& ssid, ConnectionSecurity security) OVERRIDE; |
| 3302 virtual void CallRequestVirtualNetworkAndConnect( | 3353 virtual void CallRequestVirtualNetworkAndConnect( |
| 3303 const std::string& service_name, | 3354 const std::string& service_name, |
| 3304 const std::string& server_hostname, | 3355 const std::string& server_hostname, |
| 3305 ProviderType provider_type) OVERRIDE; | 3356 ProviderType provider_type) OVERRIDE; |
| 3306 virtual void CallDeleteRememberedNetwork( | 3357 virtual void CallDeleteRememberedNetwork( |
| 3307 const std::string& profile_path, | 3358 const std::string& profile_path, |
| 3308 const std::string& service_path) OVERRIDE; | 3359 const std::string& service_path) OVERRIDE; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3352 static void PinOperationCallback(void* object, | 3403 static void PinOperationCallback(void* object, |
| 3353 const char* path, | 3404 const char* path, |
| 3354 NetworkMethodErrorType error, | 3405 NetworkMethodErrorType error, |
| 3355 const char* error_message); | 3406 const char* error_message); |
| 3356 | 3407 |
| 3357 static void CellularRegisterCallback(void* object, | 3408 static void CellularRegisterCallback(void* object, |
| 3358 const char* path, | 3409 const char* path, |
| 3359 NetworkMethodErrorType error, | 3410 NetworkMethodErrorType error, |
| 3360 const char* error_message); | 3411 const char* error_message); |
| 3361 | 3412 |
| 3413 static void ConfigureServiceCallback(void* object, | |
| 3414 const char* service_path, | |
| 3415 NetworkMethodErrorType error, | |
| 3416 const char* error_message); | |
| 3417 | |
| 3362 static void NetworkConnectCallback(void* object, | 3418 static void NetworkConnectCallback(void* object, |
| 3363 const char* service_path, | 3419 const char* service_path, |
| 3364 NetworkMethodErrorType error, | 3420 NetworkMethodErrorType error, |
| 3365 const char* error_message); | 3421 const char* error_message); |
| 3366 | 3422 |
| 3367 static void WifiServiceUpdateAndConnect( | 3423 static void WifiServiceUpdateAndConnect( |
| 3368 void* object, const char* service_path, GHashTable* ghash); | 3424 void* object, const char* service_path, GHashTable* ghash); |
| 3369 static void VPNServiceUpdateAndConnect( | 3425 static void VPNServiceUpdateAndConnect( |
| 3370 void* object, const char* service_path, GHashTable* ghash); | 3426 void* object, const char* service_path, GHashTable* ghash); |
| 3371 | 3427 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3610 chromeos::RequestNetworkDeviceProperties(path.c_str(), | 3666 chromeos::RequestNetworkDeviceProperties(path.c_str(), |
| 3611 &NetworkDeviceUpdate, | 3667 &NetworkDeviceUpdate, |
| 3612 this); | 3668 this); |
| 3613 } | 3669 } |
| 3614 } | 3670 } |
| 3615 | 3671 |
| 3616 ///////////////////////////////////////////////////////////////////////////// | 3672 ///////////////////////////////////////////////////////////////////////////// |
| 3617 // NetworkLibraryImplBase connect implementation. | 3673 // NetworkLibraryImplBase connect implementation. |
| 3618 | 3674 |
| 3619 // static callback | 3675 // static callback |
| 3676 void NetworkLibraryImplCros::ConfigureServiceCallback( | |
| 3677 void* object, | |
| 3678 const char* service_path, | |
| 3679 NetworkMethodErrorType error, | |
| 3680 const char* error_message) { | |
| 3681 DCHECK(CrosLibrary::Get()->libcros_loaded()); | |
|
stevenjb
2011/11/30 17:36:20
nit: DCHECK is unnecessary here.
Charlie Lee
2011/11/30 18:01:21
Done.
| |
| 3682 if (error != NETWORK_METHOD_ERROR_NONE) { | |
| 3683 LOG(WARNING) << "Error from ConfigureService callback for: " | |
| 3684 << service_path | |
| 3685 << " Error: " << error << " Message: " << error_message; | |
| 3686 } | |
| 3687 } | |
| 3688 | |
| 3689 void NetworkLibraryImplCros::CallConfigureService(const std::string& identifier, | |
| 3690 const DictionaryValue* info) { | |
| 3691 GHashTable* ghash = ConvertDictionaryValueToGValueMap(info); | |
| 3692 chromeos::ConfigureService(identifier.c_str(), ghash, | |
| 3693 ConfigureServiceCallback, this); | |
| 3694 } | |
| 3695 | |
| 3696 // static callback | |
| 3620 void NetworkLibraryImplCros::NetworkConnectCallback( | 3697 void NetworkLibraryImplCros::NetworkConnectCallback( |
| 3621 void* object, | 3698 void* object, |
| 3622 const char* service_path, | 3699 const char* service_path, |
| 3623 NetworkMethodErrorType error, | 3700 NetworkMethodErrorType error, |
| 3624 const char* error_message) { | 3701 const char* error_message) { |
| 3625 DCHECK(CrosLibrary::Get()->libcros_loaded()); | 3702 DCHECK(CrosLibrary::Get()->libcros_loaded()); |
| 3626 NetworkConnectStatus status; | 3703 NetworkConnectStatus status; |
| 3627 if (error == NETWORK_METHOD_ERROR_NONE) { | 3704 if (error == NETWORK_METHOD_ERROR_NONE) { |
| 3628 status = CONNECT_SUCCESS; | 3705 status = CONNECT_SUCCESS; |
| 3629 } else { | 3706 } else { |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4696 | 4773 |
| 4697 // NetworkLibraryImplBase implementation. | 4774 // NetworkLibraryImplBase implementation. |
| 4698 | 4775 |
| 4699 virtual void MonitorNetworkStart(const std::string& service_path) OVERRIDE {} | 4776 virtual void MonitorNetworkStart(const std::string& service_path) OVERRIDE {} |
| 4700 virtual void MonitorNetworkStop(const std::string& service_path) OVERRIDE {} | 4777 virtual void MonitorNetworkStop(const std::string& service_path) OVERRIDE {} |
| 4701 virtual void MonitorNetworkDeviceStart( | 4778 virtual void MonitorNetworkDeviceStart( |
| 4702 const std::string& device_path) OVERRIDE {} | 4779 const std::string& device_path) OVERRIDE {} |
| 4703 virtual void MonitorNetworkDeviceStop( | 4780 virtual void MonitorNetworkDeviceStop( |
| 4704 const std::string& device_path) OVERRIDE {} | 4781 const std::string& device_path) OVERRIDE {} |
| 4705 | 4782 |
| 4783 virtual void CallConfigureService(const std::string& identifier, | |
| 4784 const DictionaryValue* info) OVERRIDE {} | |
| 4706 virtual void CallConnectToNetwork(Network* network) OVERRIDE; | 4785 virtual void CallConnectToNetwork(Network* network) OVERRIDE; |
| 4707 virtual void CallRequestWifiNetworkAndConnect( | 4786 virtual void CallRequestWifiNetworkAndConnect( |
| 4708 const std::string& ssid, ConnectionSecurity security) OVERRIDE; | 4787 const std::string& ssid, ConnectionSecurity security) OVERRIDE; |
| 4709 virtual void CallRequestVirtualNetworkAndConnect( | 4788 virtual void CallRequestVirtualNetworkAndConnect( |
| 4710 const std::string& service_name, | 4789 const std::string& service_name, |
| 4711 const std::string& server_hostname, | 4790 const std::string& server_hostname, |
| 4712 ProviderType provider_type) OVERRIDE; | 4791 ProviderType provider_type) OVERRIDE; |
| 4713 | 4792 |
| 4714 virtual void CallDeleteRememberedNetwork( | 4793 virtual void CallDeleteRememberedNetwork( |
| 4715 const std::string& profile_path, | 4794 const std::string& profile_path, |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4912 vpn3->set_provider_type(PROVIDER_TYPE_OPEN_VPN); | 4991 vpn3->set_provider_type(PROVIDER_TYPE_OPEN_VPN); |
| 4913 AddStubNetwork(vpn3, PROFILE_USER); | 4992 AddStubNetwork(vpn3, PROFILE_USER); |
| 4914 | 4993 |
| 4915 wifi_scanning_ = false; | 4994 wifi_scanning_ = false; |
| 4916 offline_mode_ = false; | 4995 offline_mode_ = false; |
| 4917 | 4996 |
| 4918 // Ensure our active network is connected and vice versa, otherwise our | 4997 // Ensure our active network is connected and vice versa, otherwise our |
| 4919 // autotest browser_tests sometimes conclude the device is offline. | 4998 // autotest browser_tests sometimes conclude the device is offline. |
| 4920 CHECK(active_network()->connected()); | 4999 CHECK(active_network()->connected()); |
| 4921 CHECK(connected_network()->is_active()); | 5000 CHECK(connected_network()->is_active()); |
| 5001 | |
| 5002 std::string test_blob( | |
| 5003 "{" | |
| 5004 " \"NetworkConfigurations\": [" | |
| 5005 " {" | |
| 5006 " \"GUID\": \"guid\"," | |
| 5007 " \"Type\": \"WiFi\"," | |
| 5008 " \"WiFi\": {" | |
| 5009 " \"Security\": \"WEP\"," | |
| 5010 " \"SSID\": \"MySSID\"," | |
| 5011 " }" | |
| 5012 " }" | |
| 5013 " ]," | |
| 5014 " \"Certificates\": []" | |
| 5015 "}"); | |
| 5016 LoadOncNetworks(test_blob); | |
| 4922 } | 5017 } |
| 4923 | 5018 |
| 4924 //////////////////////////////////////////////////////////////////////////// | 5019 //////////////////////////////////////////////////////////////////////////// |
| 4925 // NetworkLibraryImplStub private methods. | 5020 // NetworkLibraryImplStub private methods. |
| 4926 | 5021 |
| 4927 void NetworkLibraryImplStub::AddStubNetwork( | 5022 void NetworkLibraryImplStub::AddStubNetwork( |
| 4928 Network* network, NetworkProfileType profile_type) { | 5023 Network* network, NetworkProfileType profile_type) { |
| 4929 network->priority_order_ = network_priority_order_++; | 5024 network->priority_order_ = network_priority_order_++; |
| 4930 network->CalculateUniqueId(); | 5025 network->CalculateUniqueId(); |
| 4931 if (!network->unique_id().empty()) | 5026 if (!network->unique_id().empty()) |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5159 return impl; | 5254 return impl; |
| 5160 } | 5255 } |
| 5161 | 5256 |
| 5162 ///////////////////////////////////////////////////////////////////////////// | 5257 ///////////////////////////////////////////////////////////////////////////// |
| 5163 | 5258 |
| 5164 } // namespace chromeos | 5259 } // namespace chromeos |
| 5165 | 5260 |
| 5166 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 5261 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
| 5167 // won't be deleted until its last InvokeLater is run. | 5262 // won't be deleted until its last InvokeLater is run. |
| 5168 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase); | 5263 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase); |
| OLD | NEW |