| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <cstddef> |
| 9 #include <map> | 10 #include <map> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/string16.h" | 14 #include "base/string16.h" |
| 14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 15 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 15 | 16 |
| 16 namespace chromeos { | 17 namespace chromeos { |
| 17 namespace input_method { | 18 namespace input_method { |
| 18 | 19 |
| 19 // The list of language that do not have associated input methods in IBus. | 20 // The list of language that do not have associated input methods in IBus. |
| 20 // For these languages, we associate input methods here. | 21 // For these languages, we associate input methods here. |
| 21 const struct ExtraLanguage { | 22 struct ExtraLanguage { |
| 22 const char* language_code; | 23 const char* language_code; |
| 23 const char* input_method_id; | 24 const char* input_method_id; |
| 24 } kExtraLanguages[] = { | |
| 25 { "en-AU", "xkb:us::eng" }, // For Austrailia, use US keyboard layout. | |
| 26 { "id", "xkb:us::eng" }, // For Indonesian, use US keyboard layout. | |
| 27 // The code "fil" comes from app/l10_util.cc. | |
| 28 { "fil", "xkb:us::eng" }, // For Filipino, use US keyboard layout. | |
| 29 // For Netherlands, use US international keyboard layout. | |
| 30 { "nl", "xkb:us:intl:eng" }, | |
| 31 // The code "es-419" comes from app/l10_util.cc. | |
| 32 // For Spanish in Latin America, use Latin American keyboard layout. | |
| 33 { "es-419", "xkb:latam::spa" }, | |
| 34 }; | 25 }; |
| 35 // TODO(yusukes): Move |kExtraLanguages| to input_method_util.cc. | 26 extern const ExtraLanguage kExtraLanguages[]; |
| 27 extern const size_t kExtraLanguagesLength; |
| 36 | 28 |
| 37 // Converts a string sent from IBus IME engines, which is written in English, | 29 // Converts a string sent from IBus IME engines, which is written in English, |
| 38 // into Chrome's string ID, then pulls internationalized resource string from | 30 // into Chrome's string ID, then pulls internationalized resource string from |
| 39 // the resource bundle and returns it. These functions are not thread-safe. | 31 // the resource bundle and returns it. These functions are not thread-safe. |
| 40 // Non-UI threads are not allowed to call them. | 32 // Non-UI threads are not allowed to call them. |
| 41 std::wstring GetString( | 33 std::wstring GetString( |
| 42 const std::string& english_string, const std::string& input_method_id); | 34 const std::string& english_string, const std::string& input_method_id); |
| 43 std::string GetStringUTF8( | 35 std::string GetStringUTF8( |
| 44 const std::string& english_string, const std::string& input_method_id); | 36 const std::string& english_string, const std::string& input_method_id); |
| 45 string16 GetStringUTF16( | 37 string16 GetStringUTF16( |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 const std::string& normalized_language_code, | 182 const std::string& normalized_language_code, |
| 191 InputMethodType type, | 183 InputMethodType type, |
| 192 std::vector<std::string>* out_input_method_ids); | 184 std::vector<std::string>* out_input_method_ids); |
| 193 | 185 |
| 194 void ReloadInternalMaps(); | 186 void ReloadInternalMaps(); |
| 195 | 187 |
| 196 } // namespace input_method | 188 } // namespace input_method |
| 197 } // namespace chromeos | 189 } // namespace chromeos |
| 198 | 190 |
| 199 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 191 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
| OLD | NEW |