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

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: styles Created 7 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 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 ScopedJavaLocalRef<jobject> java_bitmap = 572 ScopedJavaLocalRef<jobject> java_bitmap =
573 gfx::ConvertToJavaBitmap(&zoomed_bitmap); 573 gfx::ConvertToJavaBitmap(&zoomed_bitmap);
574 DCHECK(!java_bitmap.is_null()); 574 DCHECK(!java_bitmap.is_null());
575 575
576 Java_ContentViewCore_showDisambiguationPopup(env, 576 Java_ContentViewCore_showDisambiguationPopup(env,
577 obj.obj(), 577 obj.obj(),
578 rect_object.obj(), 578 rect_object.obj(),
579 java_bitmap.obj()); 579 java_bitmap.obj());
580 } 580 }
581 581
582 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateSyntheticTouchEvent() {
583 JNIEnv* env = AttachCurrentThread();
584
585 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
586 if (obj.is_null())
587 return ScopedJavaLocalRef<jobject>();
588 return Java_ContentViewCore_createSyntheticTouchEvent(env, obj.obj());
589 }
590
582 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture( 591 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture(
583 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) { 592 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) {
584 JNIEnv* env = AttachCurrentThread(); 593 JNIEnv* env = AttachCurrentThread();
585 594
586 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 595 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
587 if (obj.is_null()) 596 if (obj.is_null())
588 return ScopedJavaLocalRef<jobject>(); 597 return ScopedJavaLocalRef<jobject>();
589 return Java_ContentViewCore_createOnePointTouchGesture( 598 return Java_ContentViewCore_createOnePointTouchGesture(
590 env, obj.obj(), start_x, start_y, delta_x, delta_y); 599 env, obj.obj(), start_x, start_y, delta_x, delta_y);
591 } 600 }
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 reinterpret_cast<ui::ViewAndroid*>(view_android), 1604 reinterpret_cast<ui::ViewAndroid*>(view_android),
1596 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1605 reinterpret_cast<ui::WindowAndroid*>(window_android));
1597 return reinterpret_cast<jint>(view); 1606 return reinterpret_cast<jint>(view);
1598 } 1607 }
1599 1608
1600 bool RegisterContentViewCore(JNIEnv* env) { 1609 bool RegisterContentViewCore(JNIEnv* env) {
1601 return RegisterNativesImpl(env); 1610 return RegisterNativesImpl(env);
1602 } 1611 }
1603 1612
1604 } // namespace content 1613 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698