| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // This function should be called when Chrome's application locale is | 124 // This function should be called when Chrome's application locale is |
| 125 // changed, so that the internal maps of this library is reloaded. | 125 // changed, so that the internal maps of this library is reloaded. |
| 126 void OnLocaleChanged(); | 126 void OnLocaleChanged(); |
| 127 | 127 |
| 128 // Sets an input method ID of the hardware keyboard for testing. | 128 // Sets an input method ID of the hardware keyboard for testing. |
| 129 void SetHardwareInputMethodIdForTesting(const std::string& input_method_id); | 129 void SetHardwareInputMethodIdForTesting(const std::string& input_method_id); |
| 130 | 130 |
| 131 // Returns true if the given input method id is for a keyboard layout. | 131 // Returns true if the given input method id is for a keyboard layout. |
| 132 static bool IsKeyboardLayout(const std::string& input_method_id); | 132 static bool IsKeyboardLayout(const std::string& input_method_id); |
| 133 | 133 |
| 134 // Returns true if the given input method id is for an extension input method. |
| 135 static bool IsExtensionInputMethod(const std::string& input_method_id); |
| 136 |
| 134 // Converts a language code to a language display name, using the | 137 // Converts a language code to a language display name, using the |
| 135 // current application locale. MaybeRewriteLanguageName() is called | 138 // current application locale. MaybeRewriteLanguageName() is called |
| 136 // internally. | 139 // internally. |
| 137 // Examples: "fi" => "Finnish" | 140 // Examples: "fi" => "Finnish" |
| 138 // "en-US" => "English (United States)" | 141 // "en-US" => "English (United States)" |
| 139 static string16 GetLanguageDisplayNameFromCode( | 142 static string16 GetLanguageDisplayNameFromCode( |
| 140 const std::string& language_code); | 143 const std::string& language_code); |
| 141 | 144 |
| 142 // Converts a language code to a language native display name. | 145 // Converts a language code to a language native display name. |
| 143 // MaybeRewriteLanguageName() is called internally. | 146 // MaybeRewriteLanguageName() is called internally. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 typedef base::hash_map<std::string, int> HashType; | 195 typedef base::hash_map<std::string, int> HashType; |
| 193 HashType english_to_resource_id_; | 196 HashType english_to_resource_id_; |
| 194 | 197 |
| 195 std::string hardware_input_method_id_for_testing_; | 198 std::string hardware_input_method_id_for_testing_; |
| 196 }; | 199 }; |
| 197 | 200 |
| 198 } // namespace input_method | 201 } // namespace input_method |
| 199 } // namespace chromeos | 202 } // namespace chromeos |
| 200 | 203 |
| 201 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 204 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
| OLD | NEW |