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

Unified Diff: ui/views/events/event.cc

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GdkEvent init, NativeWidgetGtk casting, and Get[Unmodified]Character checks. 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
Index: ui/views/events/event.cc
diff --git a/ui/views/events/event.cc b/ui/views/events/event.cc
index c4e7697c4e388f7f76f4f794d000c31a0b0ae4fe..544c2adec38bbe4488f976d08afd9e9055b9e0e2 100644
--- a/ui/views/events/event.cc
+++ b/ui/views/events/event.cc
@@ -50,8 +50,27 @@ LocatedEvent::LocatedEvent(const LocatedEvent& other,
////////////////////////////////////////////////////////////////////////////////
// MouseEvent, public:
+MouseEvent::MouseEvent(const ui::NativeEvent& native_event)
+ : LocatedEvent(ui::EventTypeFromNative(native_event),
+ ui::EventLocationFromNative(native_event),
+ ui::EventFlagsFromNative(native_event)) {
+}
+
MouseEvent::MouseEvent(const MouseEvent& other, View* source, View* target)
: LocatedEvent(other, source, target) {
}
+KeyEvent::KeyEvent(const ui::NativeEvent& native_event)
+ : Event(ui::EventTypeFromNative(native_event),
+ ui::EventFlagsFromNative(native_event)),
+ key_code_(ui::KeyboardCodeFromNative(native_event)) {
+}
+
+MouseWheelEvent::MouseWheelEvent(const ui::NativeEvent& native_event)
+ : LocatedEvent(ui::EventTypeFromNative(native_event),
+ ui::EventLocationFromNative(native_event),
+ ui::EventFlagsFromNative(native_event)),
+ offset_(ui::GetMouseWheelOffset(native_event)) {
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698