Chromium Code Reviews| 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 // Below need to be keep 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 reset(); | |
| 36 long GetCurrentTime(); | |
| 37 void SetDownTime(long downTime); | |
| 38 void AddPointer(int x, int y, int id); | |
| 39 void Inject(Action action); | |
| 40 void InjectWebTouchEvent(const WebKit::WebTouchEvent* web_touch); | |
| 41 | |
| 42 private: | |
| 43 JNIEnv* env_; | |
| 44 base::android::ScopedJavaGlobalRef<jobject> java_touch_event_; | |
| 45 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
| |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchEventAndroid); | |
| 48 }; | |
| 49 | |
| 50 } // namespace content | |
| 51 | |
| 52 #endif // CONTENT_BROWSER_RENDERER_HOST_SYNTHETIC_TOUCH_EVENT_ANDROID_H_ | |
| OLD | NEW |