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

Side by Side Diff: content/browser/geolocation/wifi_data_provider_chromeos.h

Issue 6696022: Refactor WifiDataProviderChromeOs to implement WifiDataProviderImplBase directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use the geolocation thread Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ 5 #ifndef CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_
6 #define CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ 6 #define CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "content/browser/geolocation/wifi_data_provider_common.h" 9 #include "content/browser/geolocation/wifi_data_provider_common.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 class NetworkLibrary; 12 class NetworkLibrary;
13 } 13 }
14 14
15 class WifiDataProviderChromeOs : public WifiDataProviderCommon { 15 class WifiDataProviderChromeOs : public WifiDataProviderImplBase {
16 public: 16 public:
17 WifiDataProviderChromeOs(); 17 WifiDataProviderChromeOs();
18 18
19 // WifiDataProviderImplBase implementation
bulach 2011/03/16 18:01:00 nit: maybe remove "implementation"
20 virtual bool StartDataProvider();
21 virtual void StopDataProvider();
22 virtual bool GetData(WifiData *data);
23
19 // Allows injection of |lib| for testing. 24 // Allows injection of |lib| for testing.
20 static WlanApiInterface* NewWlanApi(chromeos::NetworkLibrary* lib); 25 static WifiDataProviderCommon::WlanApiInterface* NewWlanApi(
26 chromeos::NetworkLibrary* lib);
21 27
22 private: 28 private:
23 virtual ~WifiDataProviderChromeOs(); 29 virtual ~WifiDataProviderChromeOs();
24 30
31 // The polling task
32 void DoWifiScanTask();
33 void DidWifiScanTask(WifiData* new_data);
34
25 // WifiDataProviderCommon 35 // WifiDataProviderCommon
26 virtual WlanApiInterface* NewWlanApi(); 36 virtual WifiDataProviderCommon::WlanApiInterface* NewWlanApi();
27 virtual PollingPolicyInterface* NewPollingPolicy(); 37 virtual PollingPolicyInterface* NewPollingPolicy();
28 38
39 // Will schedule a scan; i.e. enqueue DoWifiScanTask deferred task.
40 void ScheduleNextScan(int interval);
41
42 // Underlying OS wifi API.
43 scoped_ptr<WifiDataProviderCommon::WlanApiInterface> wlan_api_;
44
45 // Controls the polling update interval.
46 scoped_ptr<PollingPolicyInterface> polling_policy_;
47
48 WifiData wifi_data_;
49
50 // Whether we have strated the data provider.
51 bool started_;
52
53 // Whether we've successfully completed a scan for WiFi data.
54 bool is_first_scan_complete_;
55
29 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderChromeOs); 56 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderChromeOs);
30 }; 57 };
31 58
32 #endif // CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ 59 #endif // CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698