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

Unified Diff: views/events/event.cc

Issue 6591120: Update MouseEvent (initial pass). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update MouseEvent (initial pass). Created 9 years, 10 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: views/events/event.cc
diff --git a/views/events/event.cc b/views/events/event.cc
index f51ec0a29f77a5ff89c545d0cac72dd314422b1c..c9c3809eab57ca1b60f930d623c4498e0a7f8d19 100644
--- a/views/events/event.cc
+++ b/views/events/event.cc
@@ -38,6 +38,7 @@ Event::Event(NativeEvent2 native_event_2, ui::EventType type, int flags,
////////////////////////////////////////////////////////////////////////////////
// LocatedEvent, protected:
+// TODO(msw): Kill this legacy constructor when we update uses.
LocatedEvent::LocatedEvent(ui::EventType type, const gfx::Point& location,
int flags)
: Event(type, flags),
@@ -52,9 +53,6 @@ LocatedEvent::LocatedEvent(const LocatedEvent& model, View* source,
View::ConvertPointToView(source, target, &location_);
}
-////////////////////////////////////////////////////////////////////////////////
-// LocatedEvent, private:
-
LocatedEvent::LocatedEvent(const LocatedEvent& model, RootView* root)
: Event(model),
location_(model.location_) {
@@ -73,16 +71,21 @@ KeyEvent::KeyEvent(ui::EventType type, ui::KeyboardCode key_code,
////////////////////////////////////////////////////////////////////////////////
// MouseEvent, public:
+MouseEvent::MouseEvent(NativeEvent native_event)
+ : LocatedEvent(native_event) {
+}
+
+// TODO(msw): Kill this legacy constructor when we update uses.
MouseEvent::MouseEvent(ui::EventType type,
- View* from,
- View* to,
+ View* source,
+ View* target,
const gfx::Point &l,
int flags)
- : LocatedEvent(MouseEvent(type, l.x(), l.y(), flags), from, to) {
+ : LocatedEvent(MouseEvent(type, l.x(), l.y(), flags), source, target) {
}
-MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to)
- : LocatedEvent(model, from, to) {
+MouseEvent::MouseEvent(const MouseEvent& model, View* source, View* target)
+ : LocatedEvent(model, source, target) {
}
////////////////////////////////////////////////////////////////////////////////
@@ -97,17 +100,18 @@ TouchEvent::TouchEvent(ui::EventType type, int x, int y, int flags,
TouchEvent::TouchEvent(ui::EventType type,
- View* from,
- View* to,
+ View* source,
+ View* target,
const gfx::Point& l,
int flags,
int touch_id)
- : LocatedEvent(TouchEvent(type, l.x(), l.y(), flags, touch_id), from, to),
+ : LocatedEvent(TouchEvent(type, l.x(), l.y(), flags, touch_id), source,
+ target),
touch_id_(touch_id) {
}
-TouchEvent::TouchEvent(const TouchEvent& model, View* from, View* to)
- : LocatedEvent(model, from, to),
+TouchEvent::TouchEvent(const TouchEvent& model, View* source, View* target)
+ : LocatedEvent(model, source, target),
touch_id_(model.touch_id_) {
}
#endif

Powered by Google App Engine
This is Rietveld 408576698