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

Side by Side Diff: content/browser/renderer_host/input/gesture_event_packet.h

Issue 120513005: [Android] Perform eager gesture recognition on MotionEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More testing Created 6 years, 10 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_
7
8 #include "content/common/content_export.h"
9 #include "third_party/WebKit/public/web/WebInputEvent.h"
10
11 namespace content {
12
13 // Acts as a transport container for gestures created (directly or indirectly)
14 // by a touch event.
15 class CONTENT_EXPORT GestureEventPacket {
16 public:
17 enum GestureSource {
18 INVALID = -1, // Used only for a default-constructed packet..
19 TOUCH_BEGIN, // The start of a new gesture sequence.
20 TOUCH, // Continuation of an existing gesture sequence.
21 TOUCH_TIMEOUT, // Timeout from an existing gesture sequence.
22 };
23
24 GestureEventPacket();
25 ~GestureEventPacket();
26
27 // Factory methods for creating a packet from a particular event.
28 static GestureEventPacket FromTouch(const blink::WebTouchEvent& event);
29 static GestureEventPacket FromTouchTimeout(
30 const blink::WebGestureEvent& event);
31
32 void Push(const blink::WebGestureEvent& gesture);
33
34 const blink::WebGestureEvent& gesture(size_t i) const { return gestures_[i]; }
35 size_t gesture_count() const { return gesture_count_; }
36 GestureSource gesture_source() const { return gesture_source_; }
37
38 private:
39 explicit GestureEventPacket(GestureSource source);
40
41 enum { kMaxGesturesPerTouch = 5 };
42 blink::WebGestureEvent gestures_[kMaxGesturesPerTouch];
43 size_t gesture_count_;
44 GestureSource gesture_source_;
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/input/gesture_event_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698