| 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/options/system_page_view.h" | 5 #include "chrome/browser/chromeos/options/system_page_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "app/combobox_model.h" | 11 #include "app/combobox_model.h" |
| 12 #include "base/stl_util-inl.h" | 12 #include "base/stl_util-inl.h" |
| 13 #include "base/string16.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/chromeos/cros/cros_library.h" | 16 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 16 #include "chrome/browser/chromeos/cros/keyboard_library.h" | 17 #include "chrome/browser/chromeos/cros/keyboard_library.h" |
| 17 #include "chrome/browser/chromeos/cros/system_library.h" | 18 #include "chrome/browser/chromeos/cros/system_library.h" |
| 18 #include "chrome/browser/chromeos/language_preferences.h" | 19 #include "chrome/browser/chromeos/language_preferences.h" |
| 19 #include "chrome/browser/chromeos/options/language_config_util.h" | 20 #include "chrome/browser/chromeos/options/language_config_util.h" |
| 20 #include "chrome/browser/chromeos/options/language_config_view.h" | 21 #include "chrome/browser/chromeos/options/language_config_view.h" |
| 21 #include "chrome/browser/chromeos/options/options_window_view.h" | 22 #include "chrome/browser/chromeos/options/options_window_view.h" |
| 22 #include "chrome/browser/pref_member.h" | 23 #include "chrome/browser/pref_member.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 120 } |
| 120 | 121 |
| 121 virtual ~TimezoneComboboxModel() { | 122 virtual ~TimezoneComboboxModel() { |
| 122 STLDeleteElements(&timezones_); | 123 STLDeleteElements(&timezones_); |
| 123 } | 124 } |
| 124 | 125 |
| 125 virtual int GetItemCount() { | 126 virtual int GetItemCount() { |
| 126 return static_cast<int>(timezones_.size()); | 127 return static_cast<int>(timezones_.size()); |
| 127 } | 128 } |
| 128 | 129 |
| 129 virtual std::wstring GetItemAt(int index) { | 130 virtual string16 GetItemAt(int index) { |
| 130 icu::UnicodeString name; | 131 icu::UnicodeString name; |
| 131 timezones_[index]->getDisplayName(name); | 132 timezones_[index]->getDisplayName(name); |
| 132 std::wstring output; | 133 std::wstring output; |
| 133 UTF16ToWide(name.getBuffer(), name.length(), &output); | 134 UTF16ToWide(name.getBuffer(), name.length(), &output); |
| 134 int hour_offset = timezones_[index]->getRawOffset() / 3600000; | 135 int hour_offset = timezones_[index]->getRawOffset() / 3600000; |
| 135 return StringPrintf(hour_offset == 0 ? L"(GMT) " : (hour_offset > 0 ? | 136 return WideToUTF16Hack( |
| 136 L"(GMT+%d) " : L"(GMT%d) "), hour_offset) + output; | 137 StringPrintf(hour_offset == 0 ? L"(GMT) " : (hour_offset > 0 ? |
| 138 L"(GMT+%d) " : L"(GMT%d) "), hour_offset) + output); |
| 137 } | 139 } |
| 138 | 140 |
| 139 virtual icu::TimeZone* GetTimeZoneAt(int index) { | 141 virtual icu::TimeZone* GetTimeZoneAt(int index) { |
| 140 return timezones_[index]; | 142 return timezones_[index]; |
| 141 } | 143 } |
| 142 | 144 |
| 143 private: | 145 private: |
| 144 std::vector<icu::TimeZone*> timezones_; | 146 std::vector<icu::TimeZone*> timezones_; |
| 145 | 147 |
| 146 DISALLOW_COPY_AND_ASSIGN(TimezoneComboboxModel); | 148 DISALLOW_COPY_AND_ASSIGN(TimezoneComboboxModel); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 675 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 674 layout->StartRow(0, single_column_view_set_id); | 676 layout->StartRow(0, single_column_view_set_id); |
| 675 layout->AddView(new LanguageSection(profile())); | 677 layout->AddView(new LanguageSection(profile())); |
| 676 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 678 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 677 layout->StartRow(0, single_column_view_set_id); | 679 layout->StartRow(0, single_column_view_set_id); |
| 678 layout->AddView(new AccessibilitySection(profile())); | 680 layout->AddView(new AccessibilitySection(profile())); |
| 679 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 681 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 680 } | 682 } |
| 681 | 683 |
| 682 } // namespace chromeos | 684 } // namespace chromeos |
| OLD | NEW |