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 "ui/base/ime/chromeos/component_extension_ime_manager.h" | 5 #include "ui/base/ime/chromeos/component_extension_ime_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 bool ComponentExtensionIMEManager::IsWhitelistedExtension( | 159 bool ComponentExtensionIMEManager::IsWhitelistedExtension( |
160 const std::string& extension_id) { | 160 const std::string& extension_id) { |
161 return component_extension_imes_.find(extension_id) != | 161 return component_extension_imes_.find(extension_id) != |
162 component_extension_imes_.end(); | 162 component_extension_imes_.end(); |
163 } | 163 } |
164 | 164 |
165 input_method::InputMethodDescriptors | 165 input_method::InputMethodDescriptors |
166 ComponentExtensionIMEManager::GetAllIMEAsInputMethodDescriptor() { | 166 ComponentExtensionIMEManager::GetAllIMEAsInputMethodDescriptor() { |
167 bool enable_new_korean_ime = CommandLine::ForCurrentProcess()->HasSwitch( | 167 bool enable_new_korean_ime = |
168 switches::kEnableNewKoreanIme); | 168 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 169 switches::kEnableNewKoreanIme); |
169 input_method::InputMethodDescriptors result; | 170 input_method::InputMethodDescriptors result; |
170 for (std::map<std::string, ComponentExtensionIME>::const_iterator it = | 171 for (std::map<std::string, ComponentExtensionIME>::const_iterator it = |
171 component_extension_imes_.begin(); | 172 component_extension_imes_.begin(); |
172 it != component_extension_imes_.end(); ++it) { | 173 it != component_extension_imes_.end(); ++it) { |
173 const ComponentExtensionIME& ext = it->second; | 174 const ComponentExtensionIME& ext = it->second; |
174 for (size_t j = 0; j < ext.engines.size(); ++j) { | 175 for (size_t j = 0; j < ext.engines.size(); ++j) { |
175 const ComponentExtensionEngine& ime = ext.engines[j]; | 176 const ComponentExtensionEngine& ime = ext.engines[j]; |
176 // Filter out new Korean IME if the experimental flag is OFF. | 177 // Filter out new Korean IME if the experimental flag is OFF. |
177 if (!enable_new_korean_ime && ime.engine_id == "ko-t-i0-und") | 178 if (!enable_new_korean_ime && ime.engine_id == "ko-t-i0-und") |
178 continue; | 179 continue; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( | 232 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( |
232 const std::vector<std::string>& layouts) { | 233 const std::vector<std::string>& layouts) { |
233 for (size_t i = 0; i < layouts.size(); ++i) { | 234 for (size_t i = 0; i < layouts.size(); ++i) { |
234 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) | 235 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) |
235 return true; | 236 return true; |
236 } | 237 } |
237 return false; | 238 return false; |
238 } | 239 } |
239 | 240 |
240 } // namespace chromeos | 241 } // namespace chromeos |
OLD | NEW |