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

Unified Diff: content/browser/android/media_player_manager_android.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/media_player_manager_android.cc
diff --git a/content/browser/android/media_player_manager_android.cc b/content/browser/android/media_player_manager_android.cc
index ef650286e98e604102be1ff23d8b357a45741ef2..e024ba1cc4d42599720047cd5022c23c0c95caaf 100644
--- a/content/browser/android/media_player_manager_android.cc
+++ b/content/browser/android/media_player_manager_android.cc
@@ -45,8 +45,12 @@ bool MediaPlayerManagerAndroid::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyMediaPlayer, OnDestroyPlayer)
IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyAllMediaPlayers,
DestroyAllMediaPlayers)
+#if defined(GOOGLE_TV)
IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_RequestExternalSurface,
OnRequestExternalSurface)
+ IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_NotifyGeometryChange,
+ OnNotifyGeometryChange)
+#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -199,6 +203,7 @@ void MediaPlayerManagerAndroid::DestroyAllMediaPlayers() {
}
}
+#if defined(GOOGLE_TV)
void MediaPlayerManagerAndroid::AttachExternalVideoSurface(int player_id,
jobject surface) {
MediaPlayerBridge* player = GetPlayer(player_id);
@@ -213,13 +218,26 @@ void MediaPlayerManagerAndroid::DetachExternalVideoSurface(int player_id) {
}
void MediaPlayerManagerAndroid::OnRequestExternalSurface(int player_id) {
- if (web_contents_) {
- WebContentsViewAndroid* view =
- static_cast<WebContentsViewAndroid*>(web_contents_->GetView());
- if (view)
- view->RequestExternalVideoSurface(player_id);
- }
+ if (!web_contents_)
+ return;
+
+ WebContentsViewAndroid* view =
+ static_cast<WebContentsViewAndroid*>(web_contents_->GetView());
+ if (view)
+ view->RequestExternalVideoSurface(player_id);
+}
+
+void MediaPlayerManagerAndroid::OnNotifyGeometryChange(int player_id,
+ const gfx::RectF& rect) {
+ if (!web_contents_)
+ return;
+
+ WebContentsViewAndroid* view =
+ static_cast<WebContentsViewAndroid*>(web_contents_->GetView());
+ if (view)
+ view->NotifyGeometryChange(player_id, rect);
}
+#endif
MediaPlayerBridge* MediaPlayerManagerAndroid::GetPlayer(int player_id) {
for (ScopedVector<MediaPlayerBridge>::iterator it = players_.begin();
« no previous file with comments | « content/browser/android/media_player_manager_android.h ('k') | content/browser/web_contents/web_contents_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698