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

Unified Diff: content/browser/android/content_view_core_impl.h

Issue 128613003: [Tracking Patch] Unified gesture detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address tdresser@ comments and run clang-format on everything 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
Index: content/browser/android/content_view_core_impl.h
diff --git a/content/browser/android/content_view_core_impl.h b/content/browser/android/content_view_core_impl.h
index 9299f1c8a5af8448dbb3a4a5977a4f43a39848cf..c903f7e2f67b2f825f6e5c86db6c89a3c50d8939 100644
--- a/content/browser/android/content_view_core_impl.h
+++ b/content/browser/android/content_view_core_impl.h
@@ -14,7 +14,7 @@
#include "base/i18n/rtl.h"
#include "base/memory/scoped_ptr.h"
#include "base/process/process.h"
-#include "content/browser/renderer_host/input/touch_disposition_gesture_filter.h"
+#include "content/browser/renderer_host/input/content_gesture_provider.h"
#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/android/content_view_core.h"
@@ -34,11 +34,12 @@ class WindowAndroid;
namespace content {
class RenderWidgetHostViewAndroid;
struct MenuItem;
+struct NativeWebTouchEvent;
// TODO(jrg): this is a shell. Upstream the rest.
class ContentViewCoreImpl : public ContentViewCore,
+ public ContentGestureProviderClient,
public NotificationObserver,
- public TouchDispositionGestureFilterClient,
public WebContentsObserver {
public:
static ContentViewCoreImpl* FromWebContents(WebContents* web_contents);
@@ -97,10 +98,9 @@ class ContentViewCoreImpl : public ContentViewCore,
JNIEnv* env, jobject obj) const;
jboolean IsIncognito(JNIEnv* env, jobject obj);
void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation);
- void OnTouchEventHandlingBegin(JNIEnv* env,
- jobject obj,
- jobject motion_event);
- void OnTouchEventHandlingEnd(JNIEnv* env, jobject obj);
+ jboolean OnTouchEvent(JNIEnv* env,
+ jobject obj,
+ jobject motion_event);
jboolean SendMouseMoveEvent(JNIEnv* env,
jobject obj,
jlong time_ms,
@@ -123,22 +123,11 @@ class ContentViewCoreImpl : public ContentViewCore,
void SingleTap(JNIEnv* env, jobject obj, jlong time_ms,
jfloat x, jfloat y,
jboolean disambiguation_popup_tap);
- void SingleTapUnconfirmed(JNIEnv* env, jobject obj, jlong time_ms,
- jfloat x, jfloat y);
- void ShowPress(JNIEnv* env, jobject obj, jlong time_ms,
- jfloat x, jfloat y);
- void TapCancel(JNIEnv* env, jobject obj, jlong time_ms,
- jfloat x, jfloat y);
- void TapDown(JNIEnv* env, jobject obj, jlong time_ms,
- jfloat x, jfloat y);
void DoubleTap(JNIEnv* env, jobject obj, jlong time_ms,
jfloat x, jfloat y) ;
void LongPress(JNIEnv* env, jobject obj, jlong time_ms,
jfloat x, jfloat y,
jboolean disambiguation_popup_tap);
- void LongTap(JNIEnv* env, jobject obj, jlong time_ms,
- jfloat x, jfloat y,
- jboolean disambiguation_popup_tap);
void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jfloat x, jfloat y);
void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms);
void PinchBy(JNIEnv* env, jobject obj, jlong time_ms,
@@ -148,6 +137,18 @@ class ContentViewCoreImpl : public ContentViewCore,
jfloat x2, jfloat y2);
void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y);
+ void ResetGestureDetectors(JNIEnv* env, jobject obj);
+ void IgnoreRemainingTouchEvents(JNIEnv* env, jobject obj);
+ void OnWindowFocusLost(JNIEnv* env, jobject obj);
+ void UpdateDoubleTapSupportForPage(JNIEnv* env,
+ jobject obj,
+ jboolean has_support);
+ void UpdateDoubleTapSupport(JNIEnv* env, jobject obj, jboolean has_support);
+ void UpdateMultiTouchZoomSupport(JNIEnv* env,
+ jobject obj,
+ jboolean has_support);
+ jboolean IsScrollOrPinchInProgress(JNIEnv* env, jobject obj);
+
void LoadIfNecessary(JNIEnv* env, jobject obj);
void RequestRestoreLoad(JNIEnv* env, jobject obj);
void StopLoading(JNIEnv* env, jobject obj);
@@ -222,12 +223,6 @@ class ContentViewCoreImpl : public ContentViewCore,
jobject jsurface);
void DetachExternalVideoSurface(JNIEnv* env, jobject obj, jint player_id);
void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled);
- void SendActionAfterDoubleTapUma(JNIEnv* env,
- jobject obj,
- jint type,
- jboolean has_delay,
- jint count);
- void SendSingleTapUma(JNIEnv* env, jobject obj, jint type, jint count);
void ExtractSmartClipData(JNIEnv* env,
jobject obj,
@@ -336,9 +331,8 @@ class ContentViewCoreImpl : public ContentViewCore,
virtual void RenderViewReady() OVERRIDE;
virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
- // TouchDispositionGestureFilterClient implementation.
- virtual void ForwardGestureEvent(
- const blink::WebGestureEvent& event) OVERRIDE;
+ // ContentGestureProviderClient implementation.
+ virtual void OnGestureEvent(const blink::WebGestureEvent& event) OVERRIDE;
// --------------------------------------------------------------------------
// Other private methods and data
@@ -361,7 +355,6 @@ class ContentViewCoreImpl : public ContentViewCore,
void DeleteScaledSnapshotTexture();
void SendGestureEvent(const blink::WebGestureEvent& event);
- void SendSyntheticGestureEvent(const blink::WebGestureEvent& event);
// Update focus state of the RenderWidgetHostView.
void SetFocusInternal(bool focused);
@@ -401,11 +394,7 @@ class ContentViewCoreImpl : public ContentViewCore,
bool geolocation_needs_pause_;
- // Handles gesture dispatch as the generating touch events are ack'ed.
- TouchDispositionGestureFilter touch_disposition_gesture_filter_;
- bool handling_touch_event_;
- blink::WebTouchEvent pending_touch_event_;
- GestureEventPacket pending_gesture_packet_;
+ scoped_ptr<ContentGestureProvider> gesture_provider_;
DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
};

Powered by Google App Engine
This is Rietveld 408576698