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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 435833002: Navigation transitions: Plumb data from the outgoing renderer to the incoming renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Testfix Created 6 years, 4 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 82d79ab8a83c013bb934cf89f4da2c6535d9f1cd..50ab7253bccc98aac0cbb4f72aeb2958236cc919 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1508,17 +1508,19 @@ void ContentViewCoreImpl::ResumeResponseDeferredAtStart(JNIEnv* env,
void ContentViewCoreImpl::SetHasPendingNavigationTransitionForTesting(
JNIEnv* env,
jobject obj) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableExperimentalWebPlatformFeatures);
RenderFrameHost* frame = static_cast<WebContentsImpl*>(GetWebContents())->
GetMainFrame();
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(
- &TransitionRequestManager::SetHasPendingTransitionRequest,
+ &TransitionRequestManager::AddPendingTransitionRequestData,
base::Unretained(TransitionRequestManager::GetInstance()),
frame->GetProcess()->GetID(),
frame->GetRoutingID(),
- true));
+ "*", "", ""));
}
jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) {
@@ -1532,6 +1534,22 @@ void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, jobject jobj,
GetRenderWidgetHostViewAndroid()->SetBackgroundOpaque(opaque);
}
+void ContentViewCoreImpl::SetupTransitionView(
+ JNIEnv* env, jobject jobj, jstring markup) {
+ if (!GetWebContents()) return;
+ GetWebContents()->GetMainFrame()->Send(new FrameMsg_SetupTransitionView(
+ GetWebContents()->GetMainFrame()->GetRoutingID(),
+ ConvertJavaStringToUTF8(env, markup)));
+}
+
+void ContentViewCoreImpl::BeginExitTransition(
+ JNIEnv* env, jobject jobj, jstring css_selector) {
+ if (!GetWebContents()) return;
+ GetWebContents()->GetMainFrame()->Send(new FrameMsg_BeginExitTransition(
+ GetWebContents()->GetMainFrame()->GetRoutingID(),
+ ConvertJavaStringToUTF8(env, css_selector)));
+}
+
void ContentViewCoreImpl::RequestTextSurroundingSelection(
int max_length,
const base::Callback<
@@ -1550,8 +1568,7 @@ void ContentViewCoreImpl::RequestTextSurroundingSelection(
}
void ContentViewCoreImpl::DidDeferAfterResponseStarted(
- const scoped_refptr<net::HttpResponseHeaders>& headers,
- const GURL& url) {
+ const TransitionLayerData& transition_data) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj(java_ref_.get(env));
if (obj.is_null())
@@ -1559,19 +1576,27 @@ void ContentViewCoreImpl::DidDeferAfterResponseStarted(
std::vector<GURL> entering_stylesheets;
std::string transition_color;
- if (headers) {
+ if (transition_data.response_headers) {
TransitionRequestManager::ParseTransitionStylesheetsFromHeaders(
- headers, entering_stylesheets, url);
+ transition_data.response_headers, entering_stylesheets,
+ transition_data.request_url);
- headers->EnumerateHeader(
+ transition_data.response_headers->EnumerateHeader(
NULL, "X-Transition-Entering-Color", &transition_color);
}
+ ScopedJavaLocalRef<jstring> jstring_markup(ConvertUTF8ToJavaString(
+ env, transition_data.markup));
+
+ ScopedJavaLocalRef<jstring> jstring_css_selector(ConvertUTF8ToJavaString(
+ env, transition_data.css_selector));
+
ScopedJavaLocalRef<jstring> jstring_transition_color(ConvertUTF8ToJavaString(
env, transition_color));
Java_ContentViewCore_didDeferAfterResponseStarted(
- env, obj.obj(), jstring_transition_color.obj());
+ env, obj.obj(), jstring_markup.obj(), jstring_css_selector.obj(),
+ jstring_transition_color.obj());
std::vector<GURL>::const_iterator iter = entering_stylesheets.begin();
for (; iter != entering_stylesheets.end(); ++iter) {
« 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