OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // For OSX 10.5 we use the system API function WirelessScanSplit. This function | 5 // For OSX 10.5 we use the system API function WirelessScanSplit. This function |
6 // is not documented or included in the SDK, so we use a reverse-engineered | 6 // is not documented or included in the SDK, so we use a reverse-engineered |
7 // header, osx_wifi_.h. This file is taken from the iStumbler project | 7 // header, osx_wifi_.h. This file is taken from the iStumbler project |
8 // (http://www.istumbler.net). | 8 // (http://www.istumbler.net). |
9 | 9 |
10 #include "content/browser/geolocation/wifi_data_provider_mac.h" | 10 #include "content/browser/geolocation/wifi_data_provider_mac.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 CFRelease(managed_access_points); | 153 CFRelease(managed_access_points); |
154 if (adhoc_access_points) | 154 if (adhoc_access_points) |
155 CFRelease(adhoc_access_points); | 155 CFRelease(adhoc_access_points); |
156 | 156 |
157 return true; | 157 return true; |
158 } | 158 } |
159 } // namespace | 159 } // namespace |
160 | 160 |
161 // static | 161 // static |
162 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { | 162 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { |
163 return new MacWifiDataProvider(); | 163 return new WifiDataProviderMac(); |
164 } | 164 } |
165 | 165 |
166 MacWifiDataProvider::MacWifiDataProvider() { | 166 WifiDataProviderMac::WifiDataProviderMac() { |
167 } | 167 } |
168 | 168 |
169 MacWifiDataProvider::~MacWifiDataProvider() { | 169 WifiDataProviderMac::~WifiDataProviderMac() { |
170 } | 170 } |
171 | 171 |
172 MacWifiDataProvider::WlanApiInterface* MacWifiDataProvider::NewWlanApi() { | 172 WifiDataProviderMac::WlanApiInterface* WifiDataProviderMac::NewWlanApi() { |
173 // Try and find a API binding that works: first try the officially supported | 173 // Try and find a API binding that works: first try the officially supported |
174 // CoreWLAN API, and if this fails (e.g. on OSX 10.5) fall back to the reverse | 174 // CoreWLAN API, and if this fails (e.g. on OSX 10.5) fall back to the reverse |
175 // engineered Apple80211 API. | 175 // engineered Apple80211 API. |
176 MacWifiDataProvider::WlanApiInterface* core_wlan_api = NewCoreWlanApi(); | 176 WifiDataProviderMac::WlanApiInterface* core_wlan_api = NewCoreWlanApi(); |
177 if (core_wlan_api) | 177 if (core_wlan_api) |
178 return core_wlan_api; | 178 return core_wlan_api; |
179 | 179 |
180 scoped_ptr<Apple80211Api> wlan_api(new Apple80211Api); | 180 scoped_ptr<Apple80211Api> wlan_api(new Apple80211Api); |
181 if (wlan_api->Init()) | 181 if (wlan_api->Init()) |
182 return wlan_api.release(); | 182 return wlan_api.release(); |
183 | 183 |
184 DVLOG(1) << "MacWifiDataProvider : failed to initialize any wlan api"; | 184 DVLOG(1) << "WifiDataProviderMac : failed to initialize any wlan api"; |
185 return NULL; | 185 return NULL; |
186 } | 186 } |
187 | 187 |
188 WifiPollingPolicy* MacWifiDataProvider::NewPollingPolicy() { | 188 WifiPollingPolicy* WifiDataProviderMac::NewPollingPolicy() { |
189 return new GenericWifiPollingPolicy<kDefaultPollingInterval, | 189 return new GenericWifiPollingPolicy<kDefaultPollingInterval, |
190 kNoChangePollingInterval, | 190 kNoChangePollingInterval, |
191 kTwoNoChangePollingInterval, | 191 kTwoNoChangePollingInterval, |
192 kNoWifiPollingIntervalMilliseconds>; | 192 kNoWifiPollingIntervalMilliseconds>; |
193 } | 193 } |
194 | 194 |
195 } // namespace content | 195 } // namespace content |
OLD | NEW |