Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: chrome/browser/chromeos/options/language_hangul_config_view.cc

Issue 3132023: Add language_prefs namespace to language_preferences.h. (Closed)
Patch Set: address comments Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/language_config_util.h ('k') | chrome/browser/chromeos/options/language_mozc_config_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698