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_COMPONENT_EXTENSION_IME_MANAGER_H_ | 5 #ifndef UI_BASE_IME_CHROMEOS_COMPONENT_EXTENSION_IME_MANAGER_H_ |
6 #define UI_BASE_IME_CHROMEOS_COMPONENT_EXTENSION_IME_MANAGER_H_ | 6 #define UI_BASE_IME_CHROMEOS_COMPONENT_EXTENSION_IME_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // method. | 97 // method. |
98 bool IsWhitelisted(const std::string& input_method_id); | 98 bool IsWhitelisted(const std::string& input_method_id); |
99 | 99 |
100 // Returns true if |extension_id| is whitelisted component extension. | 100 // Returns true if |extension_id| is whitelisted component extension. |
101 bool IsWhitelistedExtension(const std::string& extension_id); | 101 bool IsWhitelistedExtension(const std::string& extension_id); |
102 | 102 |
103 // Returns all IME as InputMethodDescriptors. | 103 // Returns all IME as InputMethodDescriptors. |
104 input_method::InputMethodDescriptors GetAllIMEAsInputMethodDescriptor(); | 104 input_method::InputMethodDescriptors GetAllIMEAsInputMethodDescriptor(); |
105 | 105 |
106 // Returns all XKB keyboard IME as InputMethodDescriptors. | 106 // Returns all XKB keyboard IME as InputMethodDescriptors. |
107 input_method::InputMethodDescriptors GetXkbIMEAsInputMethodDescriptor(); | 107 virtual input_method::InputMethodDescriptors |
| 108 GetXkbIMEAsInputMethodDescriptor(); |
108 | 109 |
109 private: | 110 private: |
110 // Finds ComponentExtensionIME and EngineDescription associated with | 111 // Finds ComponentExtensionIME and EngineDescription associated with |
111 // |input_method_id|. This function retruns true if it is found, otherwise | 112 // |input_method_id|. This function retruns true if it is found, otherwise |
112 // returns false. |out_extension| and |out_engine| can be NULL. | 113 // returns false. |out_extension| and |out_engine| can be NULL. |
113 bool FindEngineEntry(const std::string& input_method_id, | 114 bool FindEngineEntry(const std::string& input_method_id, |
114 ComponentExtensionIME* out_extension); | 115 ComponentExtensionIME* out_extension); |
115 | 116 |
116 bool IsInLoginLayoutWhitelist(const std::vector<std::string>& layouts); | 117 bool IsInLoginLayoutWhitelist(const std::vector<std::string>& layouts); |
117 | 118 |
118 std::unique_ptr<ComponentExtensionIMEManagerDelegate> delegate_; | 119 std::unique_ptr<ComponentExtensionIMEManagerDelegate> delegate_; |
119 | 120 |
120 // The map of extension_id to ComponentExtensionIME instance. | 121 // The map of extension_id to ComponentExtensionIME instance. |
121 // It's filled by Initialize() method and never changed during runtime. | 122 // It's filled by Initialize() method and never changed during runtime. |
122 std::map<std::string, ComponentExtensionIME> component_extension_imes_; | 123 std::map<std::string, ComponentExtensionIME> component_extension_imes_; |
123 | 124 |
124 // For quick check the validity of a given input method id. | 125 // For quick check the validity of a given input method id. |
125 // It's filled by Initialize() method and never changed during runtime. | 126 // It's filled by Initialize() method and never changed during runtime. |
126 std::set<std::string> input_method_id_set_; | 127 std::set<std::string> input_method_id_set_; |
127 | 128 |
128 std::set<std::string> login_layout_set_; | 129 std::set<std::string> login_layout_set_; |
129 | 130 |
130 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManager); | 131 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManager); |
131 }; | 132 }; |
132 | 133 |
133 } // namespace chromeos | 134 } // namespace chromeos |
134 | 135 |
135 #endif // UI_BASE_IME_CHROMEOS_COMPONENT_EXTENSION_IME_MANAGER_H_ | 136 #endif // UI_BASE_IME_CHROMEOS_COMPONENT_EXTENSION_IME_MANAGER_H_ |
OLD | NEW |