| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 DEVICE_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ | 6 #define DEVICE_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "content/browser/geolocation/wifi_data_provider.h" | 12 #include "device/geolocation/wifi_data_provider.h" |
| 13 #include "content/browser/geolocation/wifi_polling_policy.h" | 13 #include "device/geolocation/wifi_polling_policy.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace base { |
| 16 class SingleThreadTaskRunner; |
| 17 } |
| 16 | 18 |
| 17 class CONTENT_EXPORT WifiDataProviderChromeOs : public WifiDataProvider { | 19 namespace device { |
| 20 |
| 21 class DEVICE_GEOLOCATION_EXPORT WifiDataProviderChromeOs |
| 22 : public WifiDataProvider { |
| 18 public: | 23 public: |
| 19 WifiDataProviderChromeOs(); | 24 WifiDataProviderChromeOs(); |
| 20 | 25 |
| 21 // WifiDataProvider | 26 // WifiDataProvider |
| 22 void StartDataProvider() override; | 27 void StartDataProvider() override; |
| 23 void StopDataProvider() override; | 28 void StopDataProvider() override; |
| 24 bool GetData(WifiData* data) override; | 29 bool GetData(WifiData* data) override; |
| 25 | 30 |
| 26 private: | 31 private: |
| 27 friend class GeolocationChromeOsWifiDataProviderTest; | 32 friend class GeolocationChromeOsWifiDataProviderTest; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 | 57 |
| 53 // The latest wifi data. (client thread) | 58 // The latest wifi data. (client thread) |
| 54 WifiData wifi_data_; | 59 WifiData wifi_data_; |
| 55 | 60 |
| 56 // Whether we have strated the data provider. (client thread) | 61 // Whether we have strated the data provider. (client thread) |
| 57 bool started_; | 62 bool started_; |
| 58 | 63 |
| 59 // Whether we've successfully completed a scan for WiFi data. (client thread) | 64 // Whether we've successfully completed a scan for WiFi data. (client thread) |
| 60 bool is_first_scan_complete_; | 65 bool is_first_scan_complete_; |
| 61 | 66 |
| 67 // Used to PostTask()s from the geolocation thread to creation thread. |
| 68 const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 69 |
| 62 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderChromeOs); | 70 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderChromeOs); |
| 63 }; | 71 }; |
| 64 | 72 |
| 65 } // namespace content | 73 } // namespace device |
| 66 | 74 |
| 67 #endif // CONTENT_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ | 75 #endif // DEVICE_GEOLOCATION_WIFI_DATA_PROVIDER_CHROMEOS_H_ |
| OLD | NEW |