Chromium Code Reviews| 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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1603 if (!focused_frame) | 1603 if (!focused_frame) |
| 1604 return; | 1604 return; |
| 1605 if (GetRenderWidgetHostViewAndroid()) { | 1605 if (GetRenderWidgetHostViewAndroid()) { |
| 1606 GetRenderWidgetHostViewAndroid()->SetTextSurroundingSelectionCallback( | 1606 GetRenderWidgetHostViewAndroid()->SetTextSurroundingSelectionCallback( |
| 1607 callback); | 1607 callback); |
| 1608 focused_frame->Send(new FrameMsg_TextSurroundingSelectionRequest( | 1608 focused_frame->Send(new FrameMsg_TextSurroundingSelectionRequest( |
| 1609 focused_frame->GetRoutingID(), max_length)); | 1609 focused_frame->GetRoutingID(), max_length)); |
| 1610 } | 1610 } |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 void ContentViewCoreImpl::DidDeferAfterResponseStarted() { | 1613 void ContentViewCoreImpl::DidDeferAfterResponseStarted( |
| 1614 const TransitionLayerData& transition_layer_data) { | |
| 1614 JNIEnv* env = AttachCurrentThread(); | 1615 JNIEnv* env = AttachCurrentThread(); |
| 1615 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); | 1616 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env)); |
| 1616 if (obj.is_null()) | 1617 if (obj.is_null()) |
| 1617 return; | 1618 return; |
| 1618 Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj()); | 1619 Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj()); |
| 1620 | |
| 1621 std::vector<GURL>::const_iterator iter = | |
| 1622 transition_layer_data.transition_stylesheets.begin(); | |
| 1623 for (; iter != transition_layer_data.transition_stylesheets.end(); ++iter) { | |
|
shatch
2014/07/22 20:06:29
Since there's 2 sets of stylesheets in the feature
| |
| 1624 ScopedJavaLocalRef<jstring> jstring_url(ConvertUTF8ToJavaString( | |
| 1625 env, iter->spec())); | |
| 1626 Java_ContentViewCore_addStylesheetToTransition( | |
| 1627 env, obj.obj(), jstring_url.obj()); | |
| 1628 } | |
| 1619 } | 1629 } |
| 1620 | 1630 |
| 1621 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { | 1631 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() { |
| 1622 JNIEnv* env = AttachCurrentThread(); | 1632 JNIEnv* env = AttachCurrentThread(); |
| 1623 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1633 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1624 if (obj.is_null()) | 1634 if (obj.is_null()) |
| 1625 return false; | 1635 return false; |
| 1626 | 1636 |
| 1627 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, | 1637 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env, |
| 1628 obj.obj()); | 1638 obj.obj()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1664 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1674 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1665 retained_objects_set); | 1675 retained_objects_set); |
| 1666 return reinterpret_cast<intptr_t>(view); | 1676 return reinterpret_cast<intptr_t>(view); |
| 1667 } | 1677 } |
| 1668 | 1678 |
| 1669 bool RegisterContentViewCore(JNIEnv* env) { | 1679 bool RegisterContentViewCore(JNIEnv* env) { |
| 1670 return RegisterNativesImpl(env); | 1680 return RegisterNativesImpl(env); |
| 1671 } | 1681 } |
| 1672 | 1682 |
| 1673 } // namespace content | 1683 } // namespace content |
| OLD | NEW |