Chromium Code Reviews| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 | 491 |
| 492 case ET_POINTER_EXITED: | 492 case ET_POINTER_EXITED: |
| 493 SetType(ET_MOUSE_EXITED); | 493 SetType(ET_MOUSE_EXITED); |
| 494 break; | 494 break; |
| 495 | 495 |
| 496 case ET_POINTER_UP: | 496 case ET_POINTER_UP: |
| 497 SetType(ET_MOUSE_RELEASED); | 497 SetType(ET_MOUSE_RELEASED); |
| 498 break; | 498 break; |
| 499 | 499 |
| 500 case ET_POINTER_WHEEL_CHANGED: | 500 case ET_POINTER_WHEEL_CHANGED: |
| 501 SetType(ET_MOUSEWHEEL); | 501 SetType(ET_MOUSEWHEEL); |
|
sadrul
2016/09/01 05:38:54
Can you change this to a NOTREACHED()?
riajiang
2016/09/01 15:29:21
As discussed, changing it to not set type here. Al
| |
| 502 break; | 502 break; |
| 503 | 503 |
| 504 case ET_POINTER_CAPTURE_CHANGED: | 504 case ET_POINTER_CAPTURE_CHANGED: |
| 505 SetType(ET_MOUSE_CAPTURE_CHANGED); | 505 SetType(ET_MOUSE_CAPTURE_CHANGED); |
| 506 break; | 506 break; |
| 507 | 507 |
| 508 default: | 508 default: |
| 509 NOTREACHED(); | 509 NOTREACHED(); |
| 510 } | 510 } |
| 511 } | 511 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 offset_(GetMouseWheelOffset(native_event)) { | 655 offset_(GetMouseWheelOffset(native_event)) { |
| 656 } | 656 } |
| 657 | 657 |
| 658 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) | 658 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) |
| 659 : MouseEvent(scroll_event), | 659 : MouseEvent(scroll_event), |
| 660 offset_(gfx::ToRoundedInt(scroll_event.x_offset()), | 660 offset_(gfx::ToRoundedInt(scroll_event.x_offset()), |
| 661 gfx::ToRoundedInt(scroll_event.y_offset())) { | 661 gfx::ToRoundedInt(scroll_event.y_offset())) { |
| 662 SetType(ET_MOUSEWHEEL); | 662 SetType(ET_MOUSEWHEEL); |
| 663 } | 663 } |
| 664 | 664 |
| 665 MouseWheelEvent::MouseWheelEvent(const PointerEvent& pointer_event) | |
| 666 : MouseEvent(pointer_event), | |
| 667 offset_(pointer_event.pointer_details().offset.x(), | |
| 668 pointer_event.pointer_details().offset.y()) { | |
| 669 DCHECK(type() == ET_MOUSEWHEEL); | |
| 670 } | |
| 671 | |
| 665 MouseWheelEvent::MouseWheelEvent(const MouseEvent& mouse_event, | 672 MouseWheelEvent::MouseWheelEvent(const MouseEvent& mouse_event, |
| 666 int x_offset, | 673 int x_offset, |
| 667 int y_offset) | 674 int y_offset) |
| 668 : MouseEvent(mouse_event), offset_(x_offset, y_offset) { | 675 : MouseEvent(mouse_event), offset_(x_offset, y_offset) { |
| 669 DCHECK(type() == ET_MOUSEWHEEL); | 676 DCHECK(type() == ET_MOUSEWHEEL); |
| 670 } | 677 } |
| 671 | 678 |
| 672 MouseWheelEvent::MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event) | 679 MouseWheelEvent::MouseWheelEvent(const MouseWheelEvent& mouse_wheel_event) |
| 673 : MouseEvent(mouse_wheel_event), | 680 : MouseEvent(mouse_wheel_event), |
| 674 offset_(mouse_wheel_event.offset()) { | 681 offset_(mouse_wheel_event.offset()) { |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1306 gfx::PointF(x, y), | 1313 gfx::PointF(x, y), |
| 1307 time_stamp, | 1314 time_stamp, |
| 1308 flags | EF_FROM_TOUCH), | 1315 flags | EF_FROM_TOUCH), |
| 1309 details_(details), | 1316 details_(details), |
| 1310 unique_touch_event_id_(unique_touch_event_id) {} | 1317 unique_touch_event_id_(unique_touch_event_id) {} |
| 1311 | 1318 |
| 1312 GestureEvent::~GestureEvent() { | 1319 GestureEvent::~GestureEvent() { |
| 1313 } | 1320 } |
| 1314 | 1321 |
| 1315 } // namespace ui | 1322 } // namespace ui |
| OLD | NEW |