OLD | NEW |
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 CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
6 #define CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/task.h" | 12 #include "base/task.h" |
13 #include "base/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "chrome/browser/geolocation/device_data_provider.h" | 14 #include "chrome/browser/geolocation/device_data_provider.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 const int kDefaultInterval = 20 * 60 * 1000; // 20 mins | 17 const int kDefaultInterval = 20 * 60 * 1000; // 20 mins |
18 const int kNoRouterInterval = 30 * 1000; // 30s | 18 const int kNoRouterInterval = 30 * 1000; // 30s |
19 } | 19 } |
20 | 20 |
21 // Allows sharing and mocking of the update polling policy function. | 21 // Allows sharing and mocking of the update polling policy function. |
22 class GatewayPollingPolicyInterface { | 22 class GatewayPollingPolicyInterface { |
23 public: | 23 public: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 GatewayData gateway_data_; | 92 GatewayData gateway_data_; |
93 // Controls the polling update interval. | 93 // Controls the polling update interval. |
94 scoped_ptr<GatewayPollingPolicyInterface> polling_policy_; | 94 scoped_ptr<GatewayPollingPolicyInterface> polling_policy_; |
95 // Holder for the tasks which run on the thread; takes care of cleanup. | 95 // Holder for the tasks which run on the thread; takes care of cleanup. |
96 ScopedRunnableMethodFactory<GatewayDataProviderCommon> task_factory_; | 96 ScopedRunnableMethodFactory<GatewayDataProviderCommon> task_factory_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(GatewayDataProviderCommon); | 98 DISALLOW_COPY_AND_ASSIGN(GatewayDataProviderCommon); |
99 }; | 99 }; |
100 | 100 |
101 #endif // CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ | 101 #endif // CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
OLD | NEW |