OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_controller.h" | 5 #include "ash/wm/window_cycle_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/wm/window_cycle_list.h" | 9 #include "ash/wm/window_cycle_list.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, | 29 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, |
30 aura::TouchEvent* event) OVERRIDE; | 30 aura::TouchEvent* event) OVERRIDE; |
31 virtual ui::GestureStatus PreHandleGestureEvent( | 31 virtual ui::GestureStatus PreHandleGestureEvent( |
32 aura::Window* target, | 32 aura::Window* target, |
33 aura::GestureEvent* event) OVERRIDE; | 33 aura::GestureEvent* event) OVERRIDE; |
34 private: | 34 private: |
35 DISALLOW_COPY_AND_ASSIGN(WindowCycleEventFilter); | 35 DISALLOW_COPY_AND_ASSIGN(WindowCycleEventFilter); |
36 }; | 36 }; |
37 | 37 |
38 // Watch for all keyboard events by filtering the root window. | 38 // Watch for all keyboard events by filtering the root window. |
39 WindowCycleEventFilter::WindowCycleEventFilter() | 39 WindowCycleEventFilter::WindowCycleEventFilter() { |
40 : aura::EventFilter(aura::RootWindow::GetInstance()) { | |
41 } | 40 } |
42 | 41 |
43 WindowCycleEventFilter::~WindowCycleEventFilter() { | 42 WindowCycleEventFilter::~WindowCycleEventFilter() { |
44 } | 43 } |
45 | 44 |
46 bool WindowCycleEventFilter::PreHandleKeyEvent( | 45 bool WindowCycleEventFilter::PreHandleKeyEvent( |
47 aura::Window* target, | 46 aura::Window* target, |
48 aura::KeyEvent* event) { | 47 aura::KeyEvent* event) { |
49 // Views uses VKEY_MENU for both left and right Alt keys. | 48 // Views uses VKEY_MENU for both left and right Alt keys. |
50 if (event->key_code() == ui::VKEY_MENU && | 49 if (event->key_code() == ui::VKEY_MENU && |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 event_filter_.reset(); | 145 event_filter_.reset(); |
147 } | 146 } |
148 } | 147 } |
149 | 148 |
150 void WindowCycleController::InstallEventFilter() { | 149 void WindowCycleController::InstallEventFilter() { |
151 event_filter_.reset(new WindowCycleEventFilter()); | 150 event_filter_.reset(new WindowCycleEventFilter()); |
152 Shell::GetInstance()->AddRootWindowEventFilter(event_filter_.get()); | 151 Shell::GetInstance()->AddRootWindowEventFilter(event_filter_.get()); |
153 } | 152 } |
154 | 153 |
155 } // namespace ash | 154 } // namespace ash |
OLD | NEW |