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