| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 | 10 |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 | 1221 |
| 1222 //////////////////////////////////////////////////////////////////////////////// | 1222 //////////////////////////////////////////////////////////////////////////////// |
| 1223 // ScrollEvent | 1223 // ScrollEvent |
| 1224 | 1224 |
| 1225 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) | 1225 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) |
| 1226 : MouseEvent(native_event), | 1226 : MouseEvent(native_event), |
| 1227 x_offset_(0.0f), | 1227 x_offset_(0.0f), |
| 1228 y_offset_(0.0f), | 1228 y_offset_(0.0f), |
| 1229 x_offset_ordinal_(0.0f), | 1229 x_offset_ordinal_(0.0f), |
| 1230 y_offset_ordinal_(0.0f), | 1230 y_offset_ordinal_(0.0f), |
| 1231 finger_count_(0) { | 1231 finger_count_(0), |
| 1232 momentum_phase_(EM_PHASE_NONE) { |
| 1232 if (type() == ET_SCROLL) { | 1233 if (type() == ET_SCROLL) { |
| 1233 GetScrollOffsets(native_event, | 1234 GetScrollOffsets(native_event, &x_offset_, &y_offset_, &x_offset_ordinal_, |
| 1234 &x_offset_, &y_offset_, | 1235 &y_offset_ordinal_, &finger_count_, &momentum_phase_); |
| 1235 &x_offset_ordinal_, &y_offset_ordinal_, | |
| 1236 &finger_count_); | |
| 1237 } else if (type() == ET_SCROLL_FLING_START || | 1236 } else if (type() == ET_SCROLL_FLING_START || |
| 1238 type() == ET_SCROLL_FLING_CANCEL) { | 1237 type() == ET_SCROLL_FLING_CANCEL) { |
| 1239 GetFlingData(native_event, | 1238 GetFlingData(native_event, |
| 1240 &x_offset_, &y_offset_, | 1239 &x_offset_, &y_offset_, |
| 1241 &x_offset_ordinal_, &y_offset_ordinal_, | 1240 &x_offset_ordinal_, &y_offset_ordinal_, |
| 1242 NULL); | 1241 NULL); |
| 1243 } else { | 1242 } else { |
| 1244 NOTREACHED() << "Unexpected event type " << type() | 1243 NOTREACHED() << "Unexpected event type " << type() |
| 1245 << " when constructing a ScrollEvent."; | 1244 << " when constructing a ScrollEvent."; |
| 1246 } | 1245 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 gfx::PointF(x, y), | 1284 gfx::PointF(x, y), |
| 1286 time_stamp, | 1285 time_stamp, |
| 1287 flags | EF_FROM_TOUCH), | 1286 flags | EF_FROM_TOUCH), |
| 1288 details_(details), | 1287 details_(details), |
| 1289 unique_touch_event_id_(unique_touch_event_id) {} | 1288 unique_touch_event_id_(unique_touch_event_id) {} |
| 1290 | 1289 |
| 1291 GestureEvent::~GestureEvent() { | 1290 GestureEvent::~GestureEvent() { |
| 1292 } | 1291 } |
| 1293 | 1292 |
| 1294 } // namespace ui | 1293 } // namespace ui |
| OLD | NEW |