Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/aura/event_filter.h

Issue 9315004: Remove Owner param to EventFilter's ctor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_AURA_EVENT_FILTER_H_ 5 #ifndef UI_AURA_EVENT_FILTER_H_
6 #define UI_AURA_EVENT_FILTER_H_ 6 #define UI_AURA_EVENT_FILTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/aura/aura_export.h" 10 #include "ui/aura/aura_export.h"
(...skipping 14 matching lines...) Expand all
25 // the event, this is typically the visible window whose bounds most tightly 25 // the event, this is typically the visible window whose bounds most tightly
26 // enclose the event coordinates, in the case of mouse events, or the focused 26 // enclose the event coordinates, in the case of mouse events, or the focused
27 // window, in the case of key events. 27 // window, in the case of key events.
28 // 28 //
29 // The Desktop then walks up the hierarchy from the target to its own window, 29 // The Desktop then walks up the hierarchy from the target to its own window,
30 // collecting a list of EventFilters. This list is notified in reverse order 30 // collecting a list of EventFilters. This list is notified in reverse order
31 // (i.e. descending, from the Desktop's own event filter). Each filter gets a 31 // (i.e. descending, from the Desktop's own event filter). Each filter gets a
32 // chance to prevent further processing of the event and/or take other actions. 32 // chance to prevent further processing of the event and/or take other actions.
33 class AURA_EXPORT EventFilter { 33 class AURA_EXPORT EventFilter {
34 public: 34 public:
35 explicit EventFilter(Window* owner); 35 virtual ~EventFilter() {}
36 virtual ~EventFilter();
37 36
38 // Parameters: a |target| Window and the |event|. The target window is the 37 // Parameters: a |target| Window and the |event|. The target window is the
39 // window the event was targeted at. If |event| is a LocatedEvent, its 38 // window the event was targeted at. If |event| is a LocatedEvent, its
40 // coordinates are relative to |target|. 39 // coordinates are relative to |target|.
41 40
42 // For all PreHandle*() functions that return a bool, return true if the 41 // For all PreHandle*() functions that return a bool, return true if the
43 // filter consumes the event and further processing (by the target, for 42 // filter consumes the event and further processing (by the target, for
44 // example) is not performed. Return false if the filter does not consume the 43 // example) is not performed. Return false if the filter does not consume the
45 // event and further processing is performed. Note that in this case the 44 // event and further processing is performed. Note that in this case the
46 // filter may still perform some action, the return value simply indicates 45 // filter may still perform some action, the return value simply indicates
47 // that further processing can occur. 46 // that further processing can occur.
48 47
49 virtual bool PreHandleKeyEvent(Window* target, KeyEvent* event) = 0; 48 virtual bool PreHandleKeyEvent(Window* target, KeyEvent* event) = 0;
50 virtual bool PreHandleMouseEvent(Window* target, MouseEvent* event) = 0; 49 virtual bool PreHandleMouseEvent(Window* target, MouseEvent* event) = 0;
51 50
52 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is 51 // Returns a value other than ui::TOUCH_STATUS_UNKNOWN if the event is
53 // consumed. 52 // consumed.
54 virtual ui::TouchStatus PreHandleTouchEvent(Window* target, 53 virtual ui::TouchStatus PreHandleTouchEvent(Window* target,
55 TouchEvent* event) = 0; 54 TouchEvent* event) = 0;
56 55
57 // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is 56 // Returns a value other than ui::GESTURE_STATUS_UNKNOWN if the gesture is
58 // consumed. 57 // consumed.
59 virtual ui::GestureStatus PreHandleGestureEvent(Window* target, 58 virtual ui::GestureStatus PreHandleGestureEvent(Window* target,
60 GestureEvent* event) = 0; 59 GestureEvent* event) = 0;
61
62 protected:
63 Window* owner() { return owner_; }
64
65 private:
66 Window* owner_;
67
68 DISALLOW_COPY_AND_ASSIGN(EventFilter);
69 }; 60 };
70 61
71 } // namespace aura 62 } // namespace aura
72 63
73 #endif // UI_AURA_EVENT_FILTER_H_ 64 #endif // UI_AURA_EVENT_FILTER_H_
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698