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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1346 |
1347 //////////////////////////////////////////////////////////////////////////////// | 1347 //////////////////////////////////////////////////////////////////////////////// |
1348 // ScrollEvent | 1348 // ScrollEvent |
1349 | 1349 |
1350 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) | 1350 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) |
1351 : MouseEvent(native_event), | 1351 : MouseEvent(native_event), |
1352 x_offset_(0.0f), | 1352 x_offset_(0.0f), |
1353 y_offset_(0.0f), | 1353 y_offset_(0.0f), |
1354 x_offset_ordinal_(0.0f), | 1354 x_offset_ordinal_(0.0f), |
1355 y_offset_ordinal_(0.0f), | 1355 y_offset_ordinal_(0.0f), |
1356 finger_count_(0) { | 1356 finger_count_(0), |
| 1357 momentum_phase_(EventMomentumPhase::NONE) { |
1357 if (type() == ET_SCROLL) { | 1358 if (type() == ET_SCROLL) { |
1358 GetScrollOffsets(native_event, | 1359 GetScrollOffsets(native_event, &x_offset_, &y_offset_, &x_offset_ordinal_, |
1359 &x_offset_, &y_offset_, | 1360 &y_offset_ordinal_, &finger_count_, &momentum_phase_); |
1360 &x_offset_ordinal_, &y_offset_ordinal_, | |
1361 &finger_count_); | |
1362 } else if (type() == ET_SCROLL_FLING_START || | 1361 } else if (type() == ET_SCROLL_FLING_START || |
1363 type() == ET_SCROLL_FLING_CANCEL) { | 1362 type() == ET_SCROLL_FLING_CANCEL) { |
1364 GetFlingData(native_event, | 1363 GetFlingData(native_event, |
1365 &x_offset_, &y_offset_, | 1364 &x_offset_, &y_offset_, |
1366 &x_offset_ordinal_, &y_offset_ordinal_, | 1365 &x_offset_ordinal_, &y_offset_ordinal_, |
1367 NULL); | 1366 NULL); |
1368 } else { | 1367 } else { |
1369 NOTREACHED() << "Unexpected event type " << type() | 1368 NOTREACHED() << "Unexpected event type " << type() |
1370 << " when constructing a ScrollEvent."; | 1369 << " when constructing a ScrollEvent."; |
1371 } | 1370 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 flags | EF_FROM_TOUCH), | 1416 flags | EF_FROM_TOUCH), |
1418 details_(details), | 1417 details_(details), |
1419 unique_touch_event_id_(unique_touch_event_id) { | 1418 unique_touch_event_id_(unique_touch_event_id) { |
1420 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1419 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1421 } | 1420 } |
1422 | 1421 |
1423 GestureEvent::~GestureEvent() { | 1422 GestureEvent::~GestureEvent() { |
1424 } | 1423 } |
1425 | 1424 |
1426 } // namespace ui | 1425 } // namespace ui |
OLD | NEW |