| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_WIFI_POLLING_POLICY_H_ |
| 6 #define DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_WIFI_POLLING_POLICY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace device { | 10 namespace content { |
| 11 | 11 |
| 12 // Allows sharing and mocking of the update polling policy function. | 12 // Allows sharing and mocking of the update polling policy function. |
| 13 class WifiPollingPolicy { | 13 class WifiPollingPolicy { |
| 14 public: | 14 public: |
| 15 WifiPollingPolicy() {} | 15 WifiPollingPolicy() {} |
| 16 virtual ~WifiPollingPolicy() {} | 16 virtual ~WifiPollingPolicy() {} |
| 17 // Calculates the new polling interval for wiFi scans, given the previous | 17 // Calculates the new polling interval for wiFi scans, given the previous |
| 18 // interval and whether the last scan produced new results. | 18 // interval and whether the last scan produced new results. |
| 19 virtual void UpdatePollingInterval(bool scan_results_differ) = 0; | 19 virtual void UpdatePollingInterval(bool scan_results_differ) = 0; |
| 20 virtual int PollingInterval() = 0; | 20 virtual int PollingInterval() = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 45 polling_interval_ = TWO_NO_CHANGE_INTERVAL; | 45 polling_interval_ = TWO_NO_CHANGE_INTERVAL; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 int PollingInterval() override { return polling_interval_; } | 48 int PollingInterval() override { return polling_interval_; } |
| 49 int NoWifiInterval() override { return NO_WIFI_INTERVAL; } | 49 int NoWifiInterval() override { return NO_WIFI_INTERVAL; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 int polling_interval_; | 52 int polling_interval_; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace device | 55 } // namespace content |
| 56 | 56 |
| 57 #endif // DEVICE_GEOLOCATION_WIFI_POLLING_POLICY_H_ | 57 #endif // CONTENT_BROWSER_GEOLOCATION_WIFI_POLLING_POLICY_H_ |
| OLD | NEW |