Chromium Code Reviews| 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..4ce8ba7000afbff66a9c0679ed19275a0faf7759 |
| --- /dev/null |
| +++ b/content/browser/renderer_host/synthetic_touch_event_android.h |
| @@ -0,0 +1,48 @@ |
| +// 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_ |
|
jdduke (slow)
2013/10/21 19:30:40
Can we move this to renderer_host/input?
kouhei (in TOK)
2013/10/25 15:10:18
Done.
|
| +#define CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
| + |
| +#include "base/android/jni_android.h" |
| +#include "base/time/time.h" |
| + |
| +namespace WebKit { |
| + |
|
jdduke (slow)
2013/10/21 23:05:45
Nit: Remove lines before/after "class WebTouchEven
kouhei (in TOK)
2013/10/25 15:10:18
Done.
|
| +class WebTouchEvent; |
| + |
| +} // namespace WebKit |
| + |
| +namespace content { |
| + |
| +class ContentViewCoreImpl; |
| + |
| +class SyntheticTouchEventAndroid { |
|
jdduke (slow)
2013/10/21 23:05:45
I wonder if we want to add something else to the n
|
| + public: |
| + // Enum values below need to be kept in sync with SyntheticTouchEvent.java |
| + enum Action { |
| + ActionInvalid = -1, |
| + ActionStart = 0, |
| + ActionMove = 1, |
| + ActionCancel = 2, |
| + ActionEnd = 3 |
| + }; |
| + |
| + SyntheticTouchEventAndroid(ContentViewCoreImpl* content_view_core); |
| + ~SyntheticTouchEventAndroid(); |
| + |
| + void SetPointer(int index, int x, int y, int id); |
|
jdduke (slow)
2013/10/21 23:05:45
Nit: Please make SetPointer/Inject private, and th
kouhei (in TOK)
2013/10/25 15:10:18
Done.
|
| + void Inject(Action action, int pointer_count); |
| + void InjectWebTouchEvent(const WebKit::WebTouchEvent* web_touch); |
| + |
| + private: |
| + JNIEnv* env_; |
| + base::android::ScopedJavaGlobalRef<jobject> java_touch_event_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SyntheticTouchEventAndroid); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |