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_WHITELIST_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_WHITELIST_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_WHITELIST_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_WHITELIST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 namespace input_method { | 16 namespace input_method { |
17 | 17 |
18 class InputMethodDescriptor; | 18 class InputMethodDescriptor; |
19 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; | 19 typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
20 | 20 |
21 // | 21 // |
22 class InputMethodWhitelist { | 22 class InputMethodWhitelist { |
23 public: | 23 public: |
24 InputMethodWhitelist(); | 24 InputMethodWhitelist(); |
25 ~InputMethodWhitelist(); | 25 ~InputMethodWhitelist(); |
26 | 26 |
27 // Returns true if |input_method_id| is whitelisted. | 27 // Returns true if |input_method_id| is whitelisted. |
28 bool InputMethodIdIsWhitelisted(const std::string& input_method_id) const; | 28 bool InputMethodIdIsWhitelisted(const std::string& input_method_id) const; |
29 // Returns true if |xkb_layout| is supported. | |
30 bool XkbLayoutIsSupported(const std::string& xkb_layout) const; | |
31 | 29 |
32 // Returns all input methods that are supported, including ones not active. | 30 // Returns all input methods that are supported, including ones not active. |
33 // Caller has to delete the returned list. This function never returns NULL. | 31 // Caller has to delete the returned list. This function never returns NULL. |
34 // Note that input method extensions are not included in the result. | 32 // Note that input method extensions are not included in the result. |
35 InputMethodDescriptors* GetSupportedInputMethods() const; | 33 InputMethodDescriptors* GetSupportedInputMethods() const; |
36 | 34 |
37 private: | 35 private: |
38 std::set<std::string> supported_input_methods_; | 36 std::set<std::string> supported_input_methods_; |
39 std::set<std::string> supported_layouts_; | |
40 | 37 |
41 DISALLOW_COPY_AND_ASSIGN(InputMethodWhitelist); | 38 DISALLOW_COPY_AND_ASSIGN(InputMethodWhitelist); |
42 }; | 39 }; |
43 | 40 |
44 } // namespace input_method | 41 } // namespace input_method |
45 } // namespace chromeos | 42 } // namespace chromeos |
46 | 43 |
47 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_WHITELIST_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_WHITELIST_H_ |
OLD | NEW |