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

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

Issue 302463004: Implementing the dispatch of the swipe gesture for one-finger touch swipes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementing review feedback. 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
« no previous file with comments | « ui/events/gesture_event_details.h ('k') | ui/events/gestures/gesture_sequence.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 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_event_details.h" 5 #include "ui/events/gesture_event_details.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 GestureEventDetails::GestureEventDetails() : type_(ET_UNKNOWN) {} 9 GestureEventDetails::GestureEventDetails() : type_(ET_UNKNOWN) {}
10 10
(...skipping 21 matching lines...) Expand all
32 case ui::ET_GESTURE_TWO_FINGER_TAP: 32 case ui::ET_GESTURE_TWO_FINGER_TAP:
33 data.first_finger_enclosing_rectangle.width = delta_x; 33 data.first_finger_enclosing_rectangle.width = delta_x;
34 data.first_finger_enclosing_rectangle.height = delta_y; 34 data.first_finger_enclosing_rectangle.height = delta_y;
35 break; 35 break;
36 36
37 case ui::ET_GESTURE_PINCH_UPDATE: 37 case ui::ET_GESTURE_PINCH_UPDATE:
38 data.scale = delta_x; 38 data.scale = delta_x;
39 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for pinch"; 39 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for pinch";
40 break; 40 break;
41 41
42 case ui::ET_GESTURE_MULTIFINGER_SWIPE: 42 case ui::ET_GESTURE_SWIPE:
43 data.swipe.left = delta_x < 0; 43 data.swipe.left = delta_x < 0;
44 data.swipe.right = delta_x > 0; 44 data.swipe.right = delta_x > 0;
45 data.swipe.up = delta_y < 0; 45 data.swipe.up = delta_y < 0;
46 data.swipe.down = delta_y > 0; 46 data.swipe.down = delta_y > 0;
47 break; 47 break;
48 48
49 case ui::ET_GESTURE_TAP: 49 case ui::ET_GESTURE_TAP:
50 case ui::ET_GESTURE_DOUBLE_TAP: 50 case ui::ET_GESTURE_DOUBLE_TAP:
51 case ui::ET_GESTURE_TAP_UNCONFIRMED: 51 case ui::ET_GESTURE_TAP_UNCONFIRMED:
52 data.tap_count = static_cast<int>(delta_x); 52 data.tap_count = static_cast<int>(delta_x);
53 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap."; 53 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap.";
54 break; 54 break;
55 55
56 default: 56 default:
57 if (delta_x != 0.f || delta_y != 0.f) { 57 if (delta_x != 0.f || delta_y != 0.f) {
58 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: (" 58 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: ("
59 << delta_x << "," << delta_y; 59 << delta_x << "," << delta_y;
60 } 60 }
61 break; 61 break;
62 } 62 }
63 } 63 }
64 64
65 GestureEventDetails::Details::Details() { 65 GestureEventDetails::Details::Details() {
66 memset(this, 0, sizeof(Details)); 66 memset(this, 0, sizeof(Details));
67 } 67 }
68 68
69 } // namespace ui 69 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_event_details.h ('k') | ui/events/gestures/gesture_sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698