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

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

Issue 182383007: Make the ContentGestureProvider a ui::FilteredGestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lower similarity 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/filtered_gesture_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/filtered_gesture_provider.h
diff --git a/content/browser/renderer_host/input/content_gesture_provider.h b/ui/events/gesture_detection/filtered_gesture_provider.h
similarity index 48%
rename from content/browser/renderer_host/input/content_gesture_provider.h
rename to ui/events/gesture_detection/filtered_gesture_provider.h
index 4b240dd4b6f537998a50bd381b696d1d2a121dff..b1f71e3be58a92600c205fd2aaeccf1e0d94e793 100644
--- a/content/browser/renderer_host/input/content_gesture_provider.h
+++ b/ui/events/gesture_detection/filtered_gesture_provider.h
@@ -2,45 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_GESTURE_PROVIDER_H_
-#define CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_GESTURE_PROVIDER_H_
+#ifndef UI_EVENTS_GESTURE_DETECTION_FILTERED_GESTURE_PROVIDER_H_
+#define UI_EVENTS_GESTURE_DETECTION_FILTERED_GESTURE_PROVIDER_H_
#include "base/basictypes.h"
-#include "content/port/common/input_event_ack_state.h"
#include "ui/events/gesture_detection/gesture_event_data_packet.h"
#include "ui/events/gesture_detection/gesture_provider.h"
#include "ui/events/gesture_detection/touch_disposition_gesture_filter.h"
-namespace blink {
-class WebGestureEvent;
-}
+namespace ui {
-namespace content {
-
-class ContentGestureProviderClient {
- public:
- virtual ~ContentGestureProviderClient() {}
- virtual void OnGestureEvent(const blink::WebGestureEvent& event) = 0;
-};
-
-// Provides gesture detection and dispatch given a sequence of touch events
-// and touch event acks.
-class ContentGestureProvider : public ui::TouchDispositionGestureFilterClient,
- public ui::GestureProviderClient {
+// Provides filtered gesture detection and dispatch given a sequence of touch
+// events and touch event acks.
+class GESTURE_DETECTION_EXPORT FilteredGestureProvider
+ : public ui::TouchDispositionGestureFilterClient,
+ public ui::GestureProviderClient {
public:
- // TODO(jdduke): Move the scaling constant out of this class, instead hosting
- // it on the generating MotionEvent.
- ContentGestureProvider(ContentGestureProviderClient* client,
- float touch_to_gesture_scale);
+ // |client| will be offered all gestures detected by the |gesture_provider_|
+ // and allowed by the |gesture_filter_|.
+ FilteredGestureProvider(const GestureProvider::Config& config,
+ GestureProviderClient* client);
// Returns true if |event| was both valid and successfully handled by the
- // gesture detector. Otherwise, returns false, in which case the caller
+ // gesture provider. Otherwise, returns false, in which case the caller
// should drop |event|, not forwarding it to the renderer.
- bool OnTouchEvent(const ui::MotionEvent& event);
+ bool OnTouchEvent(const MotionEvent& event);
// To be called upon ack of an event that was forwarded after a successful
// call to |OnTouchEvent()|.
- void OnTouchEventAck(InputEventAckState ack_state);
+ void OnTouchEventAck(bool event_consumed);
// Methods delegated to |gesture_provider_|.
void ResetGestureDetectors();
@@ -50,14 +40,13 @@ class ContentGestureProvider : public ui::TouchDispositionGestureFilterClient,
const ui::MotionEvent* GetCurrentDownEvent() const;
private:
- // ui::GestureProviderClient
+ // GestureProviderClient implementation.
virtual void OnGestureEvent(const ui::GestureEventData& event) OVERRIDE;
- // TouchDispositionGestureFilterClient
+ // TouchDispositionGestureFilterClient implementation.
virtual void ForwardGestureEvent(const ui::GestureEventData& event) OVERRIDE;
- ContentGestureProviderClient* const client_;
- float touch_to_gesture_scale_;
+ GestureProviderClient* const client_;
ui::GestureProvider gesture_provider_;
ui::TouchDispositionGestureFilter gesture_filter_;
@@ -65,9 +54,9 @@ class ContentGestureProvider : public ui::TouchDispositionGestureFilterClient,
bool handling_event_;
ui::GestureEventDataPacket pending_gesture_packet_;
- DISALLOW_COPY_AND_ASSIGN(ContentGestureProvider);
+ DISALLOW_COPY_AND_ASSIGN(FilteredGestureProvider);
};
-} // namespace content
+} // namespace ui
-#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_CONTENT_GESTURE_PROVIDER_H_
+#endif // UI_EVENTS_GESTURE_DETECTION_FILTERED_GESTURE_PROVIDER_H_
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/filtered_gesture_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698