| 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_chewing_config_view.h" | 5 #include "chrome/browser/chromeos/options/language_chewing_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/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 DCHECK(pref_id < kNumChewingIntegerPrefs); | 95 DCHECK(pref_id < kNumChewingIntegerPrefs); |
| 96 chewing_integer_prefs_[pref_id].SetValue(sender->value()); | 96 chewing_integer_prefs_[pref_id].SetValue(sender->value()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 void LanguageChewingConfigView::Layout() { | 100 void LanguageChewingConfigView::Layout() { |
| 101 // Not sure why but this is needed to show contents in the dialog. | 101 // Not sure why but this is needed to show contents in the dialog. |
| 102 contents_->SetBounds(0, 0, width(), height()); | 102 contents_->SetBounds(0, 0, width(), height()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 int LanguageChewingConfigView::GetDialogButtons() const { |
| 106 return MessageBoxFlags::DIALOGBUTTON_OK; |
| 107 } |
| 108 |
| 109 std::wstring LanguageChewingConfigView::GetDialogButtonLabel( |
| 110 MessageBoxFlags::DialogButton button) const { |
| 111 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { |
| 112 return l10n_util::GetString(IDS_OK); |
| 113 } |
| 114 return L""; |
| 115 } |
| 116 |
| 105 std::wstring LanguageChewingConfigView::GetWindowTitle() const { | 117 std::wstring LanguageChewingConfigView::GetWindowTitle() const { |
| 106 return l10n_util::GetString( | 118 return l10n_util::GetString( |
| 107 IDS_OPTIONS_SETTINGS_LANGUAGES_CHEWING_SETTINGS_TITLE); | 119 IDS_OPTIONS_SETTINGS_LANGUAGES_CHEWING_SETTINGS_TITLE); |
| 108 } | 120 } |
| 109 | 121 |
| 110 gfx::Size LanguageChewingConfigView::GetPreferredSize() { | 122 gfx::Size LanguageChewingConfigView::GetPreferredSize() { |
| 111 return gfx::Size(views::Window::GetLocalizedContentsSize( | 123 return gfx::Size(views::Window::GetLocalizedContentsSize( |
| 112 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, | 124 IDS_LANGUAGES_INPUT_DIALOG_WIDTH_CHARS, |
| 113 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES)); | 125 IDS_LANGUAGES_INPUT_DIALOG_HEIGHT_LINES)); |
| 114 } | 126 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 const int value = hsu_sel_key_type_.multiple_choice_pref.GetValue(); | 226 const int value = hsu_sel_key_type_.multiple_choice_pref.GetValue(); |
| 215 for (int i = 0; i < hsu_sel_key_type_.combobox_model->num_items(); ++i) { | 227 for (int i = 0; i < hsu_sel_key_type_.combobox_model->num_items(); ++i) { |
| 216 if (hsu_sel_key_type_.combobox_model->GetConfigValueAt(i) == value) { | 228 if (hsu_sel_key_type_.combobox_model->GetConfigValueAt(i) == value) { |
| 217 hsu_sel_key_type_.combobox->SetSelectedItem(i); | 229 hsu_sel_key_type_.combobox->SetSelectedItem(i); |
| 218 break; | 230 break; |
| 219 } | 231 } |
| 220 } | 232 } |
| 221 } | 233 } |
| 222 | 234 |
| 223 } // namespace chromeos | 235 } // namespace chromeos |
| OLD | NEW |