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

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

Issue 577833003: Revert of Clean up GestureEventDetails constructors and fix unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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.h" 5 #include "ui/events/gesture_detection/gesture_event_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 18 matching lines...) Expand all
29 raw_y(raw_y), 29 raw_y(raw_y),
30 flags(flags) { 30 flags(flags) {
31 DCHECK_GE(motion_event_id, 0); 31 DCHECK_GE(motion_event_id, 0);
32 DCHECK_NE(0U, touch_point_count); 32 DCHECK_NE(0U, touch_point_count);
33 this->details.set_touch_points(static_cast<int>(touch_point_count)); 33 this->details.set_touch_points(static_cast<int>(touch_point_count));
34 this->details.set_bounding_box(bounding_box); 34 this->details.set_bounding_box(bounding_box);
35 } 35 }
36 36
37 GestureEventData::GestureEventData(EventType type, 37 GestureEventData::GestureEventData(EventType type,
38 const GestureEventData& other) 38 const GestureEventData& other)
39 : details(type), 39 : details(type, 0, 0),
40 motion_event_id(other.motion_event_id), 40 motion_event_id(other.motion_event_id),
41 primary_tool_type(other.primary_tool_type), 41 primary_tool_type(other.primary_tool_type),
42 time(other.time), 42 time(other.time),
43 x(other.x), 43 x(other.x),
44 y(other.y), 44 y(other.y),
45 raw_x(other.raw_x), 45 raw_x(other.raw_x),
46 raw_y(other.raw_y), 46 raw_y(other.raw_y),
47 flags(other.flags) { 47 flags(other.flags) {
48 details.set_touch_points(other.details.touch_points()); 48 details.set_touch_points(other.details.touch_points());
49 details.set_bounding_box(other.details.bounding_box_f()); 49 details.set_bounding_box(other.details.bounding_box_f());
50 } 50 }
51 51
52 GestureEventData::GestureEventData() 52 GestureEventData::GestureEventData()
53 : motion_event_id(0), 53 : motion_event_id(0),
54 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN), 54 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN),
55 x(0), 55 x(0),
56 y(0), 56 y(0),
57 raw_x(0), 57 raw_x(0),
58 raw_y(0), 58 raw_y(0),
59 flags(EF_NONE) { 59 flags(EF_NONE) {
60 } 60 }
61 61
62 } // namespace ui 62 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/events/gesture_detection/gesture_event_data_packet_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698