OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/window_cycle_event_filter_aura.h" | 5 #include "ash/wm/window_cycle_event_filter_aura.h" |
6 | 6 |
7 #include "ash/accelerators/debug_commands.h" | 7 #include "ash/accelerators/debug_commands.h" |
| 8 #include "ash/common/wm_shell.h" |
8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
9 #include "ash/wm/window_cycle_controller.h" | 10 #include "ash/wm/window_cycle_controller.h" |
10 #include "ash/wm/window_cycle_list.h" | 11 #include "ash/wm/window_cycle_list.h" |
11 #include "ash/wm_shell.h" | |
12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 WindowCycleEventFilterAura::WindowCycleEventFilterAura() { | 16 WindowCycleEventFilterAura::WindowCycleEventFilterAura() { |
17 Shell::GetInstance()->AddPreTargetHandler(this); | 17 Shell::GetInstance()->AddPreTargetHandler(this); |
18 // Handling release of "Alt" must come before other pretarget handlers | 18 // Handling release of "Alt" must come before other pretarget handlers |
19 // (specifically, the partial screenshot handler). See crbug.com/651939 | 19 // (specifically, the partial screenshot handler). See crbug.com/651939 |
20 // We can't do all key event handling that early though because it prevents | 20 // We can't do all key event handling that early though because it prevents |
21 // other accelerators (like triggering a partial screenshot) from working. | 21 // other accelerators (like triggering a partial screenshot) from working. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ui::KeyEvent* event) { | 72 ui::KeyEvent* event) { |
73 // Views uses VKEY_MENU for both left and right Alt keys. | 73 // Views uses VKEY_MENU for both left and right Alt keys. |
74 if (event->key_code() == ui::VKEY_MENU && | 74 if (event->key_code() == ui::VKEY_MENU && |
75 event->type() == ui::ET_KEY_RELEASED) { | 75 event->type() == ui::ET_KEY_RELEASED) { |
76 WmShell::Get()->window_cycle_controller()->CompleteCycling(); | 76 WmShell::Get()->window_cycle_controller()->CompleteCycling(); |
77 // Warning: |this| will be deleted from here on. | 77 // Warning: |this| will be deleted from here on. |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 } // namespace ash | 81 } // namespace ash |
OLD | NEW |