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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, | 149 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, |
150 jobject obj) { | 150 jobject obj) { |
151 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); | 151 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); |
152 } | 152 } |
153 | 153 |
154 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( | 154 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( |
155 JNIEnv* env, | 155 JNIEnv* env, |
156 jobject obj) { | 156 jobject obj) { |
157 CommandLine::ForCurrentProcess()->AppendSwitch( | 157 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
158 switches::kEnableExperimentalWebPlatformFeatures); | 158 switches::kEnableExperimentalWebPlatformFeatures); |
159 RenderFrameHost* frame = | 159 RenderFrameHost* frame = |
160 static_cast<WebContentsImpl*>(web_contents_)->GetMainFrame(); | 160 static_cast<WebContentsImpl*>(web_contents_)->GetMainFrame(); |
161 BrowserThread::PostTask( | 161 BrowserThread::PostTask( |
162 BrowserThread::IO, | 162 BrowserThread::IO, |
163 FROM_HERE, | 163 FROM_HERE, |
164 base::Bind( | 164 base::Bind( |
165 &TransitionRequestManager::AddPendingTransitionRequestDataForTesting, | 165 &TransitionRequestManager::AddPendingTransitionRequestDataForTesting, |
166 base::Unretained(TransitionRequestManager::GetInstance()), | 166 base::Unretained(TransitionRequestManager::GetInstance()), |
167 frame->GetProcess()->GetID(), | 167 frame->GetProcess()->GetID(), |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 ScopedJavaGlobalRef<jobject> j_callback; | 444 ScopedJavaGlobalRef<jobject> j_callback; |
445 j_callback.Reset(env, callback); | 445 j_callback.Reset(env, callback); |
446 content::RenderFrameHost::JavaScriptResultCallback js_callback = | 446 content::RenderFrameHost::JavaScriptResultCallback js_callback = |
447 base::Bind(&JavaScriptResultCallback, j_callback); | 447 base::Bind(&JavaScriptResultCallback, j_callback); |
448 | 448 |
449 web_contents_->GetMainFrame()->ExecuteJavaScript( | 449 web_contents_->GetMainFrame()->ExecuteJavaScript( |
450 ConvertJavaStringToUTF16(env, script), js_callback); | 450 ConvertJavaStringToUTF16(env, script), js_callback); |
451 } | 451 } |
452 | 452 |
453 } // namespace content | 453 } // namespace content |
OLD | NEW |