Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/system_settings_provider.h" | 5 #include "chrome/browser/chromeos/dom_ui/system_settings_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 // to ICU 4.6. | 266 // to ICU 4.6. |
| 267 // In the meantime, we use "LONG" name with "Exemplar City" to distinguish | 267 // In the meantime, we use "LONG" name with "Exemplar City" to distinguish |
| 268 // multiple timezones with the same "LONG" name but with different | 268 // multiple timezones with the same "LONG" name but with different |
| 269 // rules (e.g. US Mountain Time in Dever vs Phoneix). | 269 // rules (e.g. US Mountain Time in Dever vs Phoneix). |
| 270 icu::UnicodeString name; | 270 icu::UnicodeString name; |
| 271 timezone.getDisplayName(dst_offset != 0, icu::TimeZone::LONG, name); | 271 timezone.getDisplayName(dst_offset != 0, icu::TimeZone::LONG, name); |
| 272 string16 result(l10n_util::GetStringFUTF16( | 272 string16 result(l10n_util::GetStringFUTF16( |
| 273 IDS_OPTIONS_SETTINGS_TIMEZONE_DISPLAY_TEMPLATE, ASCIIToUTF16(offset_str), | 273 IDS_OPTIONS_SETTINGS_TIMEZONE_DISPLAY_TEMPLATE, ASCIIToUTF16(offset_str), |
| 274 string16(name.getBuffer(), name.length()), GetExemplarCity(timezone))); | 274 string16(name.getBuffer(), name.length()), GetExemplarCity(timezone))); |
| 275 string16 rtl_safe_result = result; | 275 string16 rtl_safe_result = result; |
| 276 base::i18n::AdjustStringForLocaleDirection(result, &rtl_safe_result); | 276 base::i18n::AdjustStringForLocaleDirection(&rtl_safe_result); |
| 277 return rtl_safe_result; | 277 return rtl_safe_result; |
|
Avi (use Gerrit)
2010/11/23 16:07:08
So the original code was wrong :). Drop the use of
| |
| 278 } | 278 } |
| 279 | 279 |
| 280 string16 SystemSettingsProvider::GetTimezoneID( | 280 string16 SystemSettingsProvider::GetTimezoneID( |
| 281 const icu::TimeZone& timezone) { | 281 const icu::TimeZone& timezone) { |
| 282 icu::UnicodeString id; | 282 icu::UnicodeString id; |
| 283 timezone.getID(id); | 283 timezone.getID(id); |
| 284 return string16(id.getBuffer(), id.length()); | 284 return string16(id.getBuffer(), id.length()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 const icu::TimeZone* SystemSettingsProvider::GetTimezone( | 287 const icu::TimeZone* SystemSettingsProvider::GetTimezone( |
| 288 const string16& timezone_id) { | 288 const string16& timezone_id) { |
| 289 for (std::vector<icu::TimeZone*>::iterator iter = timezones_.begin(); | 289 for (std::vector<icu::TimeZone*>::iterator iter = timezones_.begin(); |
| 290 iter != timezones_.end(); ++iter) { | 290 iter != timezones_.end(); ++iter) { |
| 291 const icu::TimeZone* timezone = *iter; | 291 const icu::TimeZone* timezone = *iter; |
| 292 if (GetTimezoneID(*timezone) == timezone_id) { | 292 if (GetTimezoneID(*timezone) == timezone_id) { |
| 293 return timezone; | 293 return timezone; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 return NULL; | 296 return NULL; |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace chromeos | 299 } // namespace chromeos |
| OLD | NEW |