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

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

Issue 10960015: aura: Start converting event-filters into event-handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 3 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/shared/compound_event_filter_unittest.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/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "ui/base/events/event_handler.h" 9 #include "ui/base/events/event_handler.h"
10 #include "ui/base/ui_export.h" 10 #include "ui/base/ui_export.h"
(...skipping 14 matching lines...) Expand all
25 return target_->pre_target_list_; 25 return target_->pre_target_list_;
26 } 26 }
27 27
28 private: 28 private:
29 TestApi(); 29 TestApi();
30 EventTarget* target_; 30 EventTarget* target_;
31 31
32 DISALLOW_COPY_AND_ASSIGN(TestApi); 32 DISALLOW_COPY_AND_ASSIGN(TestApi);
33 }; 33 };
34 34
35 class DispatcherApi {
36 public:
37 explicit DispatcherApi(EventTarget* target) : target_(target) {}
38
39 const EventHandlerList& pre_target_list() const {
40 return target_->pre_target_list_;
41 }
42
43 private:
44 DispatcherApi();
45 EventTarget* target_;
46
47 DISALLOW_COPY_AND_ASSIGN(DispatcherApi);
48 };
49
35 EventTarget(); 50 EventTarget();
36 virtual ~EventTarget(); 51 virtual ~EventTarget();
37 52
38 virtual bool CanAcceptEvents() = 0; 53 virtual bool CanAcceptEvents() = 0;
39 virtual EventTarget* GetParentTarget() = 0; 54 virtual EventTarget* GetParentTarget() = 0;
40 55
41 // Adds a handler to receive events before the target. The handler must be 56 // Adds a handler to receive events before the target. The handler must be
42 // explicitly removed from the target before the handler is destroyed. The 57 // explicitly removed from the target before the handler is destroyed. The
43 // EventTarget does not take ownership of the handler. 58 // EventTarget does not take ownership of the handler.
44 void AddPreTargetHandler(EventHandler* handler); 59 void AddPreTargetHandler(EventHandler* handler);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 EventHandlerList pre_target_list_; 93 EventHandlerList pre_target_list_;
79 EventHandlerList post_target_list_; 94 EventHandlerList post_target_list_;
80 EventHandler* target_handler_; 95 EventHandler* target_handler_;
81 96
82 DISALLOW_COPY_AND_ASSIGN(EventTarget); 97 DISALLOW_COPY_AND_ASSIGN(EventTarget);
83 }; 98 };
84 99
85 } // namespace ui 100 } // namespace ui
86 101
87 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_ 102 #endif // UI_BASE_EVENTS_EVENT_TARGET_H_
OLDNEW
« no previous file with comments | « ui/aura/shared/compound_event_filter_unittest.cc ('k') | ui/base/events/event_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698