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

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

Issue 6156001: Remove wstring from l10n_util. Part 8, the last part.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
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_chewing_config_view.h" 5 #include "chrome/browser/chromeos/options/language_chewing_config_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/cros/input_method_library.h" 10 #include "chrome/browser/chromeos/cros/input_method_library.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 contents_->SetBounds(0, 0, width(), height()); 108 contents_->SetBounds(0, 0, width(), height());
109 } 109 }
110 110
111 int LanguageChewingConfigView::GetDialogButtons() const { 111 int LanguageChewingConfigView::GetDialogButtons() const {
112 return MessageBoxFlags::DIALOGBUTTON_OK; 112 return MessageBoxFlags::DIALOGBUTTON_OK;
113 } 113 }
114 114
115 std::wstring LanguageChewingConfigView::GetDialogButtonLabel( 115 std::wstring LanguageChewingConfigView::GetDialogButtonLabel(
116 MessageBoxFlags::DialogButton button) const { 116 MessageBoxFlags::DialogButton button) const {
117 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { 117 if (button == MessageBoxFlags::DIALOGBUTTON_OK) {
118 return l10n_util::GetString(IDS_OK); 118 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK));
119 } 119 }
120 return L""; 120 return L"";
121 } 121 }
122 122
123 std::wstring LanguageChewingConfigView::GetWindowTitle() const { 123 std::wstring LanguageChewingConfigView::GetWindowTitle() const {
124 return l10n_util::GetString( 124 return UTF16ToWide(l10n_util::GetStringUTF16(
125 IDS_OPTIONS_SETTINGS_LANGUAGES_CHEWING_SETTINGS_TITLE); 125 IDS_OPTIONS_SETTINGS_LANGUAGES_CHEWING_SETTINGS_TITLE));
126 } 126 }
127 127
128 gfx::Size LanguageChewingConfigView::GetPreferredSize() { 128 gfx::Size LanguageChewingConfigView::GetPreferredSize() {
129 return gfx::Size(views::Window::GetLocalizedContentsSize( 129 return gfx::Size(views::Window::GetLocalizedContentsSize(
130 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, 130 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS,
131 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES)); 131 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES));
132 } 132 }
133 133
134 void LanguageChewingConfigView::InitControlLayout() { 134 void LanguageChewingConfigView::InitControlLayout() {
135 using views::ColumnSet; 135 using views::ColumnSet;
(...skipping 10 matching lines...) Expand all
146 const int kColumnSetId = 0; 146 const int kColumnSetId = 0;
147 ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); 147 ColumnSet* column_set = layout->AddColumnSet(kColumnSetId);
148 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, 148 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
149 GridLayout::USE_PREF, 0, 0); 149 GridLayout::USE_PREF, 0, 0);
150 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); 150 column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing);
151 column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 1, 151 column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 1,
152 GridLayout::USE_PREF, 0, 0); 152 GridLayout::USE_PREF, 0, 0);
153 153
154 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) { 154 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
155 chewing_boolean_checkboxes_[i] = new views::Checkbox( 155 chewing_boolean_checkboxes_[i] = new views::Checkbox(
156 l10n_util::GetString( 156 UTF16ToWide(l10n_util::GetStringUTF16(
157 language_prefs::kChewingBooleanPrefs[i].message_id)); 157 language_prefs::kChewingBooleanPrefs[i].message_id)));
158 chewing_boolean_checkboxes_[i]->set_listener(this); 158 chewing_boolean_checkboxes_[i]->set_listener(this);
159 chewing_boolean_checkboxes_[i]->set_tag(i); 159 chewing_boolean_checkboxes_[i]->set_tag(i);
160 } 160 }
161 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) { 161 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) {
162 ChewingPrefAndAssociatedCombobox& current = prefs_and_comboboxes_[i]; 162 ChewingPrefAndAssociatedCombobox& current = prefs_and_comboboxes_[i];
163 current.combobox = new LanguageCombobox(current.combobox_model); 163 current.combobox = new LanguageCombobox(current.combobox_model);
164 current.combobox->set_listener(this); 164 current.combobox->set_listener(this);
165 } 165 }
166 hsu_sel_key_type_.combobox = 166 hsu_sel_key_type_.combobox =
167 new LanguageCombobox(hsu_sel_key_type_.combobox_model); 167 new LanguageCombobox(hsu_sel_key_type_.combobox_model);
(...skipping 10 matching lines...) Expand all
178 this); 178 this);
179 } 179 }
180 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) { 180 for (size_t i = 0; i < language_prefs::kNumChewingBooleanPrefs; ++i) {
181 layout->StartRow(0, kColumnSetId); 181 layout->StartRow(0, kColumnSetId);
182 layout->AddView(chewing_boolean_checkboxes_[i]); 182 layout->AddView(chewing_boolean_checkboxes_[i]);
183 } 183 }
184 184
185 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) { 185 for (size_t i = 0; i < language_prefs::kNumChewingIntegerPrefs; ++i) {
186 layout->StartRow(0, kColumnSetId); 186 layout->StartRow(0, kColumnSetId);
187 layout->AddView(new views::Label( 187 layout->AddView(new views::Label(
188 l10n_util::GetString( 188 UTF16ToWide(l10n_util::GetStringUTF16(
189 language_prefs::kChewingIntegerPrefs[i].message_id))); 189 language_prefs::kChewingIntegerPrefs[i].message_id))));
190 layout->AddView(chewing_integer_sliders_[i]); 190 layout->AddView(chewing_integer_sliders_[i]);
191 } 191 }
192 NotifyPrefChanged(); 192 NotifyPrefChanged();
193 193
194 // Show the comboboxes. 194 // Show the comboboxes.
195 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) { 195 for (size_t i = 0; i < language_prefs::kNumChewingMultipleChoicePrefs; ++i) {
196 const ChewingPrefAndAssociatedCombobox& current = prefs_and_comboboxes_[i]; 196 const ChewingPrefAndAssociatedCombobox& current = prefs_and_comboboxes_[i];
197 layout->StartRow(0, kColumnSetId); 197 layout->StartRow(0, kColumnSetId);
198 layout->AddView(new views::Label(current.combobox_model->GetLabel())); 198 layout->AddView(new views::Label(current.combobox_model->GetLabel()));
199 layout->AddView(current.combobox); 199 layout->AddView(current.combobox);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 const int value = hsu_sel_key_type_.multiple_choice_pref.GetValue(); 234 const int value = hsu_sel_key_type_.multiple_choice_pref.GetValue();
235 for (int i = 0; i < hsu_sel_key_type_.combobox_model->num_items(); ++i) { 235 for (int i = 0; i < hsu_sel_key_type_.combobox_model->num_items(); ++i) {
236 if (hsu_sel_key_type_.combobox_model->GetConfigValueAt(i) == value) { 236 if (hsu_sel_key_type_.combobox_model->GetConfigValueAt(i) == value) {
237 hsu_sel_key_type_.combobox->SetSelectedItem(i); 237 hsu_sel_key_type_.combobox->SetSelectedItem(i);
238 break; 238 break;
239 } 239 }
240 } 240 }
241 } 241 }
242 242
243 } // namespace chromeos 243 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/internet_page_view.cc ('k') | chrome/browser/chromeos/options/language_config_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698