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 CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 | 11 |
12 class Profile; | |
13 | |
12 namespace base { | 14 namespace base { |
13 class ListValue; | 15 class ListValue; |
14 } | 16 } |
15 | 17 |
16 namespace chromeos { | 18 namespace chromeos { |
17 | 19 |
18 struct TimeZoneResponseData; | 20 struct TimeZoneResponseData; |
19 | 21 |
20 namespace system { | 22 namespace system { |
21 | 23 |
22 // Gets the current timezone's display name. | 24 // Gets the current timezone's display name. |
23 base::string16 GetCurrentTimezoneName(); | 25 base::string16 GetCurrentTimezoneName(); |
24 | 26 |
25 // Creates a list of pairs of each timezone's ID and name. | 27 // Creates a list of pairs of each timezone's ID and name. |
26 std::unique_ptr<base::ListValue> GetTimezoneList(); | 28 std::unique_ptr<base::ListValue> GetTimezoneList(); |
27 | 29 |
28 // Returns true if device is managed and has SystemTimezonePolicy set. | 30 // Returns true if device is managed and has SystemTimezonePolicy set. |
29 bool HasSystemTimezonePolicy(); | 31 bool HasSystemTimezonePolicy(); |
30 | 32 |
31 // Apply TimeZone update from TimeZoneProvider. | 33 // Apply TimeZone update from TimeZoneProvider. |
32 void ApplyTimeZone(const TimeZoneResponseData* timezone); | 34 void ApplyTimeZone(const TimeZoneResponseData* timezone); |
33 | 35 |
36 // Returns true if given timezone preference is enterprise-managed. | |
37 // Works for: | |
38 // - prefs::kUserTimezone | |
39 // - prefs::kResolveTimezoneByGeolocation | |
40 bool IsTimezonePrefsManaged(const std::string& pref_name); | |
stevenjb
2017/05/25 22:13:06
s/Prefs/Pref/
Alexander Alekseev
2017/05/29 21:10:23
Done.
| |
41 | |
42 // Updates system timezone from user profile data if needed. | |
43 void UpdateSystemTimezone(Profile* profile); | |
44 | |
45 // Updates Local State preference prefs::kSigninScreenTimezone AND | |
46 // also immediately sets system timezone (chromeos::system::TimezoneSettings). | |
47 void SetSystemAndSigninScreenTimezone(const std::string& timezone); | |
48 | |
49 // Returns true if per-user timezone preferences are enabled. | |
50 bool PerUserTimezoneEnabled(); | |
51 | |
34 } // namespace system | 52 } // namespace system |
35 } // namespace chromeos | 53 } // namespace chromeos |
36 | 54 |
37 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_UTIL_H_ |
OLD | NEW |