Index: content/browser/geolocation/wifi_data_provider_cast.cc |
diff --git a/content/browser/geolocation/wifi_data_provider_cast.cc b/content/browser/geolocation/wifi_data_provider_cast.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..64d5d9ab2a1373a61f6d2a7013466c8054ac63bb |
--- /dev/null |
+++ b/content/browser/geolocation/wifi_data_provider_cast.cc |
@@ -0,0 +1,69 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/geolocation/wifi_data_provider_cast.h" |
+ |
+namespace content { |
+ |
+namespace { |
+ |
+// The time periods between successive polls of the wifi data. |
+const int kDefaultPollingIntervalMS = 10 * 1000; // 10 secs. |
+const int kNoChangePollingIntervalMS = 2 * 60 * 1000; // 2 mins. |
+const int kTwoNoChangePollingIntervalMS = 60 * 60 * 1000; // 1 hours. |
+const int kNoWifiPollingIntervalMS = 20 * 1000; // 20 secs. |
+ |
+// TODO(lcwu): A place holder for the actual implementation on Chromecast that |
+// uses wpa_supplicant. |
+class WpaSupplicantWlanApi |
+ : public WifiDataProviderCommon::WlanApiInterface { |
+ public: |
+ WpaSupplicantWlanApi(); |
+ virtual ~WpaSupplicantWlanApi(); |
+ |
+ // WifiDataProviderCommon::WlanApiInterface |
+ virtual bool GetAccessPointData( |
+ WifiData::AccessPointDataSet* data) OVERRIDE; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(WpaSupplicantWlanApi); |
+}; |
+ |
+WpaSupplicantWlanApi::WpaSupplicantWlanApi() { |
+} |
+ |
+WpaSupplicantWlanApi::~WpaSupplicantWlanApi() { |
+} |
+ |
+bool WpaSupplicantWlanApi::GetAccessPointData( |
+ WifiData::AccessPointDataSet* data) { |
+ return true; |
+} |
+ |
+} // namespace |
+ |
+// static |
+WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { |
+ return new WifiDataProviderCast(); |
+} |
+ |
+WifiDataProviderCast::WifiDataProviderCast() { |
+} |
+ |
+WifiDataProviderCast::~WifiDataProviderCast() { |
+} |
+ |
+WifiDataProviderCommon::WlanApiInterface* |
+WifiDataProviderCast::NewWlanApi() { |
+ return new WpaSupplicantWlanApi(); |
+} |
+ |
+WifiPollingPolicy* WifiDataProviderCast::NewPollingPolicy() { |
+ return new GenericWifiPollingPolicy<kDefaultPollingIntervalMS, |
+ kNoChangePollingIntervalMS, |
+ kTwoNoChangePollingIntervalMS, |
+ kNoWifiPollingIntervalMS>; |
+} |
+ |
+} // namespace content |