| 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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { | 1579 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { |
| 1580 JNIEnv* env = AttachCurrentThread(); | 1580 JNIEnv* env = AttachCurrentThread(); |
| 1581 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1581 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1582 if (obj.is_null()) | 1582 if (obj.is_null()) |
| 1583 return false; | 1583 return false; |
| 1584 | 1584 |
| 1585 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, | 1585 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, |
| 1586 obj.obj()); | 1586 obj.obj()); |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 void ContentViewCoreImpl::DidStartNavigationTransitionForFrame(int64 frame_id) { |
| 1590 JNIEnv* env = AttachCurrentThread(); |
| 1591 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); |
| 1592 if (obj.is_null()) |
| 1593 return; |
| 1594 Java_ContentViewCore_didStartNavigationTransitionForFrame( |
| 1595 env, obj.obj(), frame_id); |
| 1596 } |
| 1597 |
| 1589 void ContentViewCoreImpl::OnSmartClipDataExtracted( | 1598 void ContentViewCoreImpl::OnSmartClipDataExtracted( |
| 1590 const base::string16& text, | 1599 const base::string16& text, |
| 1591 const base::string16& html, | 1600 const base::string16& html, |
| 1592 const gfx::Rect& clip_rect) { | 1601 const gfx::Rect& clip_rect) { |
| 1593 JNIEnv* env = AttachCurrentThread(); | 1602 JNIEnv* env = AttachCurrentThread(); |
| 1594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1603 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1595 if (obj.is_null()) | 1604 if (obj.is_null()) |
| 1596 return; | 1605 return; |
| 1597 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); | 1606 ScopedJavaLocalRef<jstring> jtext = ConvertUTF16ToJavaString(env, text); |
| 1598 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); | 1607 ScopedJavaLocalRef<jstring> jhtml = ConvertUTF16ToJavaString(env, html); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1622 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1631 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1623 retained_objects_set); | 1632 retained_objects_set); |
| 1624 return reinterpret_cast<intptr_t>(view); | 1633 return reinterpret_cast<intptr_t>(view); |
| 1625 } | 1634 } |
| 1626 | 1635 |
| 1627 bool RegisterContentViewCore(JNIEnv* env) { | 1636 bool RegisterContentViewCore(JNIEnv* env) { |
| 1628 return RegisterNativesImpl(env); | 1637 return RegisterNativesImpl(env); |
| 1629 } | 1638 } |
| 1630 | 1639 |
| 1631 } // namespace content | 1640 } // namespace content |
| OLD | NEW |