| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 | 317 |
| 318 jboolean WebContentsAndroid::IsRenderWidgetHostViewReady( | 318 jboolean WebContentsAndroid::IsRenderWidgetHostViewReady( |
| 319 JNIEnv* env, | 319 JNIEnv* env, |
| 320 jobject obj) { | 320 jobject obj) { |
| 321 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 321 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 322 return view && view->HasValidFrame(); | 322 return view && view->HasValidFrame(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void WebContentsAndroid::ExitFullscreen(JNIEnv* env, jobject obj) { | 325 void WebContentsAndroid::ExitFullscreen(JNIEnv* env, jobject obj) { |
| 326 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 326 web_contents_->ExitFullscreen(); |
| 327 if (!host) | |
| 328 return; | |
| 329 host->ExitFullscreen(); | |
| 330 } | 327 } |
| 331 | 328 |
| 332 void WebContentsAndroid::UpdateTopControlsState( | 329 void WebContentsAndroid::UpdateTopControlsState( |
| 333 JNIEnv* env, | 330 JNIEnv* env, |
| 334 jobject obj, | 331 jobject obj, |
| 335 bool enable_hiding, | 332 bool enable_hiding, |
| 336 bool enable_showing, | 333 bool enable_showing, |
| 337 bool animate) { | 334 bool animate) { |
| 338 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 335 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
| 339 if (!host) | 336 if (!host) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 ScopedJavaGlobalRef<jobject> j_callback; | 444 ScopedJavaGlobalRef<jobject> j_callback; |
| 448 j_callback.Reset(env, callback); | 445 j_callback.Reset(env, callback); |
| 449 content::RenderFrameHost::JavaScriptResultCallback js_callback = | 446 content::RenderFrameHost::JavaScriptResultCallback js_callback = |
| 450 base::Bind(&JavaScriptResultCallback, j_callback); | 447 base::Bind(&JavaScriptResultCallback, j_callback); |
| 451 | 448 |
| 452 web_contents_->GetMainFrame()->ExecuteJavaScript( | 449 web_contents_->GetMainFrame()->ExecuteJavaScript( |
| 453 ConvertJavaStringToUTF16(env, script), js_callback); | 450 ConvertJavaStringToUTF16(env, script), js_callback); |
| 454 } | 451 } |
| 455 | 452 |
| 456 } // namespace content | 453 } // namespace content |
| OLD | NEW |