OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/time/time.h" |
| 10 |
| 11 namespace WebKit { |
| 12 |
| 13 class WebTouchEvent; |
| 14 |
| 15 } // namespace WebKit |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class ContentViewCoreImpl; |
| 20 |
| 21 class SyntheticTouchEventAndroid { |
| 22 public: |
| 23 // Enum values below need to be kept in sync with SyntheticTouchEvent.java |
| 24 enum Action { |
| 25 ActionInvalid = -1, |
| 26 ActionStart = 0, |
| 27 ActionMove = 1, |
| 28 ActionCancel = 2, |
| 29 ActionEnd = 3 |
| 30 }; |
| 31 |
| 32 SyntheticTouchEventAndroid(ContentViewCoreImpl* content_view_core); |
| 33 ~SyntheticTouchEventAndroid(); |
| 34 |
| 35 void SetPointer(int index, int x, int y, int id); |
| 36 void Inject(Action action, int pointer_count); |
| 37 void InjectWebTouchEvent(const WebKit::WebTouchEvent* web_touch); |
| 38 |
| 39 private: |
| 40 JNIEnv* env_; |
| 41 base::android::ScopedJavaGlobalRef<jobject> java_touch_event_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchEventAndroid); |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ |
OLD | NEW |