| 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_DESKTOP_EVENT_FILTER_H_ | 5 #ifndef UI_AURA_SHELL_DESKTOP_EVENT_FILTER_H_ |
| 6 #define UI_AURA_SHELL_DESKTOP_EVENT_FILTER_H_ | 6 #define UI_AURA_SHELL_DESKTOP_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/memory/scoped_ptr.h" |
| 10 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 11 #include "ui/aura/event_filter.h" | 12 #include "ui/aura/event_filter.h" |
| 12 #include "ui/aura_shell/aura_shell_export.h" | 13 #include "ui/aura_shell/aura_shell_export.h" |
| 13 | 14 |
| 14 namespace aura_shell { | 15 namespace aura_shell { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 18 class ShellAcceleratorFilter; |
| 19 |
| 17 // DesktopEventFilter gets all desktop events first and can provide actions to | 20 // DesktopEventFilter gets all desktop events first and can provide actions to |
| 18 // those events. It implements desktop features such as click to activate a | 21 // those events. It implements desktop features such as click to activate a |
| 19 // window and cursor change when moving mouse. | 22 // window and cursor change when moving mouse. |
| 20 // Additional event filters can be added to DesktopEventFilter. Events will | 23 // Additional event filters can be added to DesktopEventFilter. Events will |
| 21 // pass through those additional filters in their addition order and could be | 24 // pass through those additional filters in their addition order and could be |
| 22 // consumed by any of those filters. If an event is consumed by a filter, the | 25 // consumed by any of those filters. If an event is consumed by a filter, the |
| 23 // rest of the filter(s) and DesktopEventFilter will not see the consumed event. | 26 // rest of the filter(s) and DesktopEventFilter will not see the consumed event. |
| 24 class AURA_SHELL_EXPORT DesktopEventFilter : public aura::EventFilter { | 27 class AURA_SHELL_EXPORT DesktopEventFilter : public aura::EventFilter { |
| 25 public: | 28 public: |
| 26 DesktopEventFilter(); | 29 DesktopEventFilter(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 49 // Dispatches event to addtional filters. Returns false or | 52 // Dispatches event to addtional filters. Returns false or |
| 50 // ui::TOUCH_STATUS_UNKNOWN if event is consumed. | 53 // ui::TOUCH_STATUS_UNKNOWN if event is consumed. |
| 51 bool FilterKeyEvent(aura::Window* target, aura::KeyEvent* event); | 54 bool FilterKeyEvent(aura::Window* target, aura::KeyEvent* event); |
| 52 bool FilterMouseEvent(aura::Window* target, aura::MouseEvent* event); | 55 bool FilterMouseEvent(aura::Window* target, aura::MouseEvent* event); |
| 53 ui::TouchStatus FilterTouchEvent(aura::Window* target, | 56 ui::TouchStatus FilterTouchEvent(aura::Window* target, |
| 54 aura::TouchEvent* event); | 57 aura::TouchEvent* event); |
| 55 | 58 |
| 56 // Additional event filters that pre-handles events. | 59 // Additional event filters that pre-handles events. |
| 57 ObserverList<aura::EventFilter, true> filters_; | 60 ObserverList<aura::EventFilter, true> filters_; |
| 58 | 61 |
| 62 // An event filter that pre-handles global accelerators. |
| 63 scoped_ptr<ShellAcceleratorFilter> shell_accelerator_filter_; |
| 64 |
| 59 DISALLOW_COPY_AND_ASSIGN(DesktopEventFilter); | 65 DISALLOW_COPY_AND_ASSIGN(DesktopEventFilter); |
| 60 }; | 66 }; |
| 61 | 67 |
| 62 } // namespace internal | 68 } // namespace internal |
| 63 } // namespace aura_shell | 69 } // namespace aura_shell |
| 64 | 70 |
| 65 #endif // UI_AURA_SHELL_DESKTOP_EVENT_FILTER_H_ | 71 #endif // UI_AURA_SHELL_DESKTOP_EVENT_FILTER_H_ |
| OLD | NEW |