| 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/media/android/browser_media_player_manager.h" | 5 #include "content/browser/media/android/browser_media_player_manager.h" |
| 6 | 6 |
| 7 #include "base/android/scoped_java_ref.h" | 7 #include "base/android/scoped_java_ref.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/browser/android/content_view_core_impl.h" | 9 #include "content/browser/android/content_view_core_impl.h" |
| 10 #include "content/browser/media/android/browser_demuxer_android.h" | 10 #include "content/browser/media/android/browser_demuxer_android.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { | 131 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { |
| 132 // During the tear down process, OnDestroyPlayer() may or may not be called | 132 // During the tear down process, OnDestroyPlayer() may or may not be called |
| 133 // (e.g. the WebContents may be destroyed before the render process). So | 133 // (e.g. the WebContents may be destroyed before the render process). So |
| 134 // we cannot DCHECK(players_.empty()) here. Instead, all media players in | 134 // we cannot DCHECK(players_.empty()) here. Instead, all media players in |
| 135 // |players_| will be destroyed here because |player_| is a ScopedVector. | 135 // |players_| will be destroyed here because |player_| is a ScopedVector. |
| 136 } | 136 } |
| 137 | 137 |
| 138 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { | 138 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { |
| 139 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) | |
| 140 delegate->ExitFullscreenModeForTab(web_contents_); | |
| 141 if (RenderWidgetHostViewAndroid* view_android = | 139 if (RenderWidgetHostViewAndroid* view_android = |
| 142 static_cast<RenderWidgetHostViewAndroid*>( | 140 static_cast<RenderWidgetHostViewAndroid*>( |
| 143 web_contents_->GetRenderWidgetHostView())) { | 141 web_contents_->GetRenderWidgetHostView())) { |
| 144 view_android->SetOverlayVideoMode(false); | 142 view_android->SetOverlayVideoMode(false); |
| 145 } | 143 } |
| 146 | 144 |
| 147 Send( | 145 Send( |
| 148 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); | 146 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); |
| 149 video_view_.reset(); | 147 video_view_.reset(); |
| 150 MediaPlayerAndroid* player = GetFullscreenPlayer(); | 148 MediaPlayerAndroid* player = GetFullscreenPlayer(); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 574 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
| 577 #endif // defined(VIDEO_HOLE) | 575 #endif // defined(VIDEO_HOLE) |
| 578 } | 576 } |
| 579 | 577 |
| 580 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 578 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
| 581 player->Release(); | 579 player->Release(); |
| 582 ReleaseMediaResources(player->player_id()); | 580 ReleaseMediaResources(player->player_id()); |
| 583 } | 581 } |
| 584 | 582 |
| 585 } // namespace content | 583 } // namespace content |
| OLD | NEW |