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" |
11 #include "content/browser/media/android/media_resource_getter_impl.h" | 11 #include "content/browser/media/android/media_resource_getter_impl.h" |
12 #include "content/browser/renderer_host/render_view_host_impl.h" | 12 #include "content/browser/renderer_host/render_view_host_impl.h" |
13 #include "content/browser/web_contents/web_contents_view_android.h" | 13 #include "content/browser/web_contents/web_contents_view_android.h" |
14 #include "content/common/media/media_player_messages_android.h" | 14 #include "content/common/media/media_player_messages_android.h" |
15 #include "content/public/browser/android/content_view_core.h" | 15 #include "content/public/browser/android/content_view_core.h" |
16 #include "content/public/browser/android/external_video_surface_container.h" | 16 #include "content/public/browser/android/external_video_surface_container.h" |
17 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
18 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
19 #include "content/public/browser/render_frame_host.h" | 19 #include "content/public/browser/render_frame_host.h" |
20 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
21 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
24 #include "content/public/browser/web_contents_delegate.h" | |
25 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
26 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
27 #include "media/base/android/media_player_bridge.h" | 26 #include "media/base/android/media_player_bridge.h" |
28 #include "media/base/android/media_source_player.h" | 27 #include "media/base/android/media_source_player.h" |
29 #include "media/base/android/media_url_interceptor.h" | 28 #include "media/base/android/media_url_interceptor.h" |
30 #include "media/base/media_switches.h" | 29 #include "media/base/media_switches.h" |
31 | 30 |
32 using media::MediaPlayerAndroid; | 31 using media::MediaPlayerAndroid; |
33 using media::MediaPlayerBridge; | 32 using media::MediaPlayerBridge; |
34 using media::MediaPlayerManager; | 33 using media::MediaPlayerManager; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 } | 128 } |
130 | 129 |
131 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { | 130 BrowserMediaPlayerManager::~BrowserMediaPlayerManager() { |
132 // During the tear down process, OnDestroyPlayer() may or may not be called | 131 // 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 | 132 // (e.g. the WebContents may be destroyed before the render process). So |
134 // we cannot DCHECK(players_.empty()) here. Instead, all media players in | 133 // we cannot DCHECK(players_.empty()) here. Instead, all media players in |
135 // |players_| will be destroyed here because |player_| is a ScopedVector. | 134 // |players_| will be destroyed here because |player_| is a ScopedVector. |
136 } | 135 } |
137 | 136 |
138 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { | 137 void BrowserMediaPlayerManager::ExitFullscreen(bool release_media_player) { |
139 if (WebContentsDelegate* delegate = web_contents_->GetDelegate()) | |
Ignacio Solla
2015/01/26 10:55:57
is this intentional? Don't we still need it?
Hugo Holgersson
2015/01/26 11:02:33
It is intentional. WebContentsImpl::ExitFullscreen
| |
140 delegate->ExitFullscreenModeForTab(web_contents_); | |
141 if (RenderWidgetHostViewAndroid* view_android = | 138 if (RenderWidgetHostViewAndroid* view_android = |
142 static_cast<RenderWidgetHostViewAndroid*>( | 139 static_cast<RenderWidgetHostViewAndroid*>( |
143 web_contents_->GetRenderWidgetHostView())) { | 140 web_contents_->GetRenderWidgetHostView())) { |
144 view_android->SetOverlayVideoMode(false); | 141 view_android->SetOverlayVideoMode(false); |
145 } | 142 } |
146 | 143 |
147 Send( | 144 Send( |
148 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); | 145 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); |
149 video_view_.reset(); | 146 video_view_.reset(); |
150 MediaPlayerAndroid* player = GetFullscreenPlayer(); | 147 MediaPlayerAndroid* player = GetFullscreenPlayer(); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 573 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
577 #endif // defined(VIDEO_HOLE) | 574 #endif // defined(VIDEO_HOLE) |
578 } | 575 } |
579 | 576 |
580 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 577 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
581 player->Release(); | 578 player->Release(); |
582 ReleaseMediaResources(player->player_id()); | 579 ReleaseMediaResources(player->player_id()); |
583 } | 580 } |
584 | 581 |
585 } // namespace content | 582 } // namespace content |
OLD | NEW |