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

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

Issue 667923002: Standardize usage of virtual/override/final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ui/events/event_processor.h ('k') | ui/events/gesture_detection/filtered_gesture_provider.h » ('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_EVENTS_EVENT_TARGET_H_ 5 #ifndef UI_EVENTS_EVENT_TARGET_H_
6 #define UI_EVENTS_EVENT_TARGET_H_ 6 #define UI_EVENTS_EVENT_TARGET_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 private: 33 private:
34 DispatcherApi(); 34 DispatcherApi();
35 EventTarget* target_; 35 EventTarget* target_;
36 36
37 DISALLOW_COPY_AND_ASSIGN(DispatcherApi); 37 DISALLOW_COPY_AND_ASSIGN(DispatcherApi);
38 }; 38 };
39 39
40 EventTarget(); 40 EventTarget();
41 virtual ~EventTarget(); 41 ~EventTarget() override;
42 42
43 virtual bool CanAcceptEvent(const Event& event) = 0; 43 virtual bool CanAcceptEvent(const Event& event) = 0;
44 44
45 // Returns the parent EventTarget in the event-target tree. 45 // Returns the parent EventTarget in the event-target tree.
46 virtual EventTarget* GetParentTarget() = 0; 46 virtual EventTarget* GetParentTarget() = 0;
47 47
48 // Returns an iterator an EventTargeter can use to iterate over the list of 48 // Returns an iterator an EventTargeter can use to iterate over the list of
49 // child EventTargets. 49 // child EventTargets.
50 virtual scoped_ptr<EventTargetIterator> GetChildIterator() const = 0; 50 virtual scoped_ptr<EventTargetIterator> GetChildIterator() const = 0;
51 51
(...skipping 26 matching lines...) Expand all
78 bool IsPreTargetListEmpty() const; 78 bool IsPreTargetListEmpty() const;
79 79
80 void set_target_handler(EventHandler* handler) { 80 void set_target_handler(EventHandler* handler) {
81 target_handler_ = handler; 81 target_handler_ = handler;
82 } 82 }
83 83
84 protected: 84 protected:
85 EventHandler* target_handler() { return target_handler_; } 85 EventHandler* target_handler() { return target_handler_; }
86 86
87 // Overridden from EventHandler: 87 // Overridden from EventHandler:
88 virtual void OnEvent(Event* event) override; 88 void OnEvent(Event* event) override;
89 virtual void OnKeyEvent(KeyEvent* event) override; 89 void OnKeyEvent(KeyEvent* event) override;
90 virtual void OnMouseEvent(MouseEvent* event) override; 90 void OnMouseEvent(MouseEvent* event) override;
91 virtual void OnScrollEvent(ScrollEvent* event) override; 91 void OnScrollEvent(ScrollEvent* event) override;
92 virtual void OnTouchEvent(TouchEvent* event) override; 92 void OnTouchEvent(TouchEvent* event) override;
93 virtual void OnGestureEvent(GestureEvent* event) override; 93 void OnGestureEvent(GestureEvent* event) override;
94 94
95 private: 95 private:
96 friend class EventDispatcher; 96 friend class EventDispatcher;
97 friend class EventTargetTestApi; 97 friend class EventTargetTestApi;
98 98
99 // Returns the list of handlers that should receive the event before the 99 // Returns the list of handlers that should receive the event before the
100 // target. The handlers from the outermost target are first in the list, and 100 // target. The handlers from the outermost target are first in the list, and
101 // the handlers on |this| are the last in the list. 101 // the handlers on |this| are the last in the list.
102 void GetPreTargetHandlers(EventHandlerList* list); 102 void GetPreTargetHandlers(EventHandlerList* list);
103 103
104 // Returns the list of handlers that should receive the event after the 104 // Returns the list of handlers that should receive the event after the
105 // target. The handlers from the outermost target are last in the list, and 105 // target. The handlers from the outermost target are last in the list, and
106 // the handlers on |this| are the first in the list. 106 // the handlers on |this| are the first in the list.
107 void GetPostTargetHandlers(EventHandlerList* list); 107 void GetPostTargetHandlers(EventHandlerList* list);
108 108
109 EventHandlerList pre_target_list_; 109 EventHandlerList pre_target_list_;
110 EventHandlerList post_target_list_; 110 EventHandlerList post_target_list_;
111 EventHandler* target_handler_; 111 EventHandler* target_handler_;
112 112
113 DISALLOW_COPY_AND_ASSIGN(EventTarget); 113 DISALLOW_COPY_AND_ASSIGN(EventTarget);
114 }; 114 };
115 115
116 } // namespace ui 116 } // namespace ui
117 117
118 #endif // UI_EVENTS_EVENT_TARGET_H_ 118 #endif // UI_EVENTS_EVENT_TARGET_H_
OLDNEW
« no previous file with comments | « ui/events/event_processor.h ('k') | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698