Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: content/browser/geolocation/wifi_data_provider_cast.cc

Issue 223583003: Exclude wifi_data_provider_linux.cc for chromecast build as chromecast uses wpa_supplicant instead … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add chromecast-specific content port implementation. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698