| 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 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 for (size_t j = 0; j < ext.engines.size(); ++j) { | 147 for (size_t j = 0; j < ext.engines.size(); ++j) { |
| 148 const ComponentExtensionEngine& ime = ext.engines[j]; | 148 const ComponentExtensionEngine& ime = ext.engines[j]; |
| 149 const std::string input_method_id = | 149 const std::string input_method_id = |
| 150 extension_ime_util::GetComponentInputMethodID( | 150 extension_ime_util::GetComponentInputMethodID( |
| 151 ext.id, ime.engine_id); | 151 ext.id, ime.engine_id); |
| 152 const std::vector<std::string>& layouts = ime.layouts; | 152 const std::vector<std::string>& layouts = ime.layouts; |
| 153 result.push_back( | 153 result.push_back( |
| 154 input_method::InputMethodDescriptor( | 154 input_method::InputMethodDescriptor( |
| 155 input_method_id, | 155 input_method_id, |
| 156 ime.display_name, | 156 ime.display_name, |
| 157 std::string(), // TODO(uekawa): Set short name. | 157 ime.indicator, |
| 158 layouts, | 158 layouts, |
| 159 ime.language_codes, | 159 ime.language_codes, |
| 160 // Enables extension based xkb keyboards on login screen. | 160 // Enables extension based xkb keyboards on login screen. |
| 161 extension_ime_util::IsKeyboardLayoutExtension( | 161 extension_ime_util::IsKeyboardLayoutExtension( |
| 162 input_method_id) && IsInLoginLayoutWhitelist(layouts), | 162 input_method_id) && IsInLoginLayoutWhitelist(layouts), |
| 163 ime.options_page_url, | 163 ime.options_page_url, |
| 164 ime.input_view_url)); | 164 ime.input_view_url)); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 return result; | 167 return result; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( | 200 bool ComponentExtensionIMEManager::IsInLoginLayoutWhitelist( |
| 201 const std::vector<std::string>& layouts) { | 201 const std::vector<std::string>& layouts) { |
| 202 for (size_t i = 0; i < layouts.size(); ++i) { | 202 for (size_t i = 0; i < layouts.size(); ++i) { |
| 203 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) | 203 if (login_layout_set_.find(layouts[i]) != login_layout_set_.end()) |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| 206 return false; | 206 return false; |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace chromeos | 209 } // namespace chromeos |
| OLD | NEW |