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

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: Created 6 years, 6 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..ab1354183bd498a716531d1b4141e2954a9c394c 100644
--- a/chromeos/ime/extension_ime_util.cc
+++ b/chromeos/ime/extension_ime_util.cc
@@ -110,12 +110,24 @@ bool IsKeyboardLayoutExtension(const std::string& input_method_id) {
return StartsWithASCII(input_method_id, prefix + kXkbExtensionId, true);
}
-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)
+std::string GetEngineIDByInputMethodID(const std::string& input_method_id) {
+ if (!IsComponentExtensionIME(input_method_id))
+ return input_method_id;
+
Shu Chen 2014/07/02 02:29:04 just do: return input_method_id.substr(kComponent
michaelpg 2014/07/10 00:46:01 Done.
+ size_t pos = std::string::npos;
+ if (IsKeyboardLayoutExtension(input_method_id))
+ pos = input_method_id.find("xkb:");
+ else
+ pos = input_method_id.find(kComponentExtensionIMEPrefix);
+
+ if (pos != std::string::npos)
return input_method_id.substr(pos);
- }
+ return input_method_id;
+}
+
+std::string MaybeGetLegacyXkbId(const std::string& input_method_id) {
+ 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