| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 xkeyboard_for_testing_ = xkeyboard; | 56 xkeyboard_for_testing_ = xkeyboard; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Gets DeviceType from the |device_name|. | 59 // Gets DeviceType from the |device_name|. |
| 60 static DeviceType GetDeviceType(const std::string& device_name); | 60 static DeviceType GetDeviceType(const std::string& device_name); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 friend class EventRewriterAshTest; | 63 friend class EventRewriterAshTest; |
| 64 friend class EventRewriterTest; | 64 friend class EventRewriterTest; |
| 65 | 65 |
| 66 void DeviceKeyPressedOrReleased(int device_id); |
| 67 |
| 66 // base::MessagePumpObserver overrides: | 68 // base::MessagePumpObserver overrides: |
| 67 virtual base::EventStatus WillProcessEvent( | 69 virtual base::EventStatus WillProcessEvent( |
| 68 const base::NativeEvent& event) OVERRIDE; | 70 const base::NativeEvent& event) OVERRIDE; |
| 69 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; | 71 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; |
| 70 | 72 |
| 71 // DeviceHierarchyObserver overrides: | 73 // DeviceHierarchyObserver overrides: |
| 72 virtual void DeviceHierarchyChanged() OVERRIDE {} | 74 virtual void DeviceHierarchyChanged() OVERRIDE; |
| 73 virtual void DeviceAdded(int device_id) OVERRIDE; | 75 virtual void DeviceAdded(int device_id) OVERRIDE; |
| 74 virtual void DeviceRemoved(int device_id) OVERRIDE; | 76 virtual void DeviceRemoved(int device_id) OVERRIDE; |
| 75 virtual void DeviceKeyPressedOrReleased(int device_id) OVERRIDE; | |
| 76 | 77 |
| 77 // We don't want to include Xlib.h here since it has polluting macros, so | 78 // We don't want to include Xlib.h here since it has polluting macros, so |
| 78 // define these locally. | 79 // define these locally. |
| 79 typedef unsigned long KeySym; | 80 typedef unsigned long KeySym; |
| 80 typedef unsigned char KeyCode; | 81 typedef unsigned char KeyCode; |
| 81 | 82 |
| 82 // Updates |*_xkeycode_| in response to a keyboard map change. | 83 // Updates |*_xkeycode_| in response to a keyboard map change. |
| 83 void RefreshKeycodes(); | 84 void RefreshKeycodes(); |
| 84 // Converts an X key symbol like XK_Control_L to a key code. | 85 // Converts an X key symbol like XK_Control_L to a key code. |
| 85 unsigned char NativeKeySymToNativeKeycode(KeySym keysym); | 86 unsigned char NativeKeySymToNativeKeycode(KeySym keysym); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 keyboard_driven_event_rewriter_; | 197 keyboard_driven_event_rewriter_; |
| 197 | 198 |
| 198 const PrefService* pref_service_for_testing_; | 199 const PrefService* pref_service_for_testing_; |
| 199 | 200 |
| 200 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 201 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
| 201 }; | 202 }; |
| 202 | 203 |
| 203 } // namespace chromeos | 204 } // namespace chromeos |
| 204 | 205 |
| 205 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 206 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
| OLD | NEW |