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 CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace ui { | 10 typedef union _XEvent XEvent; |
11 class KeyEvent; | |
12 } | |
13 | 11 |
14 namespace chromeos { | 12 namespace chromeos { |
15 | 13 |
16 // KeyboardDrivenEventRewriter removes the modifier flags from | 14 // KeyboardDrivenEventRewriter removes the modifier flags from |
17 // Shift+<Arrow keys|Enter|F6> key events. This mapping only happens | 15 // Shift+<Arrow keys|Enter|F6> key events. This mapping only happens |
18 // on login screen and only when the keyboard driven oobe is enabled. | 16 // on login screen and only when the keyboard driven oobe is enabled. |
19 class KeyboardDrivenEventRewriter { | 17 class KeyboardDrivenEventRewriter { |
20 public: | 18 public: |
21 KeyboardDrivenEventRewriter(); | 19 KeyboardDrivenEventRewriter(); |
22 ~KeyboardDrivenEventRewriter(); | 20 ~KeyboardDrivenEventRewriter(); |
23 | 21 |
24 // Calls RewriteEvent to modify |event| if it is on login screen and the | 22 // Calls RewriteEvent to modify |event| if it is on login screen and the |
25 // keyboard driven flag is enabled. Returns true if the event is changed | 23 // keyboard driven flag is enabled. Returns true if the event is changed |
26 // and no further changes should happen. | 24 // and no further changes should happen. |
27 bool RewriteIfKeyboardDrivenOnLoginScreen(ui::KeyEvent* event); | 25 bool RewriteIfKeyboardDrivenOnLoginScreen(XEvent* event); |
28 | 26 |
29 // Calls RewriteEvent for testing. | 27 // Calls RewriteEvent for testing. |
30 bool RewriteForTesting(ui::KeyEvent* event); | 28 bool RewriteForTesting(XEvent* event); |
31 | 29 |
32 private: | 30 private: |
33 bool RewriteEvent(ui::KeyEvent* event); | 31 bool RewriteEvent(XEvent* event); |
34 | 32 |
35 DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenEventRewriter); | 33 DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenEventRewriter); |
36 }; | 34 }; |
37 | 35 |
38 } // namespace chromeos | 36 } // namespace chromeos |
39 | 37 |
40 #endif // CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ | 38 #endif // CHROME_BROWSER_CHROMEOS_KEYBOARD_DRIVEN_EVENT_REWRITER_H_ |
OLD | NEW |