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 #include "chromeos/settings/timezone_settings.h" | 5 #include "chromeos/settings/timezone_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
21 #include "base/task_runner.h" | 21 #include "base/task_runner.h" |
22 #include "base/threading/worker_pool.h" | 22 #include "base/threading/worker_pool.h" |
23 #include "chromeos/settings/timezone_settings_helper.h" | 23 #include "chromeos/settings/timezone_settings_helper.h" |
24 | 24 |
| 25 namespace chromeos { |
| 26 namespace system { |
| 27 const char kUTCTimezoneName[] = "Etc/GMT"; |
| 28 } |
| 29 } |
| 30 |
25 namespace { | 31 namespace { |
26 | 32 |
27 // The filepath to the timezone file that symlinks to the actual timezone file. | 33 // The filepath to the timezone file that symlinks to the actual timezone file. |
28 const char kTimezoneSymlink[] = "/var/lib/timezone/localtime"; | 34 const char kTimezoneSymlink[] = "/var/lib/timezone/localtime"; |
29 const char kTimezoneSymlink2[] = "/var/lib/timezone/localtime2"; | 35 const char kTimezoneSymlink2[] = "/var/lib/timezone/localtime2"; |
30 | 36 |
31 // The directory that contains all the timezone files. So for timezone | 37 // The directory that contains all the timezone files. So for timezone |
32 // "US/Pacific", the actual timezone file is: "/usr/share/zoneinfo/US/Pacific" | 38 // "US/Pacific", the actual timezone file is: "/usr/share/zoneinfo/US/Pacific" |
33 const char kTimezoneFilesDir[] = "/usr/share/zoneinfo/"; | 39 const char kTimezoneFilesDir[] = "/usr/share/zoneinfo/"; |
34 | 40 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 "America/Santiago", | 76 "America/Santiago", |
71 "America/St_Johns", | 77 "America/St_Johns", |
72 "America/Araguaina", | 78 "America/Araguaina", |
73 "America/Argentina/Buenos_Aires", | 79 "America/Argentina/Buenos_Aires", |
74 "America/Argentina/San_Luis", | 80 "America/Argentina/San_Luis", |
75 "America/Sao_Paulo", | 81 "America/Sao_Paulo", |
76 "America/Montevideo", | 82 "America/Montevideo", |
77 "America/Godthab", | 83 "America/Godthab", |
78 "Atlantic/South_Georgia", | 84 "Atlantic/South_Georgia", |
79 "Atlantic/Cape_Verde", | 85 "Atlantic/Cape_Verde", |
| 86 chromeos::system::kUTCTimezoneName, |
80 "Atlantic/Azores", | 87 "Atlantic/Azores", |
81 "Atlantic/Reykjavik", | 88 "Atlantic/Reykjavik", |
82 "Atlantic/St_Helena", | 89 "Atlantic/St_Helena", |
83 "Africa/Casablanca", | 90 "Africa/Casablanca", |
84 "Atlantic/Faroe", | 91 "Atlantic/Faroe", |
85 "Europe/Dublin", | 92 "Europe/Dublin", |
86 "Europe/Lisbon", | 93 "Europe/Lisbon", |
87 "Europe/London", | 94 "Europe/London", |
88 "Europe/Amsterdam", | 95 "Europe/Amsterdam", |
89 "Europe/Belgrade", | 96 "Europe/Belgrade", |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 471 |
465 // static | 472 // static |
466 base::string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { | 473 base::string16 TimezoneSettings::GetTimezoneID(const icu::TimeZone& timezone) { |
467 icu::UnicodeString id; | 474 icu::UnicodeString id; |
468 timezone.getID(id); | 475 timezone.getID(id); |
469 return base::string16(id.getBuffer(), id.length()); | 476 return base::string16(id.getBuffer(), id.length()); |
470 } | 477 } |
471 | 478 |
472 } // namespace system | 479 } // namespace system |
473 } // namespace chromeos | 480 } // namespace chromeos |
OLD | NEW |