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

Unified Diff: blimp/client/android/blimp_view.h

Issue 1430623004: blimp: Add support for input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: blimp/client/android/blimp_view.h
diff --git a/blimp/client/android/blimp_view.h b/blimp/client/android/blimp_view.h
index bd5302f7ab7f18b6d9d0b363a6150552603523e3..9b1bb32a51d235c4e03c9f924e59178f855f6eed 100644
--- a/blimp/client/android/blimp_view.h
+++ b/blimp/client/android/blimp_view.h
@@ -8,6 +8,7 @@
#include "base/android/jni_android.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/events/gesture_detection/filtered_gesture_provider.h"
namespace gfx {
class Size;
@@ -20,7 +21,7 @@ class BlimpCompositorAndroid;
// The native component of org.chromium.blimp.BlimpView. This builds and
// maintains a BlimpCompositorAndroid and handles notifying the compositor of
// SurfaceView surface changes (size, creation, destruction, etc.).
-class BlimpView {
+class BlimpView : public ui::GestureProviderClient {
public:
static bool RegisterJni(JNIEnv* env);
@@ -47,6 +48,35 @@ class BlimpView {
void OnSurfaceCreated(JNIEnv* env, jobject jobj);
void OnSurfaceDestroyed(JNIEnv* env, jobject jobj);
void SetVisibility(JNIEnv* env, jobject jobj, jboolean visible);
+ jboolean OnTouchEvent(JNIEnv* env,
+ jobject obj,
+ jobject motion_event,
+ jlong time_ms,
+ jint android_action,
+ jint pointer_count,
+ jint history_size,
+ jint action_index,
+ jfloat pos_x_0,
+ jfloat pos_y_0,
+ jfloat pos_x_1,
+ jfloat pos_y_1,
+ jint pointer_id_0,
+ jint pointer_id_1,
+ jfloat touch_major_0,
+ jfloat touch_major_1,
+ jfloat touch_minor_0,
+ jfloat touch_minor_1,
+ jfloat orientation_0,
+ jfloat orientation_1,
+ jfloat raw_pos_x,
+ jfloat raw_pos_y,
+ jint android_tool_type_0,
+ jint android_tool_type_1,
+ jint android_button_state,
+ jint android_meta_state);
+
+ // ui::GestureProviderClient implementation.
+ void OnGestureEvent(const ui::GestureEventData& gesture) override;
private:
virtual ~BlimpView();
@@ -54,8 +84,14 @@ class BlimpView {
// Reference to the Java object which owns this class.
base::android::ScopedJavaGlobalRef<jobject> java_obj_;
+ float device_scale_factor_;
David Trainor- moved to gerrit 2015/11/02 16:55:30 const?
Khushal 2015/12/01 08:22:25 Done.
+
scoped_ptr<BlimpCompositorAndroid> compositor_;
+ // Provides gesture synthesis given a stream of touch events (derived from
+ // Android MotionEvent's) and touch event acks.
+ ui::FilteredGestureProvider gesture_provider_;
+
// The format of the current surface owned by |compositor_|. See
// android.graphics.PixelFormat.java.
int current_surface_format_;

Powered by Google App Engine
This is Rietveld 408576698