Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.cc

Issue 308623002: Initialize IMF with a whitelist of input methods so that login screen doesn't need to wait for comp… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_manager_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4361b1154cfad28ac7af7beeb9278e4a1df2739d..5ce5269223e6dc31146d52d2e75575a5f6b4998f 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -402,12 +402,17 @@ InputMethodUtil::~InputMethodUtil() {
bool InputMethodUtil::TranslateStringInternal(
const std::string& english_string, base::string16 *out_string) const {
DCHECK(out_string);
- HashType::const_iterator iter = english_to_resource_id_.find(english_string);
+ // |english_string| could be an input method id. So legacy xkb id is required
+ // to get the translated string.
+ std::string key_string = extension_ime_util::MaybeGetLegacyXkbId(
+ english_string);
+ HashType::const_iterator iter = english_to_resource_id_.find(key_string);
+
if (iter == english_to_resource_id_.end()) {
// TODO(yusukes): Write Autotest which checks if all display names and all
// property names for supported input methods are listed in the resource
// ID array (crosbug.com/4572).
- LOG(ERROR) << "Resource ID is not found for: " << english_string;
+ LOG(ERROR) << "Resource ID is not found for: " << key_string;
return false;
}
@@ -550,12 +555,7 @@ base::string16 InputMethodUtil::GetInputMethodLongName(
DCHECK(!input_method.language_codes().empty());
const std::string language_code = input_method.language_codes().at(0);
- // Before translate the string, convert the input method id to legacy xkb id
- // if possible.
- // TODO(shuchen): the GetInputMethodLongName() method should be removed when
- // finish the wrapping of xkb to extension.
- base::string16 text = TranslateString(
- extension_ime_util::MaybeGetLegacyXkbId(input_method.id()));
+ base::string16 text = TranslateString(input_method.id());
if (text == standard_input_method_text ||
language_code == "de" ||
language_code == "fr" ||
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698