Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 static_cast<int>(x / dpi_scale()), 1571 static_cast<int>(x / dpi_scale()),
1572 static_cast<int>(y / dpi_scale()), 1572 static_cast<int>(y / dpi_scale()),
1573 static_cast<int>((width > 0 && width < dpi_scale()) ? 1573 static_cast<int>((width > 0 && width < dpi_scale()) ?
1574 1 : (int)(width / dpi_scale())), 1574 1 : (int)(width / dpi_scale())),
1575 static_cast<int>((height > 0 && height < dpi_scale()) ? 1575 static_cast<int>((height > 0 && height < dpi_scale()) ?
1576 1 : (int)(height / dpi_scale()))); 1576 1 : (int)(height / dpi_scale())));
1577 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( 1577 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData(
1578 GetWebContents()->GetRoutingID(), rect)); 1578 GetWebContents()->GetRoutingID(), rect));
1579 } 1579 }
1580 1580
1581 void ContentViewCoreImpl::ResumeResponseDeferredAtStart(JNIEnv* env,
1582 jobject obj) {
1583 static_cast<WebContentsImpl*>(GetWebContents())->
1584 ResumeResponseDeferredAtStart();
1585 }
1586
1581 jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) { 1587 jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) {
1582 return GetRenderProcessIdFromRenderViewHost( 1588 return GetRenderProcessIdFromRenderViewHost(
1583 web_contents_->GetRenderViewHost()); 1589 web_contents_->GetRenderViewHost());
1584 } 1590 }
1585 1591
1592 void ContentViewCoreImpl::DidDeferAfterResponseStarted() {
1593 JNIEnv* env = AttachCurrentThread();
1594 ScopedJavaLocalRef<jobject> obj(java_ref_.get(env));
1595 if (obj.is_null())
1596 return;
1597 Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj());
1598 }
1599
1600 bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() {
1601 JNIEnv* env = AttachCurrentThread();
1602 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1603 if (obj.is_null())
1604 return false;
1605
1606 return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env,
1607 obj.obj());
1608 }
1609
1586 void ContentViewCoreImpl::OnSmartClipDataExtracted( 1610 void ContentViewCoreImpl::OnSmartClipDataExtracted(
1587 const base::string16& result) { 1611 const base::string16& result) {
1588 JNIEnv* env = AttachCurrentThread(); 1612 JNIEnv* env = AttachCurrentThread();
1589 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1613 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1590 if (obj.is_null()) 1614 if (obj.is_null())
1591 return; 1615 return;
1592 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); 1616 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result);
1593 Java_ContentViewCore_onSmartClipDataExtracted( 1617 Java_ContentViewCore_onSmartClipDataExtracted(
1594 env, obj.obj(), jresult.obj()); 1618 env, obj.obj(), jresult.obj());
1595 } 1619 }
(...skipping 19 matching lines...) Expand all
1615 reinterpret_cast<ui::WindowAndroid*>(window_android), 1639 reinterpret_cast<ui::WindowAndroid*>(window_android),
1616 retained_objects_set); 1640 retained_objects_set);
1617 return reinterpret_cast<intptr_t>(view); 1641 return reinterpret_cast<intptr_t>(view);
1618 } 1642 }
1619 1643
1620 bool RegisterContentViewCore(JNIEnv* env) { 1644 bool RegisterContentViewCore(JNIEnv* env) {
1621 return RegisterNativesImpl(env); 1645 return RegisterNativesImpl(env);
1622 } 1646 }
1623 1647
1624 } // namespace content 1648 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698