OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EVENTS_EVENT_REWRITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 | 140 |
141 // Given a set of KeyboardRemapping structs, it finds a matching struct | 141 // Given a set of KeyboardRemapping structs, it finds a matching struct |
142 // if possible, and updates the remapped event values. Returns true if a | 142 // if possible, and updates the remapped event values. Returns true if a |
143 // remapping was found and remapped values were updated. | 143 // remapping was found and remapped values were updated. |
144 bool RewriteWithKeyboardRemappingsByKeyCode( | 144 bool RewriteWithKeyboardRemappingsByKeyCode( |
145 const KeyboardRemapping* remappings, | 145 const KeyboardRemapping* remappings, |
146 size_t num_remappings, | 146 size_t num_remappings, |
147 const MutableKeyState& input, | 147 const MutableKeyState& input, |
148 MutableKeyState* remapped_state); | 148 MutableKeyState* remapped_state); |
149 | 149 |
150 // Rewrite a particular kind of event. | |
kpschoedel
2014/05/12 21:58:03
Split these out of |RewriteEvent()| as in the stic
| |
151 ui::EventRewriteStatus RewriteKeyEvent( | |
152 const ui::KeyEvent& key_event, | |
153 scoped_ptr<ui::Event>* rewritten_event); | |
154 ui::EventRewriteStatus RewriteMouseEvent( | |
155 const ui::MouseEvent& mouse_event, | |
156 scoped_ptr<ui::Event>* rewritten_event); | |
157 ui::EventRewriteStatus RewriteTouchEvent( | |
158 const ui::TouchEvent& touch_event, | |
159 scoped_ptr<ui::Event>* rewritten_event); | |
160 | |
150 // Rewriter phases. These can inspect the original |event|, but operate using | 161 // Rewriter phases. These can inspect the original |event|, but operate using |
151 // the current |state|, which may have been modified by previous phases. | 162 // the current |state|, which may have been modified by previous phases. |
152 void RewriteModifierKeys(const ui::KeyEvent& event, MutableKeyState* state); | 163 void RewriteModifierKeys(const ui::KeyEvent& event, MutableKeyState* state); |
153 void RewriteNumPadKeys(const ui::KeyEvent& event, MutableKeyState* state); | 164 void RewriteNumPadKeys(const ui::KeyEvent& event, MutableKeyState* state); |
154 void RewriteExtendedKeys(const ui::KeyEvent& event, MutableKeyState* state); | 165 void RewriteExtendedKeys(const ui::KeyEvent& event, MutableKeyState* state); |
155 void RewriteFunctionKeys(const ui::KeyEvent& event, MutableKeyState* state); | 166 void RewriteFunctionKeys(const ui::KeyEvent& event, MutableKeyState* state); |
156 void RewriteLocatedEvent(const ui::Event& event, MutableKeyState* state); | 167 void RewriteLocatedEvent(const ui::Event& event, int* flags); |
157 | 168 |
158 // A set of device IDs whose press event has been rewritten. | 169 // A set of device IDs whose press event has been rewritten. |
159 std::set<int> pressed_device_ids_; | 170 std::set<int> pressed_device_ids_; |
160 | 171 |
161 std::map<int, DeviceType> device_id_to_type_; | 172 std::map<int, DeviceType> device_id_to_type_; |
162 int last_device_id_; | 173 int last_device_id_; |
163 | 174 |
164 chromeos::input_method::ImeKeyboard* ime_keyboard_for_testing_; | 175 chromeos::input_method::ImeKeyboard* ime_keyboard_for_testing_; |
165 const PrefService* pref_service_for_testing_; | 176 const PrefService* pref_service_for_testing_; |
166 | 177 |
167 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 178 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
168 }; | 179 }; |
169 | 180 |
170 } // namespace chromeos | 181 } // namespace chromeos |
171 | 182 |
172 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 183 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
OLD | NEW |