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 // Implements a WLAN API binding for CoreWLAN, as available on OSX 10.6 | 5 // Implements a WLAN API binding for CoreWLAN, as available on OSX 10.6 |
6 | 6 |
7 #include "content/browser/geolocation/wifi_data_provider_mac.h" | 7 #include "content/browser/geolocation/wifi_data_provider_mac.h" |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #import <Foundation/Foundation.h> | 10 #import <Foundation/Foundation.h> |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 access_point_data.ssid = base::SysNSStringToUTF16([network ssid]); | 161 access_point_data.ssid = base::SysNSStringToUTF16([network ssid]); |
162 data->insert(access_point_data); | 162 data->insert(access_point_data); |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 UMA_HISTOGRAM_CUSTOM_COUNTS( | 166 UMA_HISTOGRAM_CUSTOM_COUNTS( |
167 "Net.Wifi.InterfaceCount", | 167 "Net.Wifi.InterfaceCount", |
168 [supported_interfaces count] - interface_error_count, | 168 [supported_interfaces count] - interface_error_count, |
169 1, | 169 1, |
170 5, | 170 5, |
171 5); | 171 6); |
172 | 172 |
173 // Return true even if some interfaces failed to scan, so long as at least | 173 // Return true even if some interfaces failed to scan, so long as at least |
174 // one interface did not fail. | 174 // one interface did not fail. |
175 return interface_error_count == 0 || | 175 return interface_error_count == 0 || |
176 [supported_interfaces count] > interface_error_count; | 176 [supported_interfaces count] > interface_error_count; |
177 } | 177 } |
178 | 178 |
179 WifiDataProviderCommon::WlanApiInterface* NewCoreWlanApi() { | 179 WifiDataProviderCommon::WlanApiInterface* NewCoreWlanApi() { |
180 scoped_ptr<CoreWlanApi> self(new CoreWlanApi); | 180 scoped_ptr<CoreWlanApi> self(new CoreWlanApi); |
181 if (self->Init()) | 181 if (self->Init()) |
182 return self.release(); | 182 return self.release(); |
183 | 183 |
184 return NULL; | 184 return NULL; |
185 } | 185 } |
186 | 186 |
187 } // namespace content | 187 } // namespace content |
OLD | NEW |