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/language_hangul_config_view.h" | 5 #include "chrome/browser/chromeos/options/language_hangul_config_view.h" |
6 | 6 |
7 #include "app/combobox_model.h" | 7 #include "app/combobox_model.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/common/notification_type.h" | 10 #include "chrome/common/notification_type.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "views/grid_layout.h" | 21 #include "views/grid_layout.h" |
22 #include "views/standard_layout.h" | 22 #include "views/standard_layout.h" |
23 #include "views/window/window.h" | 23 #include "views/window/window.h" |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 | 26 |
27 // The combobox model for the list of hangul keyboards. | 27 // The combobox model for the list of hangul keyboards. |
28 class HangulKeyboardComboboxModel : public ComboboxModel { | 28 class HangulKeyboardComboboxModel : public ComboboxModel { |
29 public: | 29 public: |
30 HangulKeyboardComboboxModel() { | 30 HangulKeyboardComboboxModel() { |
31 for (size_t i = 0; i < kNumHangulKeyboardNameIDPairs; ++i) { | 31 for (size_t i = 0; i < language_prefs::kNumHangulKeyboardNameIDPairs; |
| 32 ++i) { |
32 layouts_.push_back(std::make_pair( | 33 layouts_.push_back(std::make_pair( |
33 l10n_util::GetStringUTF8(kHangulKeyboardNameIDPairs[i].message_id), | 34 l10n_util::GetStringUTF8( |
34 kHangulKeyboardNameIDPairs[i].keyboard_id)); | 35 language_prefs::kHangulKeyboardNameIDPairs[i].message_id), |
| 36 language_prefs::kHangulKeyboardNameIDPairs[i].keyboard_id)); |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 // Implements ComboboxModel interface. | 40 // Implements ComboboxModel interface. |
39 virtual int GetItemCount() { | 41 virtual int GetItemCount() { |
40 return static_cast<int>(layouts_.size()); | 42 return static_cast<int>(layouts_.size()); |
41 } | 43 } |
42 | 44 |
43 // Implements ComboboxModel interface. | 45 // Implements ComboboxModel interface. |
44 virtual std::wstring GetItemAt(int index) { | 46 virtual std::wstring GetItemAt(int index) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 175 |
174 void LanguageHangulConfigView::NotifyPrefChanged() { | 176 void LanguageHangulConfigView::NotifyPrefChanged() { |
175 const std::string id = keyboard_pref_.GetValue(); | 177 const std::string id = keyboard_pref_.GetValue(); |
176 const int index = | 178 const int index = |
177 hangul_keyboard_combobox_model_->GetIndexFromID(id); | 179 hangul_keyboard_combobox_model_->GetIndexFromID(id); |
178 if (index >= 0) | 180 if (index >= 0) |
179 hangul_keyboard_combobox_->SetSelectedItem(index); | 181 hangul_keyboard_combobox_->SetSelectedItem(index); |
180 } | 182 } |
181 | 183 |
182 } // namespace chromeos | 184 } // namespace chromeos |
OLD | NEW |