OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chromeos/timezone/timezone_resolver.h" | 9 #include "chromeos/timezone/timezone_resolver.h" |
10 #include "components/prefs/pref_change_registrar.h" | 10 #include "components/prefs/pref_change_registrar.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // TimeZoneResolver::Delegate overrides: | 25 // TimeZoneResolver::Delegate overrides: |
26 bool ShouldSendWiFiGeolocationData() override; | 26 bool ShouldSendWiFiGeolocationData() override; |
27 | 27 |
28 // Starts or stops TimezoneResolver according to currect settings. | 28 // Starts or stops TimezoneResolver according to currect settings. |
29 void UpdateTimezoneResolver(); | 29 void UpdateTimezoneResolver(); |
30 | 30 |
31 // Returns true if result of timezone resolve should be applied to | 31 // Returns true if result of timezone resolve should be applied to |
32 // system timezone (preferences might have changed since request was started). | 32 // system timezone (preferences might have changed since request was started). |
33 bool ShouldApplyResolvedTimezone(); | 33 bool ShouldApplyResolvedTimezone(); |
34 | 34 |
35 // Returns the result of the provate call for tests. | |
36 bool TimeZoneResolverShouldBeRunningForTests(); | |
37 | |
38 private: | 35 private: |
39 // Returns true if TimeZoneResolver should be running and taking in account | 36 // Returns true if TimeZoneResolver should be running and taking in account |
40 // all configuration data. | 37 // all configuration data. |
41 bool TimeZoneResolverShouldBeRunning(); | 38 bool TimeZoneResolverShouldBeRunning(); |
42 | 39 |
43 // This is non-null only after user logs in. | 40 // This is non-null only after user logs in. |
44 PrefService* primary_user_prefs_; | 41 PrefService* primary_user_prefs_; |
45 | 42 |
46 // This is used to subscribe to policy preference. | |
47 PrefChangeRegistrar local_state_pref_change_registrar_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(TimeZoneResolverManager); | 43 DISALLOW_COPY_AND_ASSIGN(TimeZoneResolverManager); |
50 }; | 44 }; |
51 | 45 |
52 } // namespace system | 46 } // namespace system |
53 } // namespace chromeos | 47 } // namespace chromeos |
54 | 48 |
55 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ | 49 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_ |
OLD | NEW |