| 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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
| 16 #include "ui/events/event_rewriter.h" | 16 #include "ui/events/event_rewriter.h" |
| 17 #include "ui/events/keycodes/dom/dom_key.h" |
| 17 | 18 |
| 18 class PrefService; | 19 class PrefService; |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 class StickyKeysController; | 22 class StickyKeysController; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| 25 enum class DomCode; | 26 enum class DomCode; |
| 26 enum class DomKey; | |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 namespace chromeos { | 29 namespace chromeos { |
| 30 namespace input_method { | 30 namespace input_method { |
| 31 class ImeKeyboard; | 31 class ImeKeyboard; |
| 32 } | 32 } |
| 33 | 33 |
| 34 // EventRewriter makes various changes to keyboard-related events, | 34 // EventRewriter makes various changes to keyboard-related events, |
| 35 // including KeyEvents and some other events with keyboard modifier flags: | 35 // including KeyEvents and some other events with keyboard modifier flags: |
| 36 // - maps modifiers keys (Control, Alt, Search, Caps, Diamond) according | 36 // - maps modifiers keys (Control, Alt, Search, Caps, Diamond) according |
| (...skipping 10 matching lines...) Expand all Loading... |
| 47 kDeviceUnknown = 0, | 47 kDeviceUnknown = 0, |
| 48 kDeviceAppleKeyboard, | 48 kDeviceAppleKeyboard, |
| 49 kDeviceHotrodRemote, | 49 kDeviceHotrodRemote, |
| 50 kDeviceVirtualCoreKeyboard, // X-server generated events. | 50 kDeviceVirtualCoreKeyboard, // X-server generated events. |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 // Things that keyboard-related rewriter phases can change about an Event. | 53 // Things that keyboard-related rewriter phases can change about an Event. |
| 54 struct MutableKeyState { | 54 struct MutableKeyState { |
| 55 int flags; | 55 int flags; |
| 56 ui::DomCode code; | 56 ui::DomCode code; |
| 57 ui::DomKey key; | 57 ui::DomKey::Base key; |
| 58 base::char16 character; | |
| 59 ui::KeyboardCode key_code; | 58 ui::KeyboardCode key_code; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 // Does not take ownership of the |sticky_keys_controller|, which may also | 61 // Does not take ownership of the |sticky_keys_controller|, which may also |
| 63 // be NULL (for testing without ash), in which case sticky key operations | 62 // be NULL (for testing without ash), in which case sticky key operations |
| 64 // don't happen. | 63 // don't happen. |
| 65 explicit EventRewriter(ash::StickyKeysController* sticky_keys_controller); | 64 explicit EventRewriter(ash::StickyKeysController* sticky_keys_controller); |
| 66 ~EventRewriter() override; | 65 ~EventRewriter() override; |
| 67 | 66 |
| 68 // Calls KeyboardDeviceAddedInternal. | 67 // Calls KeyboardDeviceAddedInternal. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 int pressed_modifier_latches_; | 203 int pressed_modifier_latches_; |
| 205 int latched_modifier_latches_; | 204 int latched_modifier_latches_; |
| 206 int used_modifier_latches_; | 205 int used_modifier_latches_; |
| 207 | 206 |
| 208 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 207 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
| 209 }; | 208 }; |
| 210 | 209 |
| 211 } // namespace chromeos | 210 } // namespace chromeos |
| 212 | 211 |
| 213 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 212 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
| OLD | NEW |