OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/geolocation/wifi_data_provider_mac.h" |
| 6 |
| 7 #include "content/browser/geolocation/wifi_data_provider_common.h" |
| 8 #include "content/browser/geolocation/wifi_data_provider_manager.h" |
| 9 |
| 10 namespace content { |
| 11 namespace { |
| 12 // The time periods, in milliseconds, between successive polls of the wifi data. |
| 13 const int kDefaultPollingInterval = 120000; // 2 mins |
| 14 const int kNoChangePollingInterval = 300000; // 5 mins |
| 15 const int kTwoNoChangePollingInterval = 600000; // 10 mins |
| 16 const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s |
| 17 } // namespace |
| 18 |
| 19 // static |
| 20 WifiDataProvider* WifiDataProviderManager::DefaultFactoryFunction() { |
| 21 return new WifiDataProviderMac(); |
| 22 } |
| 23 |
| 24 WifiDataProviderMac::WifiDataProviderMac() { |
| 25 } |
| 26 |
| 27 WifiDataProviderMac::~WifiDataProviderMac() { |
| 28 } |
| 29 |
| 30 WifiDataProviderMac::WlanApiInterface* WifiDataProviderMac::NewWlanApi() { |
| 31 WifiDataProviderMac::WlanApiInterface* core_wlan_api = NewCoreWlanApi(); |
| 32 if (core_wlan_api) |
| 33 return core_wlan_api; |
| 34 |
| 35 DVLOG(1) << "WifiDataProviderMac : failed to initialize any wlan api"; |
| 36 return NULL; |
| 37 } |
| 38 |
| 39 WifiPollingPolicy* WifiDataProviderMac::NewPollingPolicy() { |
| 40 return new GenericWifiPollingPolicy<kDefaultPollingInterval, |
| 41 kNoChangePollingInterval, |
| 42 kTwoNoChangePollingInterval, |
| 43 kNoWifiPollingIntervalMilliseconds>; |
| 44 } |
| 45 |
| 46 } // namespace content |
OLD | NEW |