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

Unified Diff: chromeos/ime/extension_ime_util.cc

Issue 312023002: Sync starting language and input method preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and dzhioev's comments Created 6 years, 5 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
« chromeos/ime/extension_ime_util.h ('K') | « chromeos/ime/extension_ime_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/extension_ime_util.cc
diff --git a/chromeos/ime/extension_ime_util.cc b/chromeos/ime/extension_ime_util.cc
index 474622df28773e9271c9baf3501457eceb6b5ca1..6591a0e9fc7252a02f3505e0c6a07cec8f1cd5d3 100644
--- a/chromeos/ime/extension_ime_util.cc
+++ b/chromeos/ime/extension_ime_util.cc
@@ -110,12 +110,16 @@ bool IsKeyboardLayoutExtension(const std::string& input_method_id) {
return StartsWithASCII(input_method_id, prefix + kXkbExtensionId, true);
}
+std::string GetEngineIDByInputMethodID(const std::string& input_method_id) {
+ if (!IsComponentExtensionIME(input_method_id))
+ return input_method_id;
+ return input_method_id.substr(kComponentExtensionIMEPrefixLength +
+ kExtensionIdLength);
+}
+
std::string MaybeGetLegacyXkbId(const std::string& input_method_id) {
- if (IsKeyboardLayoutExtension(input_method_id)) {
- size_t pos = input_method_id.find("xkb:");
- if (pos != std::string::npos)
- return input_method_id.substr(pos);
- }
+ if (IsKeyboardLayoutExtension(input_method_id))
+ return GetEngineIDByInputMethodID(input_method_id);
return input_method_id;
}
« chromeos/ime/extension_ime_util.h ('K') | « chromeos/ime/extension_ime_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698