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

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

Issue 9837082: Do not try to get a display name from an input method ID which starts with "_ext_ime". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 9 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
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 254394bf5a9971d619c5285d04750eb680487474..5df029bdf85e3e6a6fa9f8888112877bc0c3b883 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -64,6 +64,9 @@ const size_t kMappingFromIdToIndicatorTextLen =
}
namespace chromeos {
+
+extern const char* kExtensionImePrefix;
+
namespace input_method {
namespace {
@@ -327,6 +330,15 @@ bool InputMethodUtil::IsKeyboardLayout(const std::string& input_method_id) {
return StartsWithASCII(input_method_id, "xkb:", kCaseInsensitive);
}
+// static
+bool InputMethodUtil::IsExtensionInputMethod(
+ const std::string& input_method_id) {
+ const bool kCaseInsensitive = false;
+ return StartsWithASCII(input_method_id,
+ kExtensionImePrefix,
+ kCaseInsensitive);
+}
+
std::string InputMethodUtil::GetLanguageCodeFromInputMethodId(
const std::string& input_method_id) const {
// The code should be compatible with one of codes used for UI languages,
@@ -351,7 +363,8 @@ std::string InputMethodUtil::GetKeyboardLayoutName(
std::string InputMethodUtil::GetInputMethodDisplayNameFromId(
const std::string& input_method_id) const {
string16 display_name;
- if (TranslateStringInternal(input_method_id, &display_name)) {
+ if (!IsExtensionInputMethod(input_method_id) &&
+ TranslateStringInternal(input_method_id, &display_name)) {
return UTF16ToUTF8(display_name);
}
// Return an empty string if the display name is not found.

Powered by Google App Engine
This is Rietveld 408576698