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 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ | 5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ |
6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ | 6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <set> | 9 #include <set> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "ui/base/ime/ui_base_ime_export.h" | 14 #include "ui/base/ime/ui_base_ime_export.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 namespace input_method { | 17 namespace input_method { |
18 | 18 |
19 class InputMethodDescriptor; | 19 class InputMethodDescriptor; |
20 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; | 20 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
21 | 21 |
22 // A class which has white listed input method list. The list is generated by | 22 // A class which has white listed input method list. The list is generated by |
23 // gen_input_methods.py from input_methods.txt. | 23 // gen_input_methods.py from input_methods.txt. |
24 class UI_BASE_IME_EXPORT InputMethodWhitelist { | 24 class UI_BASE_IME_EXPORT InputMethodWhitelist { |
25 public: | 25 public: |
26 InputMethodWhitelist(); | 26 InputMethodWhitelist(); |
27 ~InputMethodWhitelist(); | 27 ~InputMethodWhitelist(); |
28 | 28 |
29 // Returns true if |input_method_id| is whitelisted. | 29 // Returns true if |input_method_id| is whitelisted. |
30 bool InputMethodIdIsWhitelisted(const std::string& input_method_id) const; | 30 bool InputMethodIdIsWhitelisted(const std::string& input_method_id) const; |
31 | 31 |
32 // Returns all input methods that are supported, including ones not active. | 32 // Returns all input methods that are supported, including ones not active. |
33 // This function never returns NULL. Note that input method extensions are not | 33 // This function never returns NULL. Note that input method extensions are not |
34 // included in the result. | 34 // included in the result. |
35 scoped_ptr<InputMethodDescriptors> GetSupportedInputMethods() const; | 35 std::unique_ptr<InputMethodDescriptors> GetSupportedInputMethods() const; |
36 | 36 |
37 private: | 37 private: |
38 std::set<std::string> supported_input_methods_; | 38 std::set<std::string> supported_input_methods_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(InputMethodWhitelist); | 40 DISALLOW_COPY_AND_ASSIGN(InputMethodWhitelist); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace input_method | 43 } // namespace input_method |
44 } // namespace chromeos | 44 } // namespace chromeos |
45 | 45 |
46 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ | 46 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_WHITELIST_H_ |
OLD | NEW |