diff options
Diffstat (limited to 'chrome/browser/chromeos/input_method')
-rw-r--r-- | chrome/browser/chromeos/input_method/input_method_util.cc | 16 | ||||
-rw-r--r-- | chrome/browser/chromeos/input_method/input_method_util.h | 16 |
2 files changed, 19 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc index 7bac1ce..97a4aba 100644 --- a/chrome/browser/chromeos/input_method/input_method_util.cc +++ b/chrome/browser/chromeos/input_method/input_method_util.cc @@ -77,7 +77,7 @@ struct IdMaps { } // Go through the languages listed in kExtraLanguages. - for (size_t i = 0; i < arraysize(kExtraLanguages); ++i) { + for (size_t i = 0; i < kExtraLanguagesLength; ++i) { const char* language_code = kExtraLanguages[i].language_code; const char* input_method_id = kExtraLanguages[i].input_method_id; InputMethodIdToDescriptorMap::const_iterator iter = @@ -358,6 +358,20 @@ bool GetLocalizedString(const std::string& english_string, } // namespace +const ExtraLanguage kExtraLanguages[] = { + // Language Code Input Method ID + { "en-AU", "xkb:us::eng" }, // For Austrailia, use US keyboard layout. + { "id", "xkb:us::eng" }, // For Indonesian, use US keyboard layout. + // The code "fil" comes from app/l10_util.cc. + { "fil", "xkb:us::eng" }, // For Filipino, use US keyboard layout. + // For Netherlands, use US international keyboard layout. + { "nl", "xkb:us:intl:eng" }, + // The code "es-419" comes from app/l10_util.cc. + // For Spanish in Latin America, use Latin American keyboard layout. + { "es-419", "xkb:latam::spa" }, +}; +const size_t kExtraLanguagesLength = arraysize(kExtraLanguages); + std::wstring GetString(const std::string& english_string, const std::string& input_method_id) { string16 localized_string; diff --git a/chrome/browser/chromeos/input_method/input_method_util.h b/chrome/browser/chromeos/input_method/input_method_util.h index 2b13f42..0dd7897 100644 --- a/chrome/browser/chromeos/input_method/input_method_util.h +++ b/chrome/browser/chromeos/input_method/input_method_util.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ #pragma once +#include <cstddef> #include <map> #include <string> #include <vector> @@ -18,21 +19,12 @@ namespace input_method { // The list of language that do not have associated input methods in IBus. // For these languages, we associate input methods here. -const struct ExtraLanguage { +struct ExtraLanguage { const char* language_code; const char* input_method_id; -} kExtraLanguages[] = { - { "en-AU", "xkb:us::eng" }, // For Austrailia, use US keyboard layout. - { "id", "xkb:us::eng" }, // For Indonesian, use US keyboard layout. - // The code "fil" comes from app/l10_util.cc. - { "fil", "xkb:us::eng" }, // For Filipino, use US keyboard layout. - // For Netherlands, use US international keyboard layout. - { "nl", "xkb:us:intl:eng" }, - // The code "es-419" comes from app/l10_util.cc. - // For Spanish in Latin America, use Latin American keyboard layout. - { "es-419", "xkb:latam::spa" }, }; -// TODO(yusukes): Move |kExtraLanguages| to input_method_util.cc. +extern const ExtraLanguage kExtraLanguages[]; +extern const size_t kExtraLanguagesLength; // Converts a string sent from IBus IME engines, which is written in English, // into Chrome's string ID, then pulls internationalized resource string from |