| 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 // Windows Vista uses the Native Wifi (WLAN) API for accessing WiFi cards. See | 5 // Windows Vista uses the Native Wifi (WLAN) API for accessing WiFi cards. See |
| 6 // http://msdn.microsoft.com/en-us/library/ms705945(VS.85).aspx. Windows XP | 6 // http://msdn.microsoft.com/en-us/library/ms705945(VS.85).aspx. Windows XP |
| 7 // Service Pack 3 (and Windows XP Service Pack 2, if upgraded with a hot fix) | 7 // Service Pack 3 (and Windows XP Service Pack 2, if upgraded with a hot fix) |
| 8 // also support a limited version of the WLAN API. See | 8 // also support a limited version of the WLAN API. See |
| 9 // http://msdn.microsoft.com/en-us/library/bb204766.aspx. The WLAN API uses | 9 // http://msdn.microsoft.com/en-us/library/bb204766.aspx. The WLAN API uses |
| 10 // wlanapi.h, which is not part of the SDK used by Gears, so is replicated | 10 // wlanapi.h, which is not part of the SDK used by Gears, so is replicated |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 DWORD buffer_size, | 153 DWORD buffer_size, |
| 154 DWORD* bytes_out); | 154 DWORD* bytes_out); |
| 155 bool ResizeBuffer(int requested_size, | 155 bool ResizeBuffer(int requested_size, |
| 156 scoped_ptr<BYTE, base::FreeDeleter>* buffer); | 156 scoped_ptr<BYTE, base::FreeDeleter>* buffer); |
| 157 // Gets the system directory and appends a trailing slash if not already | 157 // Gets the system directory and appends a trailing slash if not already |
| 158 // present. | 158 // present. |
| 159 bool GetSystemDirectory(base::string16* path); | 159 bool GetSystemDirectory(base::string16* path); |
| 160 } // namespace | 160 } // namespace |
| 161 | 161 |
| 162 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { | 162 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { |
| 163 return new Win32WifiDataProvider(); | 163 return new WifiDataProviderWin32(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 Win32WifiDataProvider::Win32WifiDataProvider() { | 166 WifiDataProviderWin32::WifiDataProviderWin32() { |
| 167 } | 167 } |
| 168 | 168 |
| 169 Win32WifiDataProvider::~Win32WifiDataProvider() { | 169 WifiDataProviderWin32::~WifiDataProviderWin32() { |
| 170 } | 170 } |
| 171 | 171 |
| 172 WifiDataProviderCommon::WlanApiInterface* Win32WifiDataProvider::NewWlanApi() { | 172 WifiDataProviderCommon::WlanApiInterface* WifiDataProviderWin32::NewWlanApi() { |
| 173 // Use the WLAN interface if we're on Vista and if it's available. Otherwise, | 173 // Use the WLAN interface if we're on Vista and if it's available. Otherwise, |
| 174 // use NDIS. | 174 // use NDIS. |
| 175 WlanApiInterface* api = WindowsWlanApi::Create(); | 175 WlanApiInterface* api = WindowsWlanApi::Create(); |
| 176 if (api) { | 176 if (api) { |
| 177 return api; | 177 return api; |
| 178 } | 178 } |
| 179 return WindowsNdisApi::Create(); | 179 return WindowsNdisApi::Create(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 WifiPollingPolicy* Win32WifiDataProvider::NewPollingPolicy() { | 182 WifiPollingPolicy* WifiDataProviderWin32::NewPollingPolicy() { |
| 183 return new GenericWifiPollingPolicy<kDefaultPollingInterval, | 183 return new GenericWifiPollingPolicy<kDefaultPollingInterval, |
| 184 kNoChangePollingInterval, | 184 kNoChangePollingInterval, |
| 185 kTwoNoChangePollingInterval, | 185 kTwoNoChangePollingInterval, |
| 186 kNoWifiPollingIntervalMilliseconds>; | 186 kNoWifiPollingIntervalMilliseconds>; |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Local classes and functions | 189 // Local classes and functions |
| 190 namespace { | 190 namespace { |
| 191 | 191 |
| 192 // WindowsWlanApi | 192 // WindowsWlanApi |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 632 |
| 633 if (*path->rbegin() != L'\\') { | 633 if (*path->rbegin() != L'\\') { |
| 634 path->append(L"\\"); | 634 path->append(L"\\"); |
| 635 } | 635 } |
| 636 DCHECK_EQ(L'\\', *path->rbegin()); | 636 DCHECK_EQ(L'\\', *path->rbegin()); |
| 637 return true; | 637 return true; |
| 638 } | 638 } |
| 639 } // namespace | 639 } // namespace |
| 640 | 640 |
| 641 } // namespace content | 641 } // namespace content |
| OLD | NEW |