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

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

Issue 13688004: Location/size change notification when external rendering is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & added a missing ifdef guard Created 7 years, 8 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 204145c773647024dade3629fe31daaf9bc4fbd1..59c7dfdfcd82b4f602850f1dc91c85cb00e114d8 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -602,6 +602,23 @@ void ContentViewCoreImpl::RequestExternalVideoSurface(int player_id) {
env, obj.obj(), static_cast<jint>(player_id));
}
+void ContentViewCoreImpl::NotifyGeometryChange(int player_id,
+ const gfx::RectF& rect) {
+ JNIEnv* env = AttachCurrentThread();
+
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+
+ Java_ContentViewCore_notifyGeometryChange(env,
+ obj.obj(),
+ static_cast<jint>(player_id),
+ static_cast<jfloat>(rect.x()),
+ static_cast<jfloat>(rect.y()),
+ static_cast<jfloat>(rect.width()),
+ static_cast<jfloat>(rect.height()));
+}
+
gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
@@ -1223,23 +1240,27 @@ void ContentViewCoreImpl::AttachExternalVideoSurface(JNIEnv* env,
jobject obj,
jint player_id,
jobject jsurface) {
+#if defined(GOOGLE_TV)
RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(
web_contents_->GetRenderViewHost());
if (rvhi && rvhi->media_player_manager()) {
rvhi->media_player_manager()->AttachExternalVideoSurface(
static_cast<int>(player_id), jsurface);
}
+#endif
}
void ContentViewCoreImpl::DetachExternalVideoSurface(JNIEnv* env,
jobject obj,
jint player_id) {
+#if defined(GOOGLE_TV)
RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(
web_contents_->GetRenderViewHost());
if (rvhi && rvhi->media_player_manager()) {
rvhi->media_player_manager()->DetachExternalVideoSurface(
static_cast<int>(player_id));
}
+#endif
}
jboolean ContentViewCoreImpl::IsRenderWidgetHostViewReady(JNIEnv* env,
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/media_player_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698