| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 | 1277 |
| 1278 jboolean ContentViewCoreImpl::IsShowingInterstitialPage(JNIEnv* env, | 1278 jboolean ContentViewCoreImpl::IsShowingInterstitialPage(JNIEnv* env, |
| 1279 jobject obj) { | 1279 jobject obj) { |
| 1280 return web_contents_->ShowingInterstitialPage(); | 1280 return web_contents_->ShowingInterstitialPage(); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 void ContentViewCoreImpl::AttachExternalVideoSurface(JNIEnv* env, | 1283 void ContentViewCoreImpl::AttachExternalVideoSurface(JNIEnv* env, |
| 1284 jobject obj, | 1284 jobject obj, |
| 1285 jint player_id, | 1285 jint player_id, |
| 1286 jobject jsurface) { | 1286 jobject jsurface) { |
| 1287 #if defined(GOOGLE_TV) | 1287 #if defined(VIDEO_HOLE) |
| 1288 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | 1288 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 1289 web_contents_->GetRenderViewHost()); | 1289 web_contents_->GetRenderViewHost()); |
| 1290 if (rvhi && rvhi->media_player_manager()) { | 1290 if (rvhi && rvhi->media_player_manager()) { |
| 1291 rvhi->media_player_manager()->AttachExternalVideoSurface( | 1291 rvhi->media_player_manager()->AttachExternalVideoSurface( |
| 1292 static_cast<int>(player_id), jsurface); | 1292 static_cast<int>(player_id), jsurface); |
| 1293 } | 1293 } |
| 1294 #endif | 1294 #endif // defined(VIDEO_HOLE) |
| 1295 } | 1295 } |
| 1296 | 1296 |
| 1297 void ContentViewCoreImpl::DetachExternalVideoSurface(JNIEnv* env, | 1297 void ContentViewCoreImpl::DetachExternalVideoSurface(JNIEnv* env, |
| 1298 jobject obj, | 1298 jobject obj, |
| 1299 jint player_id) { | 1299 jint player_id) { |
| 1300 #if defined(GOOGLE_TV) | 1300 #if defined(VIDEO_HOLE) |
| 1301 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | 1301 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 1302 web_contents_->GetRenderViewHost()); | 1302 web_contents_->GetRenderViewHost()); |
| 1303 if (rvhi && rvhi->media_player_manager()) { | 1303 if (rvhi && rvhi->media_player_manager()) { |
| 1304 rvhi->media_player_manager()->DetachExternalVideoSurface( | 1304 rvhi->media_player_manager()->DetachExternalVideoSurface( |
| 1305 static_cast<int>(player_id)); | 1305 static_cast<int>(player_id)); |
| 1306 } | 1306 } |
| 1307 #endif | 1307 #endif // defined(VIDEO_HOLE) |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 jboolean ContentViewCoreImpl::IsRenderWidgetHostViewReady(JNIEnv* env, | 1310 jboolean ContentViewCoreImpl::IsRenderWidgetHostViewReady(JNIEnv* env, |
| 1311 jobject obj) { | 1311 jobject obj) { |
| 1312 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 1312 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 1313 return view && view->HasValidFrame(); | 1313 return view && view->HasValidFrame(); |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 void ContentViewCoreImpl::ExitFullscreen(JNIEnv* env, jobject obj) { | 1316 void ContentViewCoreImpl::ExitFullscreen(JNIEnv* env, jobject obj) { |
| 1317 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 1317 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1613 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1614 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1614 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1615 return reinterpret_cast<intptr_t>(view); | 1615 return reinterpret_cast<intptr_t>(view); |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 bool RegisterContentViewCore(JNIEnv* env) { | 1618 bool RegisterContentViewCore(JNIEnv* env) { |
| 1619 return RegisterNativesImpl(env); | 1619 return RegisterNativesImpl(env); |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 } // namespace content | 1622 } // namespace content |
| OLD | NEW |