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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | |
13 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
14 #include "base/logging.h" | 13 #include "base/logging.h" |
15 #include "base/power_monitor/power_monitor.h" | 14 #include "base/power_monitor/power_monitor.h" |
16 #include "base/power_monitor/power_observer.h" | 15 #include "base/power_monitor/power_observer.h" |
17 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
18 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
19 #include "base/rand_util.h" | 18 #include "base/rand_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
21 #include "base/time/time.h" | 20 #include "base/time/time.h" |
22 #include "chromeos/geolocation/geoposition.h" | 21 #include "chromeos/geolocation/geoposition.h" |
23 #include "chromeos/geolocation/simple_geolocation_provider.h" | 22 #include "chromeos/geolocation/simple_geolocation_provider.h" |
24 #include "chromeos/timezone/timezone_provider.h" | 23 #include "chromeos/timezone/timezone_provider.h" |
25 #include "net/url_request/url_request_context_getter.h" | |
26 #include "url/gurl.h" | |
27 | 24 |
28 namespace chromeos { | 25 namespace chromeos { |
29 | 26 |
30 namespace { | 27 namespace { |
31 | 28 |
32 class TZRequest; | 29 class TZRequest; |
33 | 30 |
34 // Total timezone resolving process timeout. | 31 // Total timezone resolving process timeout. |
35 const unsigned int kRefreshTimeZoneTimeoutSeconds = 60; | 32 const unsigned int kRefreshTimeZoneTimeoutSeconds = 60; |
36 | 33 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 int TimeZoneResolver::IntervalForNextRequestForTesting(const int requests) { | 412 int TimeZoneResolver::IntervalForNextRequestForTesting(const int requests) { |
416 return IntervalForNextRequest(requests); | 413 return IntervalForNextRequest(requests); |
417 } | 414 } |
418 | 415 |
419 // static | 416 // static |
420 void TimeZoneResolver::RegisterPrefs(PrefRegistrySimple* registry) { | 417 void TimeZoneResolver::RegisterPrefs(PrefRegistrySimple* registry) { |
421 registry->RegisterInt64Pref(kLastTimeZoneRefreshTime, 0); | 418 registry->RegisterInt64Pref(kLastTimeZoneRefreshTime, 0); |
422 } | 419 } |
423 | 420 |
424 } // namespace chromeos | 421 } // namespace chromeos |
OLD | NEW |