Chromium Code Reviews| Index: chrome/browser/chromeos/input_method/input_method_util.cc |
| diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc |
| index 798a511f4d816905f1c4e53084058d3537492acc..8b221056ed5afb0cf7e99c9bd39533be60e17107 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_util.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_util.cc |
| @@ -61,6 +61,22 @@ const struct { |
| const size_t kMappingFromIdToIndicatorTextLen = |
| ARRAYSIZE_UNSAFE(kMappingFromIdToIndicatorText); |
| +// A mapping from an input method id to a medium length language indicator. |
| +// For those languages that want to display a slightly longer text in the |
| +// "Your input method has changed to..." bubble than in the status tray. |
| +// If an entry is not found in this table the short name is used. |
| +const struct { |
| + const char* input_method_id; |
| + const char* medium_length_name; |
| +} kMappintFromIdToMediumLengthName[] = { |
|
Daniel Erat
2012/09/24 20:48:00
s/Mappint/Mapping/
sschmitz
2012/09/24 21:28:16
OMG (wrong in several locations). Great eyes.
Don
|
| + { "mozc", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" }, |
| + { "mozc-dv", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" }, |
| + { "mozc-jp", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" }, |
| + { "zinnia-japanese", "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e" }, |
| +}; |
| +const size_t kMappintFromIdToMediumLengthNameLen = |
| + ARRAYSIZE_UNSAFE(kMappintFromIdToMediumLengthName); |
| + |
| string16 GetLanguageName(const std::string& language_code) { |
| const string16 language_name = l10n_util::GetDisplayNameForLocale( |
| language_code, g_browser_process->GetApplicationLocale(), true); |
| @@ -385,6 +401,20 @@ std::string InputMethodUtil::GetInputMethodDisplayNameFromId( |
| return ""; |
| } |
| +string16 InputMethodUtil::GetInputMethodMediumName( |
| + const InputMethodDescriptor& input_method) const { |
| + // For the "Your input method has changed to..." bubble. In most cases |
| + // it uses the same name as the short name, unless found in a table |
| + // for medium length names. |
| + for (size_t i = 0; i < kMappintFromIdToMediumLengthNameLen; ++i) { |
| + if (kMappintFromIdToMediumLengthName[i].input_method_id == |
| + input_method.id()) |
| + return |
| + UTF8ToUTF16(kMappintFromIdToMediumLengthName[i].medium_length_name); |
| + } |
| + return GetInputMethodShortName(input_method); |
| +} |
| + |
| string16 InputMethodUtil::GetInputMethodShortName( |
| const InputMethodDescriptor& input_method) const { |
| // For the status area, we use two-letter, upper-case language code like |