OLD | NEW |
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/component_extension_ime_manager.h" | 5 #include "chromeos/ime/component_extension_ime_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "chromeos/ime/extension_ime_util.h" | 9 #include "chromeos/ime/extension_ime_util.h" |
| 10 #include "chromeos/ime/input_method_manager.h" |
10 | 11 |
11 namespace chromeos { | 12 namespace chromeos { |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 // The whitelist for enabling extension based xkb keyboards at login session. | 16 // The whitelist for enabling extension based xkb keyboards at login session. |
16 const char* kLoginLayoutWhitelist[] = { | 17 const char* kLoginLayoutWhitelist[] = { |
17 "be", | 18 "be", |
18 "br", | 19 "br", |
19 "ca", | 20 "ca", |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 142 |
142 input_method::InputMethodDescriptors | 143 input_method::InputMethodDescriptors |
143 ComponentExtensionIMEManager::GetAllIMEAsInputMethodDescriptor() { | 144 ComponentExtensionIMEManager::GetAllIMEAsInputMethodDescriptor() { |
144 input_method::InputMethodDescriptors result; | 145 input_method::InputMethodDescriptors result; |
145 for (std::map<std::string, ComponentExtensionIME>::const_iterator it = | 146 for (std::map<std::string, ComponentExtensionIME>::const_iterator it = |
146 component_extension_imes_.begin(); | 147 component_extension_imes_.begin(); |
147 it != component_extension_imes_.end(); ++it) { | 148 it != component_extension_imes_.end(); ++it) { |
148 const ComponentExtensionIME& ext = it->second; | 149 const ComponentExtensionIME& ext = it->second; |
149 for (size_t j = 0; j < ext.engines.size(); ++j) { | 150 for (size_t j = 0; j < ext.engines.size(); ++j) { |
150 const ComponentExtensionEngine& ime = ext.engines[j]; | 151 const ComponentExtensionEngine& ime = ext.engines[j]; |
| 152 // Filter out new Korean IME if the experimental flag is OFF. |
| 153 if (!input_method::InputMethodManager:: |
| 154 IsExperimentalImeFeaturesEnabled() && |
| 155 ime.engine_id == "ko-t-i0-und") { |
| 156 continue; |
| 157 } |
151 const std::string input_method_id = | 158 const std::string input_method_id = |
152 extension_ime_util::GetComponentInputMethodID( | 159 extension_ime_util::GetComponentInputMethodID( |
153 ext.id, ime.engine_id); | 160 ext.id, ime.engine_id); |
154 const std::vector<std::string>& layouts = ime.layouts; | 161 const std::vector<std::string>& layouts = ime.layouts; |
155 result.push_back( | 162 result.push_back( |
156 input_method::InputMethodDescriptor( | 163 input_method::InputMethodDescriptor( |
157 input_method_id, | 164 input_method_id, |
158 ime.display_name, | 165 ime.display_name, |
159 ime.indicator, | 166 ime.indicator, |
160 layouts, | 167 layouts, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( | 209 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( |
203 const std::vector<std::string>& layouts) { | 210 const std::vector<std::string>& layouts) { |
204 for (size_t i = 0; i < layouts.size(); ++i) { | 211 for (size_t i = 0; i < layouts.size(); ++i) { |
205 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) | 212 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) |
206 return true; | 213 return true; |
207 } | 214 } |
208 return false; | 215 return false; |
209 } | 216 } |
210 | 217 |
211 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |