Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Side by Side Diff: ui/events/event.cc

Issue 2720133002: Make pinch zoom work on chromeos by setting touch id correctly (Closed)
Patch Set: pinch zoom Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 f &= ~EF_IS_TRIPLE_CLICK; 755 f &= ~EF_IS_TRIPLE_CLICK;
756 break; 756 break;
757 case 3: 757 case 3:
758 f &= ~EF_IS_DOUBLE_CLICK; 758 f &= ~EF_IS_DOUBLE_CLICK;
759 f |= EF_IS_TRIPLE_CLICK; 759 f |= EF_IS_TRIPLE_CLICK;
760 break; 760 break;
761 } 761 }
762 set_flags(f); 762 set_flags(f);
763 } 763 }
764 764
765 void MouseEvent::set_pointer_details(const PointerDetails& details) {
766 DCHECK_NE(EventPointerType::POINTER_TYPE_TOUCH,
767 pointer_details_.pointer_type);
768 DCHECK_NE(EventPointerType::POINTER_TYPE_TOUCH, details.pointer_type);
769 DCHECK(pointer_details_.id == PointerEvent::kMousePointerId ||
770 details.id != PointerEvent::kMousePointerId);
771 pointer_details_ = details;
772 }
773
765 //////////////////////////////////////////////////////////////////////////////// 774 ////////////////////////////////////////////////////////////////////////////////
766 // MouseWheelEvent 775 // MouseWheelEvent
767 776
768 MouseWheelEvent::MouseWheelEvent(const base::NativeEvent& native_event) 777 MouseWheelEvent::MouseWheelEvent(const base::NativeEvent& native_event)
769 : MouseEvent(native_event), 778 : MouseEvent(native_event),
770 offset_(GetMouseWheelOffset(native_event)) { 779 offset_(GetMouseWheelOffset(native_event)) {
771 } 780 }
772 781
773 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event) 782 MouseWheelEvent::MouseWheelEvent(const ScrollEvent& scroll_event)
774 : MouseEvent(scroll_event), 783 : MouseEvent(scroll_event),
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 static_cast<EventResult>(result() | ER_DISABLE_SYNC_HANDLING)); 974 static_cast<EventResult>(result() | ER_DISABLE_SYNC_HANDLING));
966 } 975 }
967 976
968 void TouchEvent::FixRotationAngle() { 977 void TouchEvent::FixRotationAngle() {
969 while (rotation_angle_ < 0) 978 while (rotation_angle_ < 0)
970 rotation_angle_ += 180; 979 rotation_angle_ += 180;
971 while (rotation_angle_ >= 180) 980 while (rotation_angle_ >= 180)
972 rotation_angle_ -= 180; 981 rotation_angle_ -= 180;
973 } 982 }
974 983
984 void TouchEvent::set_pointer_details(const PointerDetails& pointer_details) {
985 DCHECK_EQ(pointer_details_.id, pointer_details.id);
986 pointer_details_ = pointer_details;
987 }
988
975 //////////////////////////////////////////////////////////////////////////////// 989 ////////////////////////////////////////////////////////////////////////////////
976 // PointerEvent 990 // PointerEvent
977 991
978 bool PointerEvent::CanConvertFrom(const Event& event) { 992 bool PointerEvent::CanConvertFrom(const Event& event) {
979 switch (event.type()) { 993 switch (event.type()) {
980 case ET_MOUSE_PRESSED: 994 case ET_MOUSE_PRESSED:
981 case ET_MOUSE_DRAGGED: 995 case ET_MOUSE_DRAGGED:
982 case ET_MOUSE_MOVED: 996 case ET_MOUSE_MOVED:
983 case ET_MOUSE_ENTERED: 997 case ET_MOUSE_ENTERED:
984 case ET_MOUSE_EXITED: 998 case ET_MOUSE_EXITED:
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 flags | EF_FROM_TOUCH), 1465 flags | EF_FROM_TOUCH),
1452 details_(details), 1466 details_(details),
1453 unique_touch_event_id_(unique_touch_event_id) { 1467 unique_touch_event_id_(unique_touch_event_id) {
1454 latency()->set_source_event_type(ui::SourceEventType::TOUCH); 1468 latency()->set_source_event_type(ui::SourceEventType::TOUCH);
1455 } 1469 }
1456 1470
1457 GestureEvent::~GestureEvent() { 1471 GestureEvent::~GestureEvent() {
1458 } 1472 }
1459 1473
1460 } // namespace ui 1474 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698