OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_XKEYBOARD_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_XKEYBOARD_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_XKEYBOARD_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_XKEYBOARD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // and "gb(extd)". Returns an empty string on error. This function is | 134 // and "gb(extd)". Returns an empty string on error. This function is |
135 // protected: for testability. | 135 // protected: for testability. |
136 std::string CreateFullXkbLayoutName(const std::string& layout_name, | 136 std::string CreateFullXkbLayoutName(const std::string& layout_name, |
137 const ModifierMap& modifire_map); | 137 const ModifierMap& modifire_map); |
138 | 138 |
139 // Returns true if |key| is in |modifier_map| as replacement. This function is | 139 // Returns true if |key| is in |modifier_map| as replacement. This function is |
140 // protected: for testability. | 140 // protected: for testability. |
141 static bool ContainsModifierKeyAsReplacement(const ModifierMap& modifier_map, | 141 static bool ContainsModifierKeyAsReplacement(const ModifierMap& modifier_map, |
142 ModifierKey key); | 142 ModifierKey key); |
143 | 143 |
| 144 // THIS FUNCTION IS ONLY FOR UNIT TESTS. |
| 145 // Returns true if auto repeat is enabled. This function is protected: for |
| 146 // testability. |
| 147 static bool GetAutoRepeatEnabled(); |
| 148 |
| 149 // THIS FUNCTION IS ONLY FOR UNIT TESTS. |
| 150 // On success, set current auto repeat rate on |out_rate| and returns true. |
| 151 // Returns false otherwise. This function is protected: for testability. |
| 152 static bool GetAutoRepeatRate(AutoRepeatRate* out_rate); |
| 153 |
144 private: | 154 private: |
145 // This function is used by SetLayout() and RemapModifierKeys(). Calls | 155 // This function is used by SetLayout() and RemapModifierKeys(). Calls |
146 // setxkbmap command if needed, and updates the last_full_layout_name_ cache. | 156 // setxkbmap command if needed, and updates the last_full_layout_name_ cache. |
147 bool SetLayoutInternal(const std::string& layout_name, | 157 bool SetLayoutInternal(const std::string& layout_name, |
148 const ModifierMap& modifier_map, | 158 const ModifierMap& modifier_map, |
149 bool force); | 159 bool force); |
150 | 160 |
151 // Executes 'setxkbmap -layout ...' command asynchronously using a layout name | 161 // Executes 'setxkbmap -layout ...' command asynchronously using a layout name |
152 // in the |execute_queue_|. Do nothing if the queue is empty. | 162 // in the |execute_queue_|. Do nothing if the queue is empty. |
153 // TODO(yusukes): Use libxkbfile.so instead of the command (crosbug.com/13105) | 163 // TODO(yusukes): Use libxkbfile.so instead of the command (crosbug.com/13105) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 std::set<std::string> keep_right_alt_xkb_layout_names_; | 196 std::set<std::string> keep_right_alt_xkb_layout_names_; |
187 std::set<std::string> caps_lock_remapped_xkb_layout_names_; | 197 std::set<std::string> caps_lock_remapped_xkb_layout_names_; |
188 | 198 |
189 DISALLOW_COPY_AND_ASSIGN(XKeyboard); | 199 DISALLOW_COPY_AND_ASSIGN(XKeyboard); |
190 }; | 200 }; |
191 | 201 |
192 } // namespace input_method | 202 } // namespace input_method |
193 } // namespace chromeos | 203 } // namespace chromeos |
194 | 204 |
195 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_XKEYBOARD_H_ | 205 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_XKEYBOARD_H_ |
OLD | NEW |