OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_web_contents_observer_android.h" | 5 #include "content/browser/media/android/media_web_contents_observer_android.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "content/browser/media/android/browser_media_player_manager.h" | 10 #include "content/browser/media/android/browser_media_player_manager.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void MediaWebContentsObserverAndroid::SuspendAllMediaPlayers() { | 91 void MediaWebContentsObserverAndroid::SuspendAllMediaPlayers() { |
92 web_contents()->ForEachFrame( | 92 web_contents()->ForEachFrame( |
93 base::Bind(&SuspendAllMediaPlayersInRenderFrame)); | 93 base::Bind(&SuspendAllMediaPlayersInRenderFrame)); |
94 } | 94 } |
95 | 95 |
96 bool MediaWebContentsObserverAndroid::RequestPlay( | 96 bool MediaWebContentsObserverAndroid::RequestPlay( |
97 RenderFrameHost* render_frame_host, | 97 RenderFrameHost* render_frame_host, |
98 int delegate_id, | 98 int delegate_id, |
99 bool has_audio, | 99 bool has_audio, |
100 bool is_remote, | 100 bool is_remote, |
101 base::TimeDelta duration) { | 101 media::MediaContentType media_content_type) { |
102 return session_controllers_manager()->RequestPlay( | 102 return session_controllers_manager()->RequestPlay( |
103 MediaPlayerId(render_frame_host, delegate_id), | 103 MediaPlayerId(render_frame_host, delegate_id), |
104 has_audio, is_remote, duration); | 104 has_audio, is_remote, media_content_type); |
105 } | 105 } |
106 | 106 |
107 void MediaWebContentsObserverAndroid::DisconnectMediaSession( | 107 void MediaWebContentsObserverAndroid::DisconnectMediaSession( |
108 RenderFrameHost* render_frame_host, | 108 RenderFrameHost* render_frame_host, |
109 int delegate_id) { | 109 int delegate_id) { |
110 session_controllers_manager()->OnEnd( | 110 session_controllers_manager()->OnEnd( |
111 MediaPlayerId(render_frame_host, delegate_id)); | 111 MediaPlayerId(render_frame_host, delegate_id)); |
112 } | 112 } |
113 | 113 |
114 #if defined(VIDEO_HOLE) | 114 #if defined(VIDEO_HOLE) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; | 285 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; |
286 return; | 286 return; |
287 } | 287 } |
288 | 288 |
289 // TODO(xhwang): This could possibly fail. In that case we should reject the | 289 // TODO(xhwang): This could possibly fail. In that case we should reject the |
290 // promise. | 290 // promise. |
291 media_player->SetCdm(cdm); | 291 media_player->SetCdm(cdm); |
292 } | 292 } |
293 | 293 |
294 } // namespace content | 294 } // namespace content |
OLD | NEW |