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

Unified Diff: ui/aura/event.cc

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge removal of compact nav. Created 9 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/aura/event.h ('k') | ui/aura/event_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event.cc
diff --git a/ui/aura/event.cc b/ui/aura/event.cc
index 6846f2e687314d72811543a84f935024b1257fb4..aae9d65ed9e980b77afb5b718574bfbd6afed013 100644
--- a/ui/aura/event.cc
+++ b/ui/aura/event.cc
@@ -15,7 +15,7 @@ Event::Event(ui::EventType type, int flags)
Init();
}
-Event::Event(NativeEvent native_event, ui::EventType type, int flags)
+Event::Event(const ui::NativeEvent& native_event, ui::EventType type, int flags)
: type_(type),
time_stamp_(base::Time::NowFromSystemTime()),
flags_(flags) {
@@ -29,6 +29,21 @@ Event::Event(const Event& copy)
flags_(copy.flags_) {
}
+void Event::Init() {
+ memset(&native_event_, 0, sizeof(native_event_));
+}
+
+void Event::InitWithNativeEvent(const ui::NativeEvent& native_event) {
+ native_event_ = native_event;
+}
+
+LocatedEvent::LocatedEvent(const ui::NativeEvent& native_event)
+ : Event(native_event,
+ ui::EventTypeFromNative(native_event),
+ ui::EventFlagsFromNative(native_event)),
+ location_(ui::EventLocationFromNative(native_event)) {
+}
+
LocatedEvent::LocatedEvent(const LocatedEvent& model,
Window* source,
Window* target)
@@ -45,6 +60,10 @@ LocatedEvent::LocatedEvent(ui::EventType type,
location_(location) {
}
+MouseEvent::MouseEvent(const ui::NativeEvent& native_event)
+ : LocatedEvent(native_event) {
+}
+
MouseEvent::MouseEvent(const MouseEvent& model, Window* source, Window* target)
: LocatedEvent(model, source, target) {
}
@@ -63,6 +82,13 @@ MouseEvent::MouseEvent(ui::EventType type,
: LocatedEvent(type, location, flags) {
}
+KeyEvent::KeyEvent(const ui::NativeEvent& native_event)
+ : Event(native_event,
+ ui::EventTypeFromNative(native_event),
+ ui::EventFlagsFromNative(native_event)),
+ key_code_(ui::KeyboardCodeFromNative(native_event)) {
+}
+
KeyEvent::KeyEvent(ui::EventType type,
ui::KeyboardCode key_code,
int flags)
« no previous file with comments | « ui/aura/event.h ('k') | ui/aura/event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698