| 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 "chrome/browser/chromeos/system/timezone_util.h" | 5 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 GetExemplarCity(timezone))); | 140 GetExemplarCity(timezone))); |
| 141 base::i18n::AdjustStringForLocaleDirection(&result); | 141 base::i18n::AdjustStringForLocaleDirection(&result); |
| 142 return result; | 142 return result; |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace | 145 } // namespace |
| 146 | 146 |
| 147 namespace chromeos { | 147 namespace chromeos { |
| 148 namespace system { | 148 namespace system { |
| 149 | 149 |
| 150 base::string16 GetCurrentTimezoneName() { |
| 151 return GetTimezoneName( |
| 152 chromeos::system::TimezoneSettings::GetInstance()->GetTimezone()); |
| 153 } |
| 154 |
| 150 // Creates a list of pairs of each timezone's ID and name. | 155 // Creates a list of pairs of each timezone's ID and name. |
| 151 std::unique_ptr<base::ListValue> GetTimezoneList() { | 156 std::unique_ptr<base::ListValue> GetTimezoneList() { |
| 152 const auto& timezones = | 157 const auto& timezones = |
| 153 chromeos::system::TimezoneSettings::GetInstance()->GetTimezoneList(); | 158 chromeos::system::TimezoneSettings::GetInstance()->GetTimezoneList(); |
| 154 std::unique_ptr<base::ListValue> timezoneList(new base::ListValue()); | 159 std::unique_ptr<base::ListValue> timezoneList(new base::ListValue()); |
| 155 for (const auto& timezone : timezones) { | 160 for (const auto& timezone : timezones) { |
| 156 auto option = base::MakeUnique<base::ListValue>(); | 161 auto option = base::MakeUnique<base::ListValue>(); |
| 157 option->AppendString( | 162 option->AppendString( |
| 158 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone)); | 163 chromeos::system::TimezoneSettings::GetTimezoneID(*timezone)); |
| 159 option->AppendString(GetTimezoneName(*timezone)); | 164 option->AppendString(GetTimezoneName(*timezone)); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 190 VLOG(1) << "Refresh TimeZone: setting timezone to '" << timezone->timeZoneId | 195 VLOG(1) << "Refresh TimeZone: setting timezone to '" << timezone->timeZoneId |
| 191 << "'"; | 196 << "'"; |
| 192 | 197 |
| 193 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 198 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 194 base::UTF8ToUTF16(timezone->timeZoneId)); | 199 base::UTF8ToUTF16(timezone->timeZoneId)); |
| 195 } | 200 } |
| 196 } | 201 } |
| 197 | 202 |
| 198 } // namespace system | 203 } // namespace system |
| 199 } // namespace chromeos | 204 } // namespace chromeos |
| OLD | NEW |