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

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

Issue 1430623004: blimp: Add support for input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build error. Created 5 years 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
« no previous file with comments | « blimp/client/android/blimp_view.h ('k') | blimp/client/android/java/src/org/chromium/blimp/BlimpView.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/android/blimp_view.cc
diff --git a/blimp/client/android/blimp_view.cc b/blimp/client/android/blimp_view.cc
index cec7e3a64b213e6e490c70bcd606bd10fda7866c..79633f799bdbfc37c3af0c7aa40234274a726eff 100644
--- a/blimp/client/android/blimp_view.cc
+++ b/blimp/client/android/blimp_view.cc
@@ -8,6 +8,7 @@
#include "blimp/client/compositor/blimp_compositor_android.h"
#include "jni/BlimpView_jni.h"
+#include "ui/events/android/motion_event_android.h"
#include "ui/gfx/geometry/size.h"
namespace blimp {
@@ -35,7 +36,8 @@ BlimpView::BlimpView(JNIEnv* env,
const gfx::Size& real_size,
const gfx::Size& size,
float dp_to_px)
- : compositor_(BlimpCompositorAndroid::Create(real_size, size, dp_to_px)),
+ : device_scale_factor_(dp_to_px),
+ compositor_(BlimpCompositorAndroid::Create(real_size, size, dp_to_px)),
current_surface_format_(0),
window_(gfx::kNullAcceleratedWidget) {
java_obj_.Reset(env, jobj);
@@ -94,4 +96,66 @@ void BlimpView::ReleaseAcceleratedWidget() {
window_ = gfx::kNullAcceleratedWidget;
}
+jboolean BlimpView::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 tilt_0,
+ jfloat tilt_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::MotionEventAndroid::Pointer pointer0(pointer_id_0,
+ pos_x_0,
+ pos_y_0,
+ touch_major_0,
+ touch_minor_0,
+ orientation_0,
+ tilt_0,
+ android_tool_type_0);
+ ui::MotionEventAndroid::Pointer pointer1(pointer_id_1,
+ pos_x_1,
+ pos_y_1,
+ touch_major_1,
+ touch_minor_1,
+ orientation_1,
+ tilt_1,
+ android_tool_type_1);
+ ui::MotionEventAndroid event(1.f / device_scale_factor_,
+ env,
+ motion_event,
+ time_ms,
+ android_action,
+ pointer_count,
+ history_size,
+ action_index,
+ android_button_state,
+ android_meta_state,
+ raw_pos_x - pos_x_0,
+ raw_pos_y - pos_y_0,
+ pointer0,
+ pointer1);
+
+ return compositor_->OnTouchEvent(event);
+}
+
} // namespace blimp
« no previous file with comments | « blimp/client/android/blimp_view.h ('k') | blimp/client/android/java/src/org/chromium/blimp/BlimpView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698