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

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

Issue 12208118: Add support for ordinal scroll amounts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix interactive_ui_tests failure Created 7 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
« no previous file with comments | « ui/base/events/event.h ('k') | ui/base/events/event_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.cc
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index c06b6046b72742f7e74112865ed623dac099717b..7383579ecb8ed4531df42c9bbd6b4e1329032b27 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -625,13 +625,16 @@ DropTargetEvent::DropTargetEvent(const OSExchangeData& data,
ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
: MouseEvent(native_event) {
if (type() == ET_SCROLL) {
- GetScrollOffsets(native_event, &x_offset_, &y_offset_, &finger_count_);
- double start, end;
- GetGestureTimes(native_event, &start, &end);
+ GetScrollOffsets(native_event,
+ &x_offset_, &y_offset_,
+ &x_offset_ordinal_, &y_offset_ordinal_,
+ &finger_count_);
} else if (type() == ET_SCROLL_FLING_START ||
type() == ET_SCROLL_FLING_CANCEL) {
- bool is_cancel;
- GetFlingData(native_event, &x_offset_, &y_offset_, &is_cancel);
+ GetFlingData(native_event,
+ &x_offset_, &y_offset_,
+ &x_offset_ordinal_, &y_offset_ordinal_,
+ NULL);
} else {
NOTREACHED() << "Unexpected event type " << type()
<< " when constructing a ScrollEvent.";
@@ -644,10 +647,14 @@ ScrollEvent::ScrollEvent(EventType type,
int flags,
float x_offset,
float y_offset,
+ float x_offset_ordinal,
+ float y_offset_ordinal,
int finger_count)
: MouseEvent(type, location, location, flags),
x_offset_(x_offset),
y_offset_(y_offset),
+ x_offset_ordinal_(x_offset_ordinal),
+ y_offset_ordinal_(y_offset_ordinal),
finger_count_(finger_count) {
set_time_stamp(time_stamp);
CHECK(IsScrollEvent());
@@ -656,6 +663,8 @@ ScrollEvent::ScrollEvent(EventType type,
void ScrollEvent::Scale(const float factor) {
x_offset_ *= factor;
y_offset_ *= factor;
+ x_offset_ordinal_ *= factor;
+ y_offset_ordinal_ *= factor;
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/base/events/event.h ('k') | ui/base/events/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698