OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chromeos/timezone/timezone_resolver.h" | 5 #include "chromeos/timezone/timezone_resolver.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 private: | 119 private: |
120 const TimeZoneResolver* resolver_; | 120 const TimeZoneResolver* resolver_; |
121 | 121 |
122 // Returns delay to next timezone update request | 122 // Returns delay to next timezone update request |
123 base::TimeDelta CalculateNextInterval(); | 123 base::TimeDelta CalculateNextInterval(); |
124 | 124 |
125 SimpleGeolocationProvider geolocation_provider_; | 125 SimpleGeolocationProvider geolocation_provider_; |
126 TimeZoneProvider timezone_provider_; | 126 TimeZoneProvider timezone_provider_; |
127 | 127 |
128 base::OneShotTimer<TimeZoneResolver::TimeZoneResolverImpl> refresh_timer_; | 128 base::OneShotTimer refresh_timer_; |
129 | 129 |
130 // Total number of request attempts. | 130 // Total number of request attempts. |
131 int requests_count_; | 131 int requests_count_; |
132 | 132 |
133 // This is not NULL when update is in progress. | 133 // This is not NULL when update is in progress. |
134 scoped_ptr<TZRequest> request_; | 134 scoped_ptr<TZRequest> request_; |
135 | 135 |
136 base::WeakPtrFactory<TimeZoneResolver::TimeZoneResolverImpl> | 136 base::WeakPtrFactory<TimeZoneResolver::TimeZoneResolverImpl> |
137 weak_ptr_factory_; | 137 weak_ptr_factory_; |
138 | 138 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 int TimeZoneResolver::IntervalForNextRequestForTesting(const int requests) { | 412 int TimeZoneResolver::IntervalForNextRequestForTesting(const int requests) { |
413 return IntervalForNextRequest(requests); | 413 return IntervalForNextRequest(requests); |
414 } | 414 } |
415 | 415 |
416 // static | 416 // static |
417 void TimeZoneResolver::RegisterPrefs(PrefRegistrySimple* registry) { | 417 void TimeZoneResolver::RegisterPrefs(PrefRegistrySimple* registry) { |
418 registry->RegisterInt64Pref(kLastTimeZoneRefreshTime, 0); | 418 registry->RegisterInt64Pref(kLastTimeZoneRefreshTime, 0); |
419 } | 419 } |
420 | 420 |
421 } // namespace chromeos | 421 } // namespace chromeos |
OLD | NEW |