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 #include "ash/sticky_keys/sticky_keys_controller.h" | 5 #include "ash/sticky_keys/sticky_keys_controller.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #undef RootWindow | 10 #undef RootWindow |
11 #endif | 11 #endif |
12 | 12 |
13 #include "ash/sticky_keys/sticky_keys_overlay.h" | 13 #include "ash/sticky_keys/sticky_keys_overlay.h" |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/debug/stack_trace.h" | 15 #include "base/debug/stack_trace.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 #include "ui/aura/window_event_dispatcher.h" | |
18 #include "ui/aura/window_tracker.h" | 17 #include "ui/aura/window_tracker.h" |
| 18 #include "ui/aura/window_tree_host.h" |
19 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
| 20 #include "ui/events/event_processor.h" |
20 #include "ui/events/keycodes/keyboard_code_conversion.h" | 21 #include "ui/events/keycodes/keyboard_code_conversion.h" |
21 | 22 |
22 namespace ash { | 23 namespace ash { |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 // Returns true if the type of mouse event should be modified by sticky keys. | 27 // Returns true if the type of mouse event should be modified by sticky keys. |
27 bool ShouldModifyMouseEvent(ui::MouseEvent* event) { | 28 bool ShouldModifyMouseEvent(ui::MouseEvent* event) { |
28 ui::EventType type = event->type(); | 29 ui::EventType type = event->type(); |
29 return type == ui::ET_MOUSE_PRESSED || type == ui::ET_MOUSE_RELEASED || | 30 return type == ui::ET_MOUSE_PRESSED || type == ui::ET_MOUSE_RELEASED || |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void StickyKeysHandlerDelegateImpl::DispatchScrollEvent( | 80 void StickyKeysHandlerDelegateImpl::DispatchScrollEvent( |
80 ui::ScrollEvent* event, | 81 ui::ScrollEvent* event, |
81 aura::Window* target) { | 82 aura::Window* target) { |
82 DispatchEvent(event, target); | 83 DispatchEvent(event, target); |
83 } | 84 } |
84 | 85 |
85 void StickyKeysHandlerDelegateImpl::DispatchEvent(ui::Event* event, | 86 void StickyKeysHandlerDelegateImpl::DispatchEvent(ui::Event* event, |
86 aura::Window* target) { | 87 aura::Window* target) { |
87 DCHECK(target); | 88 DCHECK(target); |
88 ui::EventDispatchDetails details = | 89 ui::EventDispatchDetails details = |
89 target->GetHost()->dispatcher()->OnEventFromSource(event); | 90 target->GetHost()->event_processor()->OnEventFromSource(event); |
90 if (details.dispatcher_destroyed) | 91 if (details.dispatcher_destroyed) |
91 return; | 92 return; |
92 } | 93 } |
93 | 94 |
94 } // namespace | 95 } // namespace |
95 | 96 |
96 /////////////////////////////////////////////////////////////////////////////// | 97 /////////////////////////////////////////////////////////////////////////////// |
97 // StickyKeys | 98 // StickyKeys |
98 StickyKeysController::StickyKeysController() | 99 StickyKeysController::StickyKeysController() |
99 : enabled_(false) { | 100 : enabled_(false) { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 &xievent->mods.effective)); | 508 &xievent->mods.effective)); |
508 } | 509 } |
509 } | 510 } |
510 #elif defined(USE_OZONE) | 511 #elif defined(USE_OZONE) |
511 NOTIMPLEMENTED() << "Modifier key is not handled"; | 512 NOTIMPLEMENTED() << "Modifier key is not handled"; |
512 #endif | 513 #endif |
513 event->set_flags(event->flags() | modifier_flag_); | 514 event->set_flags(event->flags() | modifier_flag_); |
514 } | 515 } |
515 | 516 |
516 } // namespace ash | 517 } // namespace ash |
OLD | NEW |