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

Unified Diff: chromeos/ime/extension_ime_util.cc

Issue 13060003: Extract Extension IME related utility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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
« no previous file with comments | « chromeos/ime/extension_ime_util.h ('k') | chromeos/ime/extension_ime_util_unittest.cc » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..543d4d54ae0999de56cbd18c9e166c210a196d85
--- /dev/null
+++ b/chromeos/ime/extension_ime_util.cc
@@ -0,0 +1,29 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/ime/extension_ime_util.h"
+
+#include "base/string_util.h"
+
+namespace chromeos {
+namespace {
+const char* kExtensionIMEPrefix = "_ext_ime_";
+} // namespace
+
+namespace extension_ime_util {
+std::string GetInputMethodID(const std::string& extension_id,
+ const std::string& engine_id) {
+ DCHECK(!extension_id.empty());
+ DCHECK(!engine_id.empty());
+ return kExtensionIMEPrefix + extension_id + engine_id;
+}
+
+bool IsExtensionIME(const std::string& input_method_id) {
+ return StartsWithASCII(input_method_id,
+ kExtensionIMEPrefix,
+ false); // Case insensitive.
Zachary Kuznia 2013/03/26 09:22:14 Why is this case insensitive?
Seigo Nonaka 2013/03/26 09:27:32 To meets previous implementation, but case sensiti
+}
+
+} // namespace extension_ime_util
+} // namespace chromeos
« no previous file with comments | « chromeos/ime/extension_ime_util.h ('k') | chromeos/ime/extension_ime_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698