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

Unified Diff: ui/events/event.cc

Issue 2287403002: Create MouseWheelEvent directly instead of through MouseEvent. (Closed)
Patch Set: Created 4 years, 4 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/events/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 8ce2ae6941c0fa6fe097d5ac418df2deedebd900..81c9abe66bc8efcd1355f624fecc8e39d3381afa 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -522,6 +522,7 @@ MouseEvent::MouseEvent(EventType type,
flags),
changed_button_flags_(changed_button_flags),
pointer_details_(PointerDetails(EventPointerType::POINTER_TYPE_MOUSE)) {
+ DCHECK(type != ET_MOUSEWHEEL);
sadrul 2016/08/29 16:02:36 DCHECK_NE
riajiang 2016/08/29 16:17:54 Done.
latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
if (this->type() == ET_MOUSE_MOVED && IsAnyButton())
SetType(ET_MOUSE_DRAGGED);
@@ -679,13 +680,15 @@ MouseWheelEvent::MouseWheelEvent(const gfx::Vector2d& offset,
base::TimeTicks time_stamp,
int flags,
int changed_button_flags)
- : MouseEvent(ui::ET_MOUSEWHEEL,
+ : MouseEvent(ui::ET_UNKNOWN,
location,
root_location,
time_stamp,
flags,
changed_button_flags),
- offset_(offset) {}
+ offset_(offset) {
+ SetType(ui::ET_MOUSEWHEEL);
sadrul 2016/08/29 16:02:36 Add a comment here why we are doing this.
riajiang 2016/08/29 16:17:54 Done.
+}
#if defined(OS_WIN)
// This value matches windows WHEEL_DELTA.
« no previous file with comments | « ui/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698