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

Unified Diff: ui/base/events/event.h

Issue 10908127: events: Move EventTarget into Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/event_unittest.cc ('k') | ui/base/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.h
diff --git a/ui/base/events/event.h b/ui/base/events/event.h
index 1b66582a730437654d672d1f1139061a92bbedb0..d2cec15ef9dc1e68c3f13006f9537db92a8f962e 100644
--- a/ui/base/events/event.h
+++ b/ui/base/events/event.h
@@ -19,11 +19,27 @@
namespace ui {
class Transform;
+class EventTarget;
class UI_EXPORT Event {
public:
virtual ~Event();
+ class DispatcherApi {
+ public:
+ explicit DispatcherApi(Event* event) : event_(event) {}
+
+ void set_target(EventTarget* target) {
+ event_->target_ = target;
+ }
+
+ private:
+ DispatcherApi();
+ Event* event_;
+
+ DISALLOW_COPY_AND_ASSIGN(DispatcherApi);
+ };
+
// For testing.
class TestApi {
public:
@@ -48,6 +64,8 @@ class UI_EXPORT Event {
// events in EventFilter::PreHandleKeyEvent().
void set_flags(int flags) { flags_ = flags; }
+ EventTarget* target() const { return target_; }
+
// The following methods return true if the respective keys were pressed at
// the time the event was created.
bool IsShiftDown() const { return (flags_ & EF_SHIFT_DOWN) != 0; }
@@ -152,6 +170,7 @@ class UI_EXPORT Event {
base::TimeDelta time_stamp_;
int flags_;
bool delete_native_event_;
+ EventTarget* target_;
};
class UI_EXPORT LocatedEvent : public Event {
« no previous file with comments | « ui/base/event_unittest.cc ('k') | ui/base/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698