OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ | 5 #ifndef UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ |
6 #define UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ | 6 #define UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Overridden from EventFilter: | 34 // Overridden from EventFilter: |
35 virtual bool PreHandleKeyEvent(aura::Window* target, | 35 virtual bool PreHandleKeyEvent(aura::Window* target, |
36 aura::KeyEvent* event) OVERRIDE; | 36 aura::KeyEvent* event) OVERRIDE; |
37 virtual bool PreHandleMouseEvent(aura::Window* target, | 37 virtual bool PreHandleMouseEvent(aura::Window* target, |
38 aura::MouseEvent* event) OVERRIDE; | 38 aura::MouseEvent* event) OVERRIDE; |
39 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, | 39 virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target, |
40 aura::TouchEvent* event) OVERRIDE; | 40 aura::TouchEvent* event) OVERRIDE; |
41 | 41 |
42 private: | 42 private: |
43 // If necessary, activates |window| and changes focus. | |
44 void ActivateIfNecessary(aura::Window* window, aura::Event* event); | |
45 | |
46 // Updates the cursor if the target provides a custom one, and provides | 43 // Updates the cursor if the target provides a custom one, and provides |
47 // default resize cursors for window edges. | 44 // default resize cursors for window edges. |
48 void UpdateCursor(aura::Window* target, aura::MouseEvent* event); | 45 void UpdateCursor(aura::Window* target, aura::MouseEvent* event); |
49 | 46 |
50 // Dispatches event to addtional filters. Returns false or | 47 // Dispatches event to additional filters. Returns false or |
51 // ui::TOUCH_STATUS_UNKNOWN if event is consumed. | 48 // ui::TOUCH_STATUS_UNKNOWN if event is consumed. |
52 bool FilterKeyEvent(aura::Window* target, aura::KeyEvent* event); | 49 bool FilterKeyEvent(aura::Window* target, aura::KeyEvent* event); |
53 bool FilterMouseEvent(aura::Window* target, aura::MouseEvent* event); | 50 bool FilterMouseEvent(aura::Window* target, aura::MouseEvent* event); |
54 ui::TouchStatus FilterTouchEvent(aura::Window* target, | 51 ui::TouchStatus FilterTouchEvent(aura::Window* target, |
55 aura::TouchEvent* event); | 52 aura::TouchEvent* event); |
56 | 53 |
57 // Additional event filters that pre-handles events. | 54 // Additional event filters that pre-handles events. |
58 ObserverList<aura::EventFilter, true> filters_; | 55 ObserverList<aura::EventFilter, true> filters_; |
59 | 56 |
60 DISALLOW_COPY_AND_ASSIGN(RootWindowEventFilter); | 57 DISALLOW_COPY_AND_ASSIGN(RootWindowEventFilter); |
61 }; | 58 }; |
62 | 59 |
63 } // namespace internal | 60 } // namespace internal |
64 } // namespace aura_shell | 61 } // namespace aura_shell |
65 | 62 |
66 #endif // UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ | 63 #endif // UI_AURA_SHELL_ROOT_WINDOW_EVENT_FILTER_H_ |
OLD | NEW |