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

Unified 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: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index fc0af4c922b9ffd0396817b8c630a8523009cc73..bb6709f87ef7cdde4842b79834ae98d2e06993a2 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -36,6 +36,7 @@
#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/browser/screen_orientation/screen_orientation_dispatcher_host.h"
#include "content/browser/ssl/ssl_host_state.h"
+#include "content/browser/transition_request_manager.h"
#include "content/browser/web_contents/web_contents_view_android.h"
#include "content/common/frame_messages.h"
#include "content/common/input/web_input_event_traits.h"
@@ -43,6 +44,7 @@
#include "content/common/view_messages.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
@@ -1569,6 +1571,28 @@ void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env,
GetWebContents()->GetRoutingID(), rect));
}
+void ContentViewCoreImpl::ResumeResponseDeferredAtStart(JNIEnv* env,
+ jobject obj) {
+ static_cast<WebContentsImpl*>(GetWebContents())->
+ ResumeResponseDeferredAtStart();
+}
+
+void ContentViewCoreImpl::SetHasPendingNavigationTransitionForTesting(
+ JNIEnv* env,
+ jobject obj) {
+ RenderFrameHost* frame = static_cast<WebContentsImpl*>(GetWebContents())->
+ GetMainFrame();
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(
+ &TransitionRequestManager::SetHasPendingTransitionRequest,
+ base::Unretained(TransitionRequestManager::GetInstance()),
+ frame->GetProcess()->GetID(),
+ frame->GetRoutingID(),
+ true));
+}
+
jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) {
return GetRenderProcessIdFromRenderViewHost(
web_contents_->GetRenderViewHost());
@@ -1597,6 +1621,24 @@ void ContentViewCoreImpl::RequestTextSurroundingSelection(
}
}
+void ContentViewCoreImpl::DidDeferAfterResponseStarted() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj(java_ref_.get(env));
+ if (obj.is_null())
+ return;
+ Java_ContentViewCore_didDeferAfterResponseStarted(env, obj.obj());
+}
+
+bool ContentViewCoreImpl::WillHandleDeferAfterResponseStarted() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return false;
+
+ return Java_ContentViewCore_willHandleDeferAfterResponseStarted(env,
+ obj.obj());
+}
+
void ContentViewCoreImpl::OnSmartClipDataExtracted(
const base::string16& result) {
JNIEnv* env = AttachCurrentThread();
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/frame_host/render_frame_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698