OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Provides wifi scan API binding for chromeos, using proprietary APIs. | 5 // Provides wifi scan API binding for chromeos, using proprietary APIs. |
6 | 6 |
7 #include "content/browser/geolocation/wifi_data_provider_chromeos.h" | 7 #include "content/browser/geolocation/wifi_data_provider_chromeos.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s | 22 const int kNoWifiPollingIntervalMilliseconds = 20 * 1000; // 20s |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 WifiDataProviderChromeOs::WifiDataProviderChromeOs() : started_(false) { | 26 WifiDataProviderChromeOs::WifiDataProviderChromeOs() : started_(false) { |
27 } | 27 } |
28 | 28 |
29 WifiDataProviderChromeOs::~WifiDataProviderChromeOs() { | 29 WifiDataProviderChromeOs::~WifiDataProviderChromeOs() { |
30 } | 30 } |
31 | 31 |
32 bool WifiDataProviderChromeOs::StartDataProvider() { | 32 void WifiDataProviderChromeOs::StartDataProvider() { |
33 DCHECK(CalledOnClientThread()); | 33 DCHECK(CalledOnClientThread()); |
34 | 34 |
35 DCHECK(polling_policy_ == NULL); | 35 DCHECK(polling_policy_ == NULL); |
36 polling_policy_.reset( | 36 polling_policy_.reset( |
37 new GenericPollingPolicy<kDefaultPollingIntervalMilliseconds, | 37 new GenericPollingPolicy<kDefaultPollingIntervalMilliseconds, |
38 kNoChangePollingIntervalMilliseconds, | 38 kNoChangePollingIntervalMilliseconds, |
39 kTwoNoChangePollingIntervalMilliseconds, | 39 kTwoNoChangePollingIntervalMilliseconds, |
40 kNoWifiPollingIntervalMilliseconds>); | 40 kNoWifiPollingIntervalMilliseconds>); |
41 | 41 |
42 ScheduleStart(); | 42 ScheduleStart(); |
43 return true; | |
44 } | 43 } |
45 | 44 |
46 void WifiDataProviderChromeOs::StopDataProvider() { | 45 void WifiDataProviderChromeOs::StopDataProvider() { |
47 DCHECK(CalledOnClientThread()); | 46 DCHECK(CalledOnClientThread()); |
48 | 47 |
49 polling_policy_.reset(); | 48 polling_policy_.reset(); |
50 ScheduleStop(); | 49 ScheduleStop(); |
51 } | 50 } |
52 | 51 |
53 bool WifiDataProviderChromeOs::GetData(WifiData* data) { | 52 bool WifiDataProviderChromeOs::GetData(WifiData* data) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return true; | 166 return true; |
168 } | 167 } |
169 | 168 |
170 // static | 169 // static |
171 template<> | 170 template<> |
172 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { | 171 WifiDataProviderImplBase* WifiDataProvider::DefaultFactoryFunction() { |
173 return new WifiDataProviderChromeOs(); | 172 return new WifiDataProviderChromeOs(); |
174 } | 173 } |
175 | 174 |
176 } // namespace content | 175 } // namespace content |
OLD | NEW |