| 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 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 if (!focused_frame) | 1594 if (!focused_frame) |
| 1595 return; | 1595 return; |
| 1596 if (GetRenderWidgetHostViewAndroid()) { | 1596 if (GetRenderWidgetHostViewAndroid()) { |
| 1597 GetRenderWidgetHostViewAndroid()->SetTextSurroundingSelectionCallback( | 1597 GetRenderWidgetHostViewAndroid()->SetTextSurroundingSelectionCallback( |
| 1598 callback); | 1598 callback); |
| 1599 focused_frame->Send(new FrameMsg_TextSurroundingSelectionRequest( | 1599 focused_frame->Send(new FrameMsg_TextSurroundingSelectionRequest( |
| 1600 focused_frame->GetRoutingID(), max_length)); | 1600 focused_frame->GetRoutingID(), max_length)); |
| 1601 } | 1601 } |
| 1602 } | 1602 } |
| 1603 | 1603 |
| 1604 void ContentViewCoreImpl::DidDeferAfterResponseStarted() { | 1604 void ContentViewCoreImpl::DidDeferAfterResponseStarted( |
| 1605 const TransitionLayerData& transition_layer_data) { |
| 1605 JNIEnv* env = AttachCurrentThread(); | 1606 JNIEnv* env = AttachCurrentThread(); |
| 1606 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); | 1607 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); |
| 1607 if (obj.is_null()) | 1608 if (obj.is_null()) |
| 1608 return; | 1609 return; |
| 1609 Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj()); | 1610 Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj()); |
| 1611 |
| 1612 std::vector<GURL>::const_iterator iter = |
| 1613 transition_layer_data.transition_stylesheets.begin(); |
| 1614 for (; iter != transition_layer_data.transition_stylesheets.end(); ++iter) { |
| 1615 ScopedJavaLocalRef<jstring> jstring_url(ConvertUTF8ToJavaString( |
| 1616 env, iter->spec())); |
| 1617 Java_ContentViewCore_addStylesheetToTransition( |
| 1618 env, obj.obj(), jstring_url.obj()); |
| 1619 } |
| 1610 } | 1620 } |
| 1611 | 1621 |
| 1612 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { | 1622 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { |
| 1613 JNIEnv* env = AttachCurrentThread(); | 1623 JNIEnv* env = AttachCurrentThread(); |
| 1614 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1624 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1615 if (obj.is_null()) | 1625 if (obj.is_null()) |
| 1616 return false; | 1626 return false; |
| 1617 | 1627 |
| 1618 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, | 1628 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, |
| 1619 obj.obj()); | 1629 obj.obj()); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1663 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1654 retained_objects_set); | 1664 retained_objects_set); |
| 1655 return reinterpret_cast<intptr_t>(view); | 1665 return reinterpret_cast<intptr_t>(view); |
| 1656 } | 1666 } |
| 1657 | 1667 |
| 1658 bool RegisterContentViewCore(JNIEnv* env) { | 1668 bool RegisterContentViewCore(JNIEnv* env) { |
| 1659 return RegisterNativesImpl(env); | 1669 return RegisterNativesImpl(env); |
| 1660 } | 1670 } |
| 1661 | 1671 |
| 1662 } // namespace content | 1672 } // namespace content |
| OLD | NEW |