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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 radius_x(radius_x > 0 ? radius_x : radius_y), | 525 radius_x(radius_x > 0 ? radius_x : radius_y), |
526 radius_y(radius_y > 0 ? radius_y : radius_x), | 526 radius_y(radius_y > 0 ? radius_y : radius_x), |
527 force(force), | 527 force(force), |
528 tilt_x(tilt_x), | 528 tilt_x(tilt_x), |
529 tilt_y(tilt_y), | 529 tilt_y(tilt_y), |
530 tangential_pressure(tangential_pressure), | 530 tangential_pressure(tangential_pressure), |
531 twist(twist), | 531 twist(twist), |
532 id(pointer_id) { | 532 id(pointer_id) { |
533 if (pointer_id == PointerDetails::kUnknownPointerId) { | 533 if (pointer_id == PointerDetails::kUnknownPointerId) { |
534 id = pointer_type == EventPointerType::POINTER_TYPE_MOUSE | 534 id = pointer_type == EventPointerType::POINTER_TYPE_MOUSE |
535 ? MouseEvent::kMousePointerId | 535 ? MouseEvent::kDefaultMousePointerId |
536 : 0; | 536 : 0; |
537 } | 537 } |
538 } | 538 } |
539 | 539 |
540 PointerDetails::PointerDetails(EventPointerType pointer_type, | 540 PointerDetails::PointerDetails(EventPointerType pointer_type, |
541 const gfx::Vector2d& pointer_offset, | 541 const gfx::Vector2d& pointer_offset, |
542 int pointer_id) | 542 int pointer_id) |
543 : PointerDetails(pointer_type, pointer_id) { | 543 : PointerDetails(pointer_type, pointer_id) { |
544 offset = pointer_offset; | 544 offset = pointer_offset; |
545 } | 545 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 f &= ~EF_IS_TRIPLE_CLICK; | 750 f &= ~EF_IS_TRIPLE_CLICK; |
751 break; | 751 break; |
752 case 3: | 752 case 3: |
753 f &= ~EF_IS_DOUBLE_CLICK; | 753 f &= ~EF_IS_DOUBLE_CLICK; |
754 f |= EF_IS_TRIPLE_CLICK; | 754 f |= EF_IS_TRIPLE_CLICK; |
755 break; | 755 break; |
756 } | 756 } |
757 set_flags(f); | 757 set_flags(f); |
758 } | 758 } |
759 | 759 |
760 const int MouseEvent::kMousePointerId = std::numeric_limits<int32_t>::max(); | 760 const int MouseEvent::kDefaultMousePointerId = std::numeric_limits<int>::max(); |
761 | 761 |
762 //////////////////////////////////////////////////////////////////////////////// | 762 //////////////////////////////////////////////////////////////////////////////// |
763 // MouseWheelEvent | 763 // MouseWheelEvent |
764 | 764 |
765 MouseWheelEvent::MouseWheelEvent(const base::NativeEvent& native_event) | 765 MouseWheelEvent::MouseWheelEvent(const base::NativeEvent& native_event) |
766 : MouseEvent(native_event), | 766 : MouseEvent(native_event), |
767 offset_(GetMouseWheelOffset(native_event)) { | 767 offset_(GetMouseWheelOffset(native_event)) { |
768 } | 768 } |
769 | 769 |
770 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) | 770 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 flags | EF_FROM_TOUCH), | 1446 flags | EF_FROM_TOUCH), |
1447 details_(details), | 1447 details_(details), |
1448 unique_touch_event_id_(unique_touch_event_id) { | 1448 unique_touch_event_id_(unique_touch_event_id) { |
1449 latency()->set_source_event_type(ui::SourceEventType::TOUCH); | 1449 latency()->set_source_event_type(ui::SourceEventType::TOUCH); |
1450 } | 1450 } |
1451 | 1451 |
1452 GestureEvent::~GestureEvent() { | 1452 GestureEvent::~GestureEvent() { |
1453 } | 1453 } |
1454 | 1454 |
1455 } // namespace ui | 1455 } // namespace ui |
OLD | NEW |