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 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "app/combobox_model.h" | 9 #include "app/combobox_model.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 LOG(ERROR) << "Index is out of bounds: " << index; | 44 LOG(ERROR) << "Index is out of bounds: " << index; |
45 return string16(); | 45 return string16(); |
46 } | 46 } |
47 const int message_id = (pref_data_->values_and_ids)[index].item_message_id; | 47 const int message_id = (pref_data_->values_and_ids)[index].item_message_id; |
48 return l10n_util::GetStringUTF16(message_id); | 48 return l10n_util::GetStringUTF16(message_id); |
49 } | 49 } |
50 | 50 |
51 // Gets a label for the combobox like "Input mode". This function is NOT part | 51 // Gets a label for the combobox like "Input mode". This function is NOT part |
52 // of the ComboboxModel interface. | 52 // of the ComboboxModel interface. |
53 std::wstring GetLabel() const { | 53 std::wstring GetLabel() const { |
54 return l10n_util::GetString(pref_data_->label_message_id); | 54 return UTF16ToWide(l10n_util::GetStringUTF16(pref_data_->label_message_id)); |
55 } | 55 } |
56 | 56 |
57 // Gets a config value for the ibus configuration daemon (e.g. "KUTEN_TOUTEN", | 57 // Gets a config value for the ibus configuration daemon (e.g. "KUTEN_TOUTEN", |
58 // "KUTEN_PERIOD", ..) for an item at zero-origin |index|. This function is | 58 // "KUTEN_PERIOD", ..) for an item at zero-origin |index|. This function is |
59 // NOT part of the ComboboxModel interface. | 59 // NOT part of the ComboboxModel interface. |
60 DataType GetConfigValueAt(int index) const { | 60 DataType GetConfigValueAt(int index) const { |
61 if (index < 0 || index >= num_items_) { | 61 if (index < 0 || index >= num_items_) { |
62 LOG(ERROR) << "Index is out of bounds: " << index; | 62 LOG(ERROR) << "Index is out of bounds: " << index; |
63 return (pref_data_->values_and_ids)[0].ibus_config_value; | 63 return (pref_data_->values_and_ids)[0].ibus_config_value; |
64 } | 64 } |
(...skipping 27 matching lines...) Expand all Loading... |
92 | 92 |
93 private: | 93 private: |
94 static const int kMinComboboxWidth = 250; | 94 static const int kMinComboboxWidth = 250; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(LanguageCombobox); | 96 DISALLOW_COPY_AND_ASSIGN(LanguageCombobox); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace chromeos | 99 } // namespace chromeos |
100 | 100 |
101 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ | 101 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ |
OLD | NEW |