| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( | 144 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( |
| 145 JNIEnv* env, | 145 JNIEnv* env, |
| 146 jobject obj) { | 146 jobject obj) { |
| 147 CommandLine::ForCurrentProcess()->AppendSwitch( | 147 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 148 switches::kEnableExperimentalWebPlatformFeatures); | 148 switches::kEnableExperimentalWebPlatformFeatures); |
| 149 RenderFrameHost* frame = | 149 RenderFrameHost* frame = |
| 150 static_cast<WebContentsImpl*>(web_contents_)->GetMainFrame(); | 150 static_cast<WebContentsImpl*>(web_contents_)->GetMainFrame(); |
| 151 BrowserThread::PostTask( | 151 BrowserThread::PostTask( |
| 152 BrowserThread::IO, | 152 BrowserThread::IO, |
| 153 FROM_HERE, | 153 FROM_HERE, |
| 154 base::Bind(&TransitionRequestManager::AddPendingTransitionRequestData, | 154 base::Bind( |
| 155 base::Unretained(TransitionRequestManager::GetInstance()), | 155 &TransitionRequestManager::AddPendingTransitionRequestDataForTesting, |
| 156 frame->GetProcess()->GetID(), | 156 base::Unretained(TransitionRequestManager::GetInstance()), |
| 157 frame->GetRoutingID(), | 157 frame->GetProcess()->GetID(), |
| 158 "*", | 158 frame->GetRoutingID())); |
| 159 "", | |
| 160 "")); | |
| 161 } | 159 } |
| 162 | 160 |
| 163 void WebContentsAndroid::SetupTransitionView(JNIEnv* env, | 161 void WebContentsAndroid::SetupTransitionView(JNIEnv* env, |
| 164 jobject jobj, | 162 jobject jobj, |
| 165 jstring markup) { | 163 jstring markup) { |
| 166 web_contents_->GetMainFrame()->Send(new FrameMsg_SetupTransitionView( | 164 web_contents_->GetMainFrame()->Send(new FrameMsg_SetupTransitionView( |
| 167 web_contents_->GetMainFrame()->GetRoutingID(), | 165 web_contents_->GetMainFrame()->GetRoutingID(), |
| 168 ConvertJavaStringToUTF8(env, markup))); | 166 ConvertJavaStringToUTF8(env, markup))); |
| 169 } | 167 } |
| 170 | 168 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 ScopedJavaGlobalRef<jobject> j_callback; | 357 ScopedJavaGlobalRef<jobject> j_callback; |
| 360 j_callback.Reset(env, callback); | 358 j_callback.Reset(env, callback); |
| 361 content::RenderFrameHost::JavaScriptResultCallback js_callback = | 359 content::RenderFrameHost::JavaScriptResultCallback js_callback = |
| 362 base::Bind(&JavaScriptResultCallback, j_callback); | 360 base::Bind(&JavaScriptResultCallback, j_callback); |
| 363 | 361 |
| 364 web_contents_->GetMainFrame()->ExecuteJavaScript( | 362 web_contents_->GetMainFrame()->ExecuteJavaScript( |
| 365 ConvertJavaStringToUTF16(env, script), js_callback); | 363 ConvertJavaStringToUTF16(env, script), js_callback); |
| 366 } | 364 } |
| 367 | 365 |
| 368 } // namespace content | 366 } // namespace content |
| OLD | NEW |