| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/event.h" | 5 #include "ui/events/event.h" |
| 6 #include "ui/events/event_constants.h" | 6 #include "ui/events/event_constants.h" |
| 7 #include "ui/events/event_utils.h" | 7 #include "ui/events/event_utils.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 bool GetFlingData(const base::NativeEvent& native_event, | 138 bool GetFlingData(const base::NativeEvent& native_event, |
| 139 float* vx, | 139 float* vx, |
| 140 float* vy, | 140 float* vy, |
| 141 float* vx_ordinal, | 141 float* vx_ordinal, |
| 142 float* vy_ordinal, | 142 float* vy_ordinal, |
| 143 bool* is_cancel) { | 143 bool* is_cancel) { |
| 144 const ui::ScrollEvent* event = | 144 const ui::ScrollEvent* event = |
| 145 static_cast<const ui::ScrollEvent*>(native_event); | 145 static_cast<const ui::ScrollEvent*>(native_event); |
| 146 DCHECK(event->IsScrollEvent()); | 146 DCHECK(event->IsScrollEvent()); |
| 147 *vx = event->x_offset(); | 147 if (vx) |
| 148 *vy = event->y_offset(); | 148 *vx = event->x_offset(); |
| 149 *vx_ordinal = event->x_offset_ordinal(); | 149 if (vy) |
| 150 *vy_ordinal = event->y_offset_ordinal(); | 150 *vy = event->y_offset(); |
| 151 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; | 151 if (vx_ordinal) |
| 152 *vx_ordinal = event->x_offset_ordinal(); |
| 153 if (vy_ordinal) |
| 154 *vy_ordinal = event->y_offset_ordinal(); |
| 155 if (is_cancel) |
| 156 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; |
| 157 |
| 152 return true; | 158 return true; |
| 153 } | 159 } |
| 154 | 160 |
| 155 int GetModifiersFromKeyState() { | 161 int GetModifiersFromKeyState() { |
| 156 NOTIMPLEMENTED(); | 162 NOTIMPLEMENTED(); |
| 157 return 0; | 163 return 0; |
| 158 } | 164 } |
| 159 | 165 |
| 160 } // namespace ui | 166 } // namespace ui |
| OLD | NEW |