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

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

Issue 608183002: Move all white-listed input method indicator text from InputMethodUtil to manifests of IME extensio… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revised per comments. Created 6 years, 2 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
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 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 bool IsMemberOfExtension(const std::string& input_method_id, 111 bool IsMemberOfExtension(const std::string& input_method_id,
112 const std::string& extension_id) { 112 const std::string& extension_id) {
113 return StartsWithASCII(input_method_id, 113 return StartsWithASCII(input_method_id,
114 kExtensionIMEPrefix + extension_id, 114 kExtensionIMEPrefix + extension_id,
115 true /* Case sensitive */); 115 true /* Case sensitive */);
116 } 116 }
117 117
118 bool IsKeyboardLayoutExtension(const std::string& input_method_id) { 118 bool IsKeyboardLayoutExtension(const std::string& input_method_id) {
119 std::string prefix = kComponentExtensionIMEPrefix; 119 if (IsComponentExtensionIME(input_method_id))
120 return StartsWithASCII(input_method_id, prefix + kXkbExtensionId, true); 120 return StartsWithASCII(GetComponentIDByInputMethodID(input_method_id),
121 "xkb:", true);
122 return false;
121 } 123 }
122 124
123 std::string MaybeGetLegacyXkbId(const std::string& input_method_id) { 125 std::string MaybeGetLegacyXkbId(const std::string& input_method_id) {
124 if (IsKeyboardLayoutExtension(input_method_id)) 126 if (IsKeyboardLayoutExtension(input_method_id))
125 return GetComponentIDByInputMethodID(input_method_id); 127 return GetComponentIDByInputMethodID(input_method_id);
126 return input_method_id; 128 return input_method_id;
127 } 129 }
128 130
129 } // namespace extension_ime_util 131 } // namespace extension_ime_util
130 } // namespace chromeos 132 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698