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

Unified Diff: ui/events/ozone/events_ozone.cc

Issue 471163004: ozone: Implement GetFlingData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/events_ozone.cc
diff --git a/ui/events/ozone/events_ozone.cc b/ui/events/ozone/events_ozone.cc
index f86c9eb16d548db1c8e8c4745e3cbeda029566d3..d5d75afe849a295a834c8b2a747277eac6dc851e 100644
--- a/ui/events/ozone/events_ozone.cc
+++ b/ui/events/ozone/events_ozone.cc
@@ -141,8 +141,15 @@ bool GetFlingData(const base::NativeEvent& native_event,
float* vx_ordinal,
float* vy_ordinal,
bool* is_cancel) {
- NOTIMPLEMENTED();
- return false;
+ const ui::ScrollEvent* event =
+ static_cast<const ui::ScrollEvent*>(native_event);
+ DCHECK(event->IsScrollEvent());
+ *vx = event->x_offset();
+ *vy = event->y_offset();
+ *vx_ordinal = event->x_offset_ordinal();
+ *vy_ordinal = event->y_offset_ordinal();
+ *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL;
+ return true;
}
int GetModifiersFromKeyState() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698