OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
7 | 7 |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/flat_map.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
18 #include "ui/base/ime/chromeos/input_method_descriptor.h" | 18 #include "ui/base/ime/chromeos/input_method_descriptor.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 namespace input_method { | 21 namespace input_method { |
22 | 22 |
23 class InputMethodDelegate; | 23 class InputMethodDelegate; |
24 | 24 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // name (e.g. 'US' instead of 'US keyboard'). | 198 // name (e.g. 'US' instead of 'US keyboard'). |
199 base::string16 GetInputMethodLongNameInternal( | 199 base::string16 GetInputMethodLongNameInternal( |
200 const InputMethodDescriptor& input_method, bool short_name) const; | 200 const InputMethodDescriptor& input_method, bool short_name) const; |
201 | 201 |
202 // Map from language code to associated input method IDs, etc. | 202 // Map from language code to associated input method IDs, etc. |
203 typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; | 203 typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; |
204 | 204 |
205 LanguageCodeToIdsMap language_code_to_ids_; | 205 LanguageCodeToIdsMap language_code_to_ids_; |
206 InputMethodIdToDescriptorMap id_to_descriptor_; | 206 InputMethodIdToDescriptorMap id_to_descriptor_; |
207 | 207 |
208 typedef base::hash_map<std::string, int> HashType; | 208 using EnglishToIDMap = base::flat_map<std::string, int>; |
209 HashType english_to_resource_id_; | 209 EnglishToIDMap english_to_resource_id_; |
210 | 210 |
211 InputMethodDelegate* delegate_; | 211 InputMethodDelegate* delegate_; |
212 | 212 |
213 base::ThreadChecker thread_checker_; | 213 base::ThreadChecker thread_checker_; |
214 std::vector<std::string> hardware_layouts_; | 214 std::vector<std::string> hardware_layouts_; |
215 std::vector<std::string> hardware_login_layouts_; | 215 std::vector<std::string> hardware_login_layouts_; |
216 std::vector<std::string> cached_hardware_layouts_; | 216 std::vector<std::string> cached_hardware_layouts_; |
217 | 217 |
218 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); | 218 DISALLOW_COPY_AND_ASSIGN(InputMethodUtil); |
219 }; | 219 }; |
220 | 220 |
221 } // namespace input_method | 221 } // namespace input_method |
222 } // namespace chromeos | 222 } // namespace chromeos |
223 | 223 |
224 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ | 224 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_UTIL_H_ |
OLD | NEW |