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
3 // found in the LICENSE file.
5 #include "chromeos/ime/extension_ime_util.h"
7 #include "base/strings/string_util.h"
11 const char* kExtensionIMEPrefix
= "_ext_ime_";
14 namespace extension_ime_util
{
15 std::string
GetInputMethodID(const std::string
& extension_id
,
16 const std::string
& engine_id
) {
17 DCHECK(!extension_id
.empty());
18 DCHECK(!engine_id
.empty());
19 return kExtensionIMEPrefix
+ extension_id
+ engine_id
;
22 bool IsExtensionIME(const std::string
& input_method_id
) {
23 return StartsWithASCII(input_method_id
,
25 true); // Case sensitive.
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 true); // Case sensitive.
35 } // namespace extension_ime_util
36 } // namespace chromeos