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

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

Issue 177093002: [IME] Loads chromeos-xkb extension and add the extension based xkb keyboards in the chrome://settin… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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
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/strings/string_util.h" 7 #include "base/strings/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 const int kExtensionIMEPrefixLength = 12 const int kExtensionIMEPrefixLength =
13 sizeof(kExtensionIMEPrefix) / sizeof(kExtensionIMEPrefix[0]) - 1; 13 sizeof(kExtensionIMEPrefix) / sizeof(kExtensionIMEPrefix[0]) - 1;
14 const char kComponentExtensionIMEPrefix[] = "_comp_ime_"; 14 const char kComponentExtensionIMEPrefix[] = "_comp_ime_";
15 const char kExtensionXkbIdPrefix[] =
16 "_comp_ime_fgoepimhcoialccpbmpnnblemnepkkao";
15 const int kComponentExtensionIMEPrefixLength = 17 const int kComponentExtensionIMEPrefixLength =
16 sizeof(kComponentExtensionIMEPrefix) / 18 sizeof(kComponentExtensionIMEPrefix) /
17 sizeof(kComponentExtensionIMEPrefix[0]) - 1; 19 sizeof(kComponentExtensionIMEPrefix[0]) - 1;
18 const int kExtensionIdLength = 32; 20 const int kExtensionIdLength = 32;
19 } // namespace 21 } // namespace
20 22
21 namespace extension_ime_util { 23 namespace extension_ime_util {
22 std::string GetInputMethodID(const std::string& extension_id, 24 std::string GetInputMethodID(const std::string& extension_id,
23 const std::string& engine_id) { 25 const std::string& engine_id) {
24 DCHECK(!extension_id.empty()); 26 DCHECK(!extension_id.empty());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 true); // Case sensitive. 64 true); // Case sensitive.
63 } 65 }
64 66
65 bool IsMemberOfExtension(const std::string& input_method_id, 67 bool IsMemberOfExtension(const std::string& input_method_id,
66 const std::string& extension_id) { 68 const std::string& extension_id) {
67 return StartsWithASCII(input_method_id, 69 return StartsWithASCII(input_method_id,
68 kExtensionIMEPrefix + extension_id, 70 kExtensionIMEPrefix + extension_id,
69 true); // Case sensitive. 71 true); // Case sensitive.
70 } 72 }
71 73
74 bool IsKeyboardLayoutExtension(const std::string& input_method_id) {
75 return StartsWithASCII(input_method_id, kExtensionXkbIdPrefix, true);
76 }
77
72 } // namespace extension_ime_util 78 } // namespace extension_ime_util
73 } // namespace chromeos 79 } // namespace chromeos
OLDNEW
« chromeos/ime/component_extension_ime_manager.cc ('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