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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 26664002: SyntheticGestureTarget implementation for injecting synthetic input events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase_wip Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 ScopedJavaLocalRef<jobject> java_bitmap = 583 ScopedJavaLocalRef<jobject> java_bitmap =
584 gfx::ConvertToJavaBitmap(&zoomed_bitmap); 584 gfx::ConvertToJavaBitmap(&zoomed_bitmap);
585 DCHECK(!java_bitmap.is_null()); 585 DCHECK(!java_bitmap.is_null());
586 586
587 Java_ContentViewCore_showDisambiguationPopup(env, 587 Java_ContentViewCore_showDisambiguationPopup(env,
588 obj.obj(), 588 obj.obj(),
589 rect_object.obj(), 589 rect_object.obj(),
590 java_bitmap.obj()); 590 java_bitmap.obj());
591 } 591 }
592 592
593 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateSyntheticTouchEvent() {
594 JNIEnv* env = AttachCurrentThread();
595
596 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
597 if (obj.is_null())
598 return ScopedJavaLocalRef<jobject>();
599 return Java_ContentViewCore_createSyntheticTouchEvent(env, obj.obj());
600 }
601
593 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture( 602 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture(
594 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) { 603 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) {
595 JNIEnv* env = AttachCurrentThread(); 604 JNIEnv* env = AttachCurrentThread();
596 605
597 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 606 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
598 if (obj.is_null()) 607 if (obj.is_null())
599 return ScopedJavaLocalRef<jobject>(); 608 return ScopedJavaLocalRef<jobject>();
600 return Java_ContentViewCore_createOnePointTouchGesture( 609 return Java_ContentViewCore_createOnePointTouchGesture(
601 env, obj.obj(), start_x, start_y, delta_x, delta_y); 610 env, obj.obj(), start_x, start_y, delta_x, delta_y);
602 } 611 }
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 reinterpret_cast<ui::ViewAndroid*>(view_android), 1638 reinterpret_cast<ui::ViewAndroid*>(view_android),
1630 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1639 reinterpret_cast<ui::WindowAndroid*>(window_android));
1631 return reinterpret_cast<jint>(view); 1640 return reinterpret_cast<jint>(view);
1632 } 1641 }
1633 1642
1634 bool RegisterContentViewCore(JNIEnv* env) { 1643 bool RegisterContentViewCore(JNIEnv* env) {
1635 return RegisterNativesImpl(env); 1644 return RegisterNativesImpl(env);
1636 } 1645 }
1637 1646
1638 } // namespace content 1647 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698