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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/geolocation/wifi_data_provider_chromeos.h
diff --git a/content/browser/geolocation/wifi_data_provider_chromeos.h b/content/browser/geolocation/wifi_data_provider_chromeos.h
index a3fbcf6731ff9b714725066a3f28ff68df6ef98f..e6d1227380fee4c2e307a69993f1a692e174abcd 100644
--- a/content/browser/geolocation/wifi_data_provider_chromeos.h
+++ b/content/browser/geolocation/wifi_data_provider_chromeos.h
@@ -12,20 +12,49 @@ namespace chromeos {
class NetworkLibrary;
}
-class WifiDataProviderChromeOs : public WifiDataProviderCommon {
+class WifiDataProviderChromeOs : public WifiDataProviderImplBase {
public:
WifiDataProviderChromeOs();
+ // WifiDataProviderImplBase implementation
bulach 2011/03/15 18:37:51 nit: maybe remove "implementation"?
+ virtual bool StartDataProvider();
+ virtual void StopDataProvider();
+ virtual bool GetData(WifiData *data);
+
// Allows injection of |lib| for testing.
- static WlanApiInterface* NewWlanApi(chromeos::NetworkLibrary* lib);
+ static WifiDataProviderCommon::WlanApiInterface* NewWlanApi(
+ chromeos::NetworkLibrary* lib);
private:
virtual ~WifiDataProviderChromeOs();
+ // The polling task
+ void DoWifiScanTask();
+
// WifiDataProviderCommon
- virtual WlanApiInterface* NewWlanApi();
+ virtual WifiDataProviderCommon::WlanApiInterface* NewWlanApi();
virtual PollingPolicyInterface* NewPollingPolicy();
+ // Will schedule a scan; i.e. enqueue DoWifiScanTask deferred task.
+ void ScheduleNextScan(int interval);
+
+ // Underlying OS wifi API.
+ scoped_ptr<WifiDataProviderCommon::WlanApiInterface> wlan_api_;
+
+ // Controls the polling update interval.
+ scoped_ptr<PollingPolicyInterface> polling_policy_;
+
+ WifiData wifi_data_;
+
+ // Whether we have strated the data provider.
bulach 2011/03/15 18:37:51 nit:/strated/started/
+ bool started_;
+
+ // Whether we've successfully completed a scan for WiFi data.
+ bool is_first_scan_complete_;
+
+ // Holder for the tasks which run on the thread; takes care of cleanup.
+ ScopedRunnableMethodFactory<WifiDataProviderChromeOs> task_factory_;
+
DISALLOW_COPY_AND_ASSIGN(WifiDataProviderChromeOs);
};

Powered by Google App Engine
This is Rietveld 408576698