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

Unified Diff: ui/events/gesture_detection/ui_gesture_provider.h

Issue 251543003: Unified Gesture Recognizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows linking Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/gesture_detection/ui_gesture_provider.h
diff --git a/ui/events/gesture_detection/ui_gesture_provider.h b/ui/events/gesture_detection/ui_gesture_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c9bbc266038f0d7b9cf75e356edea5dd5ca4b3f
--- /dev/null
+++ b/ui/events/gesture_detection/ui_gesture_provider.h
@@ -0,0 +1,60 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_
+#define UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_
+
+#include "base/basictypes.h"
+#include "ui/events/event.h"
+#include "ui/events/events_export.h"
+#include "ui/events/gesture_detection/filtered_gesture_provider.h"
+#include "ui/events/gesture_detection/gesture_event_data_packet.h"
+#include "ui/events/gesture_detection/motion_event_ui.h"
+#include "ui/events/gesture_detection/touch_disposition_gesture_filter.h"
+
+namespace ui {
+
+class EVENTS_EXPORT UIGestureProviderClient {
+ public:
+ virtual ~UIGestureProviderClient() {}
+ virtual void OnGestureEvent(GestureEvent* event) = 0;
jdduke (slow) 2014/05/02 17:56:43 scoped_ptr?
tdresser 2014/05/05 15:42:35 Yeah, that probably is clearer. I've let the Gestu
+};
+
+// Provides gesture detection and dispatch given a sequence of touch events
+// and touch event acks.
+class EVENTS_EXPORT UIGestureProvider : public FilteredGestureProvider {
jdduke (slow) 2014/05/02 17:56:43 GestureProviderAura?
tdresser 2014/05/05 15:42:35 Done.
+ public:
jdduke (slow) 2014/05/02 17:56:43 Hmm, can we compose FilteredGestureProvider and in
tdresser 2014/05/05 15:42:35 Much, much better. Thanks for catching that! Done.
+ bool OnTouchEvent(const TouchEvent& event);
+ static UIGestureProvider* Create(UIGestureProviderClient* client);
+ virtual ~UIGestureProvider();
+ const MotionEventUI& get_pointer_state() { return motion_event_; }
+
+ private:
+ class GestureProviderClientConverter : public ui::GestureProviderClient {
+ public:
+ GestureProviderClientConverter(UIGestureProviderClient* client)
+ : client_(client), flags_(0) {}
+
+ virtual ~GestureProviderClientConverter() {}
+
+ virtual void OnGestureEvent(const GestureEventData& gesture) OVERRIDE;
+ void set_flags(int flags) { flags_ = flags; }
+
+ private:
+ UIGestureProviderClient* client_;
+ int flags_;
+
+ DISALLOW_COPY_AND_ASSIGN(GestureProviderClientConverter);
+ };
+
+ UIGestureProvider(scoped_ptr<GestureProviderClientConverter> converter);
+ scoped_ptr<GestureProviderClientConverter> converter_;
+ MotionEventUI motion_event_;
+
+ DISALLOW_COPY_AND_ASSIGN(UIGestureProvider);
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_GESTURE_DETECTION_UI_GESTURE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698