Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: components/wifi/wifi_service_win.cc

Issue 64683014: Mac OS X-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address codereview comments. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/wifi/wifi_service_mac.mm ('k') | components/wifi/wifi_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 std::string* error) OVERRIDE; 206 std::string* error) OVERRIDE;
207 207
208 virtual void StartDisconnect(const std::string& network_guid, 208 virtual void StartDisconnect(const std::string& network_guid,
209 std::string* error) OVERRIDE; 209 std::string* error) OVERRIDE;
210 210
211 virtual void SetEventObservers( 211 virtual void SetEventObservers(
212 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, 212 scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
213 const NetworkGuidListCallback& networks_changed_observer, 213 const NetworkGuidListCallback& networks_changed_observer,
214 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE; 214 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE;
215 215
216 virtual void RequestConnectedNetworkUpdate() OVERRIDE {}
217
216 private: 218 private:
217 // Static callback for Windows WLAN_NOTIFICATION. Calls OnWlanNotification 219 // Static callback for Windows WLAN_NOTIFICATION. Calls OnWlanNotification
218 // on WiFiServiceImpl passed back as |context|. 220 // on WiFiServiceImpl passed back as |context|.
219 static void __stdcall OnWlanNotificationCallback( 221 static void __stdcall OnWlanNotificationCallback(
220 PWLAN_NOTIFICATION_DATA wlan_notification_data, 222 PWLAN_NOTIFICATION_DATA wlan_notification_data,
221 PVOID context); 223 PVOID context);
222 224
223 // Callback for Windows WLAN_NOTIFICATION. Called on random thread from 225 // Callback for Windows WLAN_NOTIFICATION. Called on random thread from
224 // OnWlanNotificationCallback. Handles network connectivity and scan complete 226 // OnWlanNotificationCallback. Handles network connectivity and scan complete
225 // notification and posts tasks to main thread. 227 // notification and posts tasks to main thread.
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 properties->type = onc::network_type::kWiFi; 1072 properties->type = onc::network_type::kWiFi;
1071 1073
1072 for (size_t bss = 0; bss < wlan_bss_list.dwNumberOfItems; ++bss) { 1074 for (size_t bss = 0; bss < wlan_bss_list.dwNumberOfItems; ++bss) {
1073 const WLAN_BSS_ENTRY& bss_entry(wlan_bss_list.wlanBssEntries[bss]); 1075 const WLAN_BSS_ENTRY& bss_entry(wlan_bss_list.wlanBssEntries[bss]);
1074 if (bss_entry.dot11Ssid.uSSIDLength == wlan.dot11Ssid.uSSIDLength && 1076 if (bss_entry.dot11Ssid.uSSIDLength == wlan.dot11Ssid.uSSIDLength &&
1075 0 == memcmp(bss_entry.dot11Ssid.ucSSID, 1077 0 == memcmp(bss_entry.dot11Ssid.ucSSID,
1076 wlan.dot11Ssid.ucSSID, 1078 wlan.dot11Ssid.ucSSID,
1077 bss_entry.dot11Ssid.uSSIDLength)) { 1079 bss_entry.dot11Ssid.uSSIDLength)) {
1078 properties->frequency = GetNormalizedFrequency( 1080 properties->frequency = GetNormalizedFrequency(
1079 bss_entry.ulChCenterFrequency / 1000); 1081 bss_entry.ulChCenterFrequency / 1000);
1080 properties->frequency_list.push_back(properties->frequency); 1082 properties->frequency_set.insert(properties->frequency);
1081 properties->bssid = NetworkProperties::MacAddressAsString( 1083 properties->bssid = NetworkProperties::MacAddressAsString(
1082 bss_entry.dot11Bssid); 1084 bss_entry.dot11Bssid);
1083 } 1085 }
1084 } 1086 }
1085 properties->frequency_list.sort();
1086 properties->frequency_list.unique();
1087 properties->security = 1087 properties->security =
1088 SecurityFromDot11AuthAlg(wlan.dot11DefaultAuthAlgorithm); 1088 SecurityFromDot11AuthAlg(wlan.dot11DefaultAuthAlgorithm);
1089 properties->signal_strength = wlan.wlanSignalQuality; 1089 properties->signal_strength = wlan.wlanSignalQuality;
1090 } 1090 }
1091 1091
1092 // Get the list of visible wireless networks 1092 // Get the list of visible wireless networks
1093 DWORD WiFiServiceImpl::GetVisibleNetworkList(NetworkList* network_list) { 1093 DWORD WiFiServiceImpl::GetVisibleNetworkList(NetworkList* network_list) {
1094 if (client_ == NULL) { 1094 if (client_ == NULL) {
1095 NOTREACHED(); 1095 NOTREACHED();
1096 return ERROR_NOINTERFACE; 1096 return ERROR_NOINTERFACE;
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 NetworkGuidList changed_networks(1, network_guid); 1581 NetworkGuidList changed_networks(1, network_guid);
1582 message_loop_proxy_->PostTask( 1582 message_loop_proxy_->PostTask(
1583 FROM_HERE, 1583 FROM_HERE,
1584 base::Bind(networks_changed_observer_, changed_networks)); 1584 base::Bind(networks_changed_observer_, changed_networks));
1585 } 1585 }
1586 } 1586 }
1587 1587
1588 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } 1588 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); }
1589 1589
1590 } // namespace wifi 1590 } // namespace wifi
OLDNEW
« no previous file with comments | « components/wifi/wifi_service_mac.mm ('k') | components/wifi/wifi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698