| 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 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 bool WiFiServiceImpl::AuthEncryptionFromSecurity( | 1790 bool WiFiServiceImpl::AuthEncryptionFromSecurity( |
| 1791 const std::string& security, | 1791 const std::string& security, |
| 1792 EncryptionType encryption_type, | 1792 EncryptionType encryption_type, |
| 1793 std::string* authentication, | 1793 std::string* authentication, |
| 1794 std::string* encryption, | 1794 std::string* encryption, |
| 1795 std::string* key_type) const { | 1795 std::string* key_type) const { |
| 1796 if (security == onc::wifi::kSecurityNone) { | 1796 if (security == onc::wifi::kSecurityNone) { |
| 1797 *authentication = kAuthenticationOpen; | 1797 *authentication = kAuthenticationOpen; |
| 1798 *encryption = kEncryptionNone; | 1798 *encryption = kEncryptionNone; |
| 1799 } else if (security == onc::wifi::kWEP_PSK) { | 1799 } else if (security == onc::wifi::kWEP_PSK) { |
| 1800 *authentication = kAuthenticationOpen; | 1800 *authentication = kAuthenticationWepPsk; |
| 1801 *encryption = kEncryptionWEP; | 1801 *encryption = kEncryptionWEP; |
| 1802 *key_type = kKeyTypeNetwork; | 1802 *key_type = kKeyTypeNetwork; |
| 1803 } else if (security == onc::wifi::kWPA_PSK) { | 1803 } else if (security == onc::wifi::kWPA_PSK) { |
| 1804 *authentication = kAuthenticationWpaPsk; | 1804 *authentication = kAuthenticationWpaPsk; |
| 1805 *encryption = WpaEncryptionFromEncryptionType(encryption_type); | 1805 *encryption = WpaEncryptionFromEncryptionType(encryption_type); |
| 1806 *key_type = kKeyTypePassphrase; | 1806 *key_type = kKeyTypePassphrase; |
| 1807 } else if (security == onc::wifi::kWPA2_PSK) { | 1807 } else if (security == onc::wifi::kWPA2_PSK) { |
| 1808 *authentication = kAuthenticationWpa2Psk; | 1808 *authentication = kAuthenticationWpa2Psk; |
| 1809 *encryption = WpaEncryptionFromEncryptionType(encryption_type); | 1809 *encryption = WpaEncryptionFromEncryptionType(encryption_type); |
| 1810 *key_type = kKeyTypePassphrase; | 1810 *key_type = kKeyTypePassphrase; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 DVLOG(1) << "NotifyNetworkChanged: " << network_guid; | 1888 DVLOG(1) << "NotifyNetworkChanged: " << network_guid; |
| 1889 NetworkGuidList changed_networks(1, network_guid); | 1889 NetworkGuidList changed_networks(1, network_guid); |
| 1890 event_task_runner_->PostTask( | 1890 event_task_runner_->PostTask( |
| 1891 FROM_HERE, base::Bind(networks_changed_observer_, changed_networks)); | 1891 FROM_HERE, base::Bind(networks_changed_observer_, changed_networks)); |
| 1892 } | 1892 } |
| 1893 } | 1893 } |
| 1894 | 1894 |
| 1895 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } | 1895 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } |
| 1896 | 1896 |
| 1897 } // namespace wifi | 1897 } // namespace wifi |
| OLD | NEW |