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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "chrome/browser/chromeos/device_hierarchy_observer.h" | 16 #include "chrome/browser/chromeos/device_hierarchy_observer.h" |
17 #include "chromeos/ime/ime_keyboard.h" | 17 #include "chromeos/ime/ime_keyboard.h" |
18 #include "ui/events/keycodes/keyboard_codes.h" | 18 #include "ui/events/keycodes/keyboard_codes.h" |
19 #include "ui/events/platform/platform_event_observer.h" | 19 #include "ui/events/platform/platform_event_observer.h" |
20 | 20 |
21 class PrefService; | 21 class PrefService; |
22 typedef union _XEvent XEvent; | 22 typedef union _XEvent XEvent; |
23 | 23 |
24 namespace chromeos { | 24 namespace chromeos { |
25 class KeyboardDrivenEventRewriter; | |
26 namespace input_method { | 25 namespace input_method { |
27 class ImeKeyboard; | 26 class ImeKeyboard; |
28 } | 27 } |
29 | 28 |
30 class EventRewriter : public DeviceHierarchyObserver, | 29 class EventRewriter : public DeviceHierarchyObserver, |
31 public ui::PlatformEventObserver { | 30 public ui::PlatformEventObserver { |
32 public: | 31 public: |
33 enum DeviceType { | 32 enum DeviceType { |
34 kDeviceUnknown = 0, | 33 kDeviceUnknown = 0, |
35 kDeviceAppleKeyboard, | 34 kDeviceAppleKeyboard, |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 int last_device_id_; | 185 int last_device_id_; |
187 | 186 |
188 // A mapping from X11 KeySym keys to KeyCode values. | 187 // A mapping from X11 KeySym keys to KeyCode values. |
189 base::hash_map<unsigned long, unsigned long> keysym_to_keycode_map_; | 188 base::hash_map<unsigned long, unsigned long> keysym_to_keycode_map_; |
190 | 189 |
191 // A set of device IDs whose press event has been rewritten. | 190 // A set of device IDs whose press event has been rewritten. |
192 std::set<int> pressed_device_ids_; | 191 std::set<int> pressed_device_ids_; |
193 | 192 |
194 input_method::ImeKeyboard* keyboard_for_testing_; | 193 input_method::ImeKeyboard* keyboard_for_testing_; |
195 | 194 |
196 scoped_ptr<KeyboardDrivenEventRewriter> | |
197 keyboard_driven_event_rewriter_; | |
198 | |
199 const PrefService* pref_service_for_testing_; | 195 const PrefService* pref_service_for_testing_; |
200 | 196 |
201 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 197 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
202 }; | 198 }; |
203 | 199 |
204 } // namespace chromeos | 200 } // namespace chromeos |
205 | 201 |
206 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 202 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
OLD | NEW |