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

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

Issue 11195033: Upstream hooks for javascript touch handlers on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 void ContentViewCoreImpl::ConfirmTouchEvent(bool handled) { 373 void ContentViewCoreImpl::ConfirmTouchEvent(bool handled) {
374 JNIEnv* env = AttachCurrentThread(); 374 JNIEnv* env = AttachCurrentThread();
375 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 375 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
376 if (j_obj.is_null()) 376 if (j_obj.is_null())
377 return; 377 return;
378 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), handled); 378 Java_ContentViewCore_confirmTouchEvent(env, j_obj.obj(), handled);
379 } 379 }
380 380
381 void ContentViewCoreImpl::DidSetNeedTouchEvents(bool need_touch_events) { 381 void ContentViewCoreImpl::HasTouchEventHandlers(bool need_touch_events) {
382 JNIEnv* env = AttachCurrentThread(); 382 JNIEnv* env = AttachCurrentThread();
383 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); 383 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
384 if (j_obj.is_null()) 384 if (j_obj.is_null())
385 return; 385 return;
386 Java_ContentViewCore_didSetNeedTouchEvents(env, 386 Java_ContentViewCore_hasTouchEventHandlers(env,
387 j_obj.obj(), 387 j_obj.obj(),
388 need_touch_events); 388 need_touch_events);
389 } 389 }
390 390
391 bool ContentViewCoreImpl::HasFocus() { 391 bool ContentViewCoreImpl::HasFocus() {
392 JNIEnv* env = AttachCurrentThread(); 392 JNIEnv* env = AttachCurrentThread();
393 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 393 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
394 if (obj.is_null()) 394 if (obj.is_null())
395 return false; 395 return false;
396 return Java_ContentViewCore_hasFocus(env, obj.obj()); 396 return Java_ContentViewCore_hasFocus(env, obj.obj());
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { 1029 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) {
1030 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; 1030 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!";
1031 return false; 1031 return false;
1032 } 1032 }
1033 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); 1033 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I");
1034 1034
1035 return RegisterNativesImpl(env) >= 0; 1035 return RegisterNativesImpl(env) >= 0;
1036 } 1036 }
1037 1037
1038 } // namespace content 1038 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698