OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |