| 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 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { | 1649 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { |
| 1650 JNIEnv* env = AttachCurrentThread(); | 1650 JNIEnv* env = AttachCurrentThread(); |
| 1651 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1651 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1652 if (obj.is_null()) | 1652 if (obj.is_null()) |
| 1653 return false; | 1653 return false; |
| 1654 | 1654 |
| 1655 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, | 1655 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, |
| 1656 obj.obj()); | 1656 obj.obj()); |
| 1657 } | 1657 } |
| 1658 | 1658 |
| 1659 void ContentViewCoreImpl::DidStartNavigationTransitionForFrame(int64 frame_id) { |
| 1660 JNIEnv* env = AttachCurrentThread(); |
| 1661 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); |
| 1662 if (obj.is_null()) |
| 1663 return; |
| 1664 Java_ContentViewCore_didStartNavigationTransitionForFrame( |
| 1665 env, obj.obj(), frame_id); |
| 1666 } |
| 1667 |
| 1659 void ContentViewCoreImpl::OnSmartClipDataExtracted( | 1668 void ContentViewCoreImpl::OnSmartClipDataExtracted( |
| 1660 const gfx::Rect& clip_rect, | 1669 const gfx::Rect& clip_rect, |
| 1661 const base::string16& result) { | 1670 const base::string16& result) { |
| 1662 JNIEnv* env = AttachCurrentThread(); | 1671 JNIEnv* env = AttachCurrentThread(); |
| 1663 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1672 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1664 if (obj.is_null()) | 1673 if (obj.is_null()) |
| 1665 return; | 1674 return; |
| 1666 ScopedJavaLocalRef<jobject> clip_rect_object(CreateJavaRect(env, clip_rect)); | 1675 ScopedJavaLocalRef<jobject> clip_rect_object(CreateJavaRect(env, clip_rect)); |
| 1667 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); | 1676 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); |
| 1668 Java_ContentViewCore_onSmartClipDataExtracted( | 1677 Java_ContentViewCore_onSmartClipDataExtracted( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1690 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1699 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1691 retained_objects_set); | 1700 retained_objects_set); |
| 1692 return reinterpret_cast<intptr_t>(view); | 1701 return reinterpret_cast<intptr_t>(view); |
| 1693 } | 1702 } |
| 1694 | 1703 |
| 1695 bool RegisterContentViewCore(JNIEnv* env) { | 1704 bool RegisterContentViewCore(JNIEnv* env) { |
| 1696 return RegisterNativesImpl(env); | 1705 return RegisterNativesImpl(env); |
| 1697 } | 1706 } |
| 1698 | 1707 |
| 1699 } // namespace content | 1708 } // namespace content |
| OLD | NEW |