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

Side by Side Diff: ui/base/events/event_target.h

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing Created 8 years 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/base/events/event_handler.cc ('k') | ui/base/events/event_target.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_BASE_EVENTS_EVENT_TARGET_H_ 5 #ifndef UI_BASE_EVENTS_EVENT_TARGET_H_
6 #define UI_BASE_EVENTS_EVENT_TARGET_H_ 6 #define UI_BASE_EVENTS_EVENT_TARGET_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/base/events/event_handler.h" 10 #include "ui/base/events/event_handler.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void AddPostTargetHandler(EventHandler* handler); 66 void AddPostTargetHandler(EventHandler* handler);
67 void RemovePostTargetHandler(EventHandler* handler); 67 void RemovePostTargetHandler(EventHandler* handler);
68 68
69 protected: 69 protected:
70 void set_target_handler(EventHandler* handler) { 70 void set_target_handler(EventHandler* handler) {
71 target_handler_ = handler; 71 target_handler_ = handler;
72 } 72 }
73 73
74 // Overridden from EventHandler: 74 // Overridden from EventHandler:
75 virtual void OnEvent(Event* event) OVERRIDE; 75 virtual void OnEvent(Event* event) OVERRIDE;
76 virtual EventResult OnKeyEvent(KeyEvent* event) OVERRIDE; 76 virtual void OnKeyEvent(KeyEvent* event) OVERRIDE;
77 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE; 77 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE;
78 virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE; 78 virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE;
79 virtual void OnTouchEvent(TouchEvent* event) OVERRIDE; 79 virtual void OnTouchEvent(TouchEvent* event) OVERRIDE;
80 virtual void OnGestureEvent(GestureEvent* event) OVERRIDE; 80 virtual void OnGestureEvent(GestureEvent* event) OVERRIDE;
81 81
82 private: 82 private:
83 friend class EventDispatcher; 83 friend class EventDispatcher;
84 84
85 // Returns the list of handlers that should receive the event before the 85 // Returns the list of handlers that should receive the event before the
86 // target. The handlers from the outermost target are first in the list, and 86 // target. The handlers from the outermost target are first in the list, and
87 // the handlers on |this| are the last in the list. 87 // the handlers on |this| are the last in the list.
88 void GetPreTargetHandlers(EventHandlerList* list); 88 void GetPreTargetHandlers(EventHandlerList* list);
89 89
90 // Returns the list of handlers that should receive the event after the 90 // Returns the list of handlers that should receive the event after the
91 // target. The handlers from the outermost target are last in the list, and 91 // target. The handlers from the outermost target are last in the list, and
92 // the handlers on |this| are the first in the list. 92 // the handlers on |this| are the first in the list.
93 void GetPostTargetHandlers(EventHandlerList* list); 93 void GetPostTargetHandlers(EventHandlerList* list);
94 94
95 EventHandlerList pre_target_list_; 95 EventHandlerList pre_target_list_;
96 EventHandlerList post_target_list_; 96 EventHandlerList post_target_list_;
97 EventHandler* target_handler_; 97 EventHandler* target_handler_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(EventTarget); 99 DISALLOW_COPY_AND_ASSIGN(EventTarget);
100 }; 100 };
101 101
102 } // namespace ui 102 } // namespace ui
103 103
104 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_ 104 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_
OLDNEW
« no previous file with comments | « ui/base/events/event_handler.cc ('k') | ui/base/events/event_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698