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

Side by Side Diff: chromeos/ime/extension_ime_util.cc

Issue 12583012: Introduce IsMemberOfExtension function into ExtensionIMEUtil. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/ime/extension_ime_util.h" 5 #include "chromeos/ime/extension_ime_util.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 8
9 namespace chromeos { 9 namespace chromeos {
10 namespace { 10 namespace {
11 const char* kExtensionIMEPrefix = "_ext_ime_"; 11 const char* kExtensionIMEPrefix = "_ext_ime_";
12 } // namespace 12 } // namespace
13 13
14 namespace extension_ime_util { 14 namespace extension_ime_util {
15 std::string GetInputMethodID(const std::string& extension_id, 15 std::string GetInputMethodID(const std::string& extension_id,
16 const std::string& engine_id) { 16 const std::string& engine_id) {
17 DCHECK(!extension_id.empty()); 17 DCHECK(!extension_id.empty());
18 DCHECK(!engine_id.empty()); 18 DCHECK(!engine_id.empty());
19 return kExtensionIMEPrefix + extension_id + engine_id; 19 return kExtensionIMEPrefix + extension_id + engine_id;
20 } 20 }
21 21
22 bool IsExtensionIME(const std::string& input_method_id) { 22 bool IsExtensionIME(const std::string& input_method_id) {
23 return StartsWithASCII(input_method_id, 23 return StartsWithASCII(input_method_id,
24 kExtensionIMEPrefix, 24 kExtensionIMEPrefix,
25 false); // Case insensitive. 25 false); // Case insensitive.
26 } 26 }
27 27
28 bool IsMemberOfExtension(const std::string& input_method_id,
29 const std::string& extension_id) {
30 return StartsWithASCII(input_method_id,
31 kExtensionIMEPrefix + extension_id,
32 false); // Case insensitive.
Zachary Kuznia 2013/03/26 09:17:29 Why is this case insensitive?
Seigo Nonaka 2013/03/26 09:26:37 For meeting as above implementation. But case sens
33 }
34
28 } // namespace extension_ime_util 35 } // namespace extension_ime_util
29 } // namespace chromeos 36 } // namespace chromeos
OLDNEW
« 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