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/wm/sticky_keys.h" | 5 #include "ash/wm/sticky_keys.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #undef RootWindow | 8 #undef RootWindow |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 StickyKeysHandlerDelegateImpl::StickyKeysHandlerDelegateImpl() { | 34 StickyKeysHandlerDelegateImpl::StickyKeysHandlerDelegateImpl() { |
35 } | 35 } |
36 | 36 |
37 StickyKeysHandlerDelegateImpl::~StickyKeysHandlerDelegateImpl() { | 37 StickyKeysHandlerDelegateImpl::~StickyKeysHandlerDelegateImpl() { |
38 } | 38 } |
39 | 39 |
40 void StickyKeysHandlerDelegateImpl::DispatchKeyEvent(ui::KeyEvent* event, | 40 void StickyKeysHandlerDelegateImpl::DispatchKeyEvent(ui::KeyEvent* event, |
41 aura::Window* target) { | 41 aura::Window* target) { |
42 DCHECK(target); | 42 DCHECK(target); |
43 target->GetRootWindow()->AsRootWindowHostDelegate()->OnHostKeyEvent(event); | 43 target->GetDispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent(event); |
44 } | 44 } |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 /////////////////////////////////////////////////////////////////////////////// | 48 /////////////////////////////////////////////////////////////////////////////// |
49 // StickyKeys | 49 // StickyKeys |
50 StickyKeys::StickyKeys() | 50 StickyKeys::StickyKeys() |
51 : shift_sticky_key_( | 51 : shift_sticky_key_( |
52 new StickyKeysHandler(ui::EF_SHIFT_DOWN, | 52 new StickyKeysHandler(ui::EF_SHIFT_DOWN, |
53 new StickyKeysHandlerDelegateImpl())), | 53 new StickyKeysHandlerDelegateImpl())), |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 default: | 223 default: |
224 NOTREACHED(); | 224 NOTREACHED(); |
225 } | 225 } |
226 event->set_flags(event->flags() | modifier_flag_); | 226 event->set_flags(event->flags() | modifier_flag_); |
227 event->set_character(ui::GetCharacterFromKeyCode(event->key_code(), | 227 event->set_character(ui::GetCharacterFromKeyCode(event->key_code(), |
228 event->flags())); | 228 event->flags())); |
229 event->NormalizeFlags(); | 229 event->NormalizeFlags(); |
230 } | 230 } |
231 | 231 |
232 } // namespace ash | 232 } // namespace ash |
OLD | NEW |