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

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

Issue 1140693004: [Android] Prevent touch interception for browser-consumed touches (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 577 }
578 578
579 bool ContentViewCoreImpl::HasFocus() { 579 bool ContentViewCoreImpl::HasFocus() {
580 JNIEnv* env = AttachCurrentThread(); 580 JNIEnv* env = AttachCurrentThread();
581 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 581 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
582 if (obj.is_null()) 582 if (obj.is_null())
583 return false; 583 return false;
584 return Java_ContentViewCore_hasFocus(env, obj.obj()); 584 return Java_ContentViewCore_hasFocus(env, obj.obj());
585 } 585 }
586 586
587 void ContentViewCoreImpl::RequestDisallowInterceptTouchEvent() {
588 JNIEnv* env = AttachCurrentThread();
589 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
590 if (!obj.is_null())
591 Java_ContentViewCore_requestDisallowInterceptTouchEvent(env, obj.obj());
592 }
593
587 void ContentViewCoreImpl::OnSelectionChanged(const std::string& text) { 594 void ContentViewCoreImpl::OnSelectionChanged(const std::string& text) {
588 JNIEnv* env = AttachCurrentThread(); 595 JNIEnv* env = AttachCurrentThread();
589 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 596 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
590 if (obj.is_null()) 597 if (obj.is_null())
591 return; 598 return;
592 ScopedJavaLocalRef<jstring> jtext = ConvertUTF8ToJavaString(env, text); 599 ScopedJavaLocalRef<jstring> jtext = ConvertUTF8ToJavaString(env, text);
593 Java_ContentViewCore_onSelectionChanged(env, obj.obj(), jtext.obj()); 600 Java_ContentViewCore_onSelectionChanged(env, obj.obj(), jtext.obj());
594 } 601 }
595 602
596 void ContentViewCoreImpl::OnSelectionEvent(ui::SelectionEventType event, 603 void ContentViewCoreImpl::OnSelectionEvent(ui::SelectionEventType event,
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 return NULL; 1461 return NULL;
1455 1462
1456 return view->GetJavaObject().Release(); 1463 return view->GetJavaObject().Release();
1457 } 1464 }
1458 1465
1459 bool RegisterContentViewCore(JNIEnv* env) { 1466 bool RegisterContentViewCore(JNIEnv* env) {
1460 return RegisterNativesImpl(env); 1467 return RegisterNativesImpl(env);
1461 } 1468 }
1462 1469
1463 } // namespace content 1470 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698