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

Side by Side Diff: ui/base/gestures/gesture_types.cc

Issue 10837329: gesture: Include velocity in scroll-update gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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/base/gestures/gesture_types.h" 5 #include "ui/base/gestures/gesture_types.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 GestureEventDetails::GestureEventDetails(ui::EventType type, 9 GestureEventDetails::GestureEventDetails(ui::EventType type,
10 float delta_x, 10 float delta_x,
(...skipping 27 matching lines...) Expand all
38 data.swipe.up = delta_y < 0; 38 data.swipe.up = delta_y < 0;
39 data.swipe.down = delta_y > 0; 39 data.swipe.down = delta_y > 0;
40 break; 40 break;
41 41
42 case ui::ET_GESTURE_TAP: 42 case ui::ET_GESTURE_TAP:
43 data.tap_count = static_cast<int>(delta_x); 43 data.tap_count = static_cast<int>(delta_x);
44 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap."; 44 CHECK_EQ(0.f, delta_y) << "Unknown data in delta_y for tap.";
45 break; 45 break;
46 46
47 default: 47 default:
48 data.generic.delta_x = delta_x;
49 data.generic.delta_y = delta_y;
50 if (delta_x != 0.f || delta_y != 0.f) { 48 if (delta_x != 0.f || delta_y != 0.f) {
51 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: (" 49 DLOG(WARNING) << "A gesture event (" << type << ") had unknown data: ("
52 << delta_x << "," << delta_y; 50 << delta_x << "," << delta_y;
53 } 51 }
54 break; 52 break;
55 } 53 }
56 } 54 }
57 55
56 void GestureEventDetails::SetScrollVelocity(float velocity_x,
57 float velocity_y) {
58 CHECK_EQ(ui::ET_GESTURE_SCROLL_UPDATE, type_);
59 data.scroll.velocity_x = velocity_x;
60 data.scroll.velocity_y = velocity_y;
61 }
62
58 } // namespace ui 63 } // namespace ui
OLDNEW
« ui/base/gestures/gesture_types.h ('K') | « ui/base/gestures/gesture_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698