OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/wifi/wifi_service.h" | 5 #include "components/wifi/wifi_service.h" |
6 | 6 |
7 #include <iphlpapi.h> | 7 #include <iphlpapi.h> |
8 #include <objbase.h> | 8 #include <objbase.h> |
9 #include <wlanapi.h> | 9 #include <wlanapi.h> |
10 | 10 |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 if (bss_list != NULL) | 1459 if (bss_list != NULL) |
1460 WlanFreeMemory_function_(bss_list); | 1460 WlanFreeMemory_function_(bss_list); |
1461 | 1461 |
1462 return error; | 1462 return error; |
1463 } | 1463 } |
1464 | 1464 |
1465 Frequency WiFiServiceImpl::GetFrequencyToConnect( | 1465 Frequency WiFiServiceImpl::GetFrequencyToConnect( |
1466 const std::string& network_guid) const { | 1466 const std::string& network_guid) const { |
1467 // Check whether desired frequency is set in |connect_properties_|. | 1467 // Check whether desired frequency is set in |connect_properties_|. |
1468 const base::DictionaryValue* properties; | 1468 const base::DictionaryValue* properties; |
1469 const base::DictionaryValue* wifi; | 1469 if (connect_properties_.GetDictionaryWithoutPathExpansion(network_guid, |
1470 int frequency; | 1470 &properties)) { |
1471 if (connect_properties_.GetDictionaryWithoutPathExpansion( | 1471 const base::DictionaryValue* wifi; |
1472 network_guid, &properties) && | 1472 if (properties->GetDictionary(onc::network_type::kWiFi, &wifi)) { |
1473 properties->GetDictionary(onc::network_type::kWiFi, &wifi) && | 1473 int frequency; |
1474 wifi->GetInteger(onc::wifi::kFrequency, &frequency)) { | 1474 if (wifi->GetInteger(onc::wifi::kFrequency, &frequency)) |
1475 return GetNormalizedFrequency(frequency); | 1475 return GetNormalizedFrequency(frequency); |
| 1476 } |
1476 } | 1477 } |
1477 return kFrequencyAny; | 1478 return kFrequencyAny; |
1478 } | 1479 } |
1479 | 1480 |
1480 DWORD WiFiServiceImpl::GetDesiredBssList( | 1481 DWORD WiFiServiceImpl::GetDesiredBssList( |
1481 DOT11_SSID& ssid, | 1482 DOT11_SSID& ssid, |
1482 Frequency frequency, | 1483 Frequency frequency, |
1483 scoped_ptr<DOT11_BSSID_LIST>* desired_list) { | 1484 scoped_ptr<DOT11_BSSID_LIST>* desired_list) { |
1484 if (client_ == NULL) { | 1485 if (client_ == NULL) { |
1485 NOTREACHED(); | 1486 NOTREACHED(); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 NetworkGuidList changed_networks(1, network_guid); | 1841 NetworkGuidList changed_networks(1, network_guid); |
1841 message_loop_proxy_->PostTask( | 1842 message_loop_proxy_->PostTask( |
1842 FROM_HERE, | 1843 FROM_HERE, |
1843 base::Bind(networks_changed_observer_, changed_networks)); | 1844 base::Bind(networks_changed_observer_, changed_networks)); |
1844 } | 1845 } |
1845 } | 1846 } |
1846 | 1847 |
1847 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } | 1848 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } |
1848 | 1849 |
1849 } // namespace wifi | 1850 } // namespace wifi |
OLD | NEW |