Index: content/browser/renderer_host/synthetic_touch_event_android.h |
diff --git a/content/browser/renderer_host/synthetic_touch_event_android.h b/content/browser/renderer_host/synthetic_touch_event_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d5748c39a2676027792547e53e750b30bab6c28 |
--- /dev/null |
+++ b/content/browser/renderer_host/synthetic_touch_event_android.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
+ |
+#include "base/android/jni_android.h" |
+#include "base/time/time.h" |
+ |
+namespace WebKit { |
+ |
+class WebTouchEvent; |
+ |
+} // namespace WebKit |
+ |
+namespace content { |
+ |
+class ContentViewCoreImpl; |
+ |
+class SyntheticTouchEventAndroid { |
+ public: |
+ // Below need to be keep in sync with SyntheticTouchEvent.java |
+ enum Action { |
+ ActionInvalid = -1, |
+ ActionStart = 0, |
+ ActionMove = 1, |
+ ActionCancel = 2, |
+ ActionEnd = 3 |
+ }; |
+ |
+ SyntheticTouchEventAndroid(ContentViewCoreImpl* content_view_core); |
+ ~SyntheticTouchEventAndroid(); |
+ |
+ void reset(); |
+ long GetCurrentTime(); |
+ void SetDownTime(long downTime); |
+ void AddPointer(int x, int y, int id); |
+ void Inject(Action action); |
+ void InjectWebTouchEvent(const WebKit::WebTouchEvent* web_touch); |
+ |
+ private: |
+ JNIEnv* env_; |
+ base::android::ScopedJavaGlobalRef<jobject> java_touch_event_; |
+ int savedDownTime_; |
Dominik Grewe
2013/10/10 14:01:45
Should this be saved_down_time_? Or do we have oth
kouhei (in TOK)
2013/10/15 02:10:02
Done. I just got confused switching back and forth
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(SyntheticTouchEventAndroid); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |