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

Side by Side Diff: ui/events/gesture_detection/gesture_event_data_packet.cc

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gesture_detection/gesture_event_data_packet.h" 5 #include "ui/events/gesture_detection/gesture_event_data_packet.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/gesture_detection/motion_event.h" 8 #include "ui/events/gesture_detection/motion_event.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 const GestureEventDataPacket& other) { 60 const GestureEventDataPacket& other) {
61 timestamp_ = other.timestamp_; 61 timestamp_ = other.timestamp_;
62 gesture_count_ = other.gesture_count_; 62 gesture_count_ = other.gesture_count_;
63 gesture_source_ = other.gesture_source_; 63 gesture_source_ = other.gesture_source_;
64 touch_location_ = other.touch_location_; 64 touch_location_ = other.touch_location_;
65 std::copy(other.gestures_, other.gestures_ + other.gesture_count_, gestures_); 65 std::copy(other.gestures_, other.gestures_ + other.gesture_count_, gestures_);
66 return *this; 66 return *this;
67 } 67 }
68 68
69 void GestureEventDataPacket::Push(const GestureEventData& gesture) { 69 void GestureEventDataPacket::Push(const GestureEventData& gesture) {
70 DCHECK_NE(ET_UNKNOWN, gesture.type); 70 DCHECK_NE(ET_UNKNOWN, gesture.type());
71 CHECK_LT(gesture_count_, static_cast<size_t>(kMaxGesturesPerTouch)); 71 CHECK_LT(gesture_count_, static_cast<size_t>(kMaxGesturesPerTouch));
72 gestures_[gesture_count_++] = gesture; 72 gestures_[gesture_count_++] = gesture;
73 } 73 }
74 74
75 GestureEventDataPacket GestureEventDataPacket::FromTouch( 75 GestureEventDataPacket GestureEventDataPacket::FromTouch(
76 const ui::MotionEvent& touch) { 76 const ui::MotionEvent& touch) {
77 return GestureEventDataPacket(touch.GetEventTime(), 77 return GestureEventDataPacket(touch.GetEventTime(),
78 ToGestureSource(touch), 78 ToGestureSource(touch),
79 gfx::PointF(touch.GetX(), touch.GetY())); 79 gfx::PointF(touch.GetX(), touch.GetY()));
80 } 80 }
81 81
82 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout( 82 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout(
83 const GestureEventData& gesture) { 83 const GestureEventData& gesture) {
84 GestureEventDataPacket packet( 84 GestureEventDataPacket packet(
85 gesture.time, TOUCH_TIMEOUT, gfx::PointF(gesture.x, gesture.y)); 85 gesture.time, TOUCH_TIMEOUT, gfx::PointF(gesture.x, gesture.y));
86 packet.Push(gesture); 86 packet.Push(gesture);
87 return packet; 87 return packet;
88 } 88 }
89 89
90 } // namespace ui 90 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_event_data.cc ('k') | ui/events/gesture_detection/gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698