Chromium Code Reviews| 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 "content/browser/media/android/browser_media_player_manager.h" | 7 #include "content/browser/media/android/browser_media_player_manager.h" |
| 8 #include "content/browser/media/android/browser_media_session_manager.h" | 8 #include "content/browser/media/android/browser_media_session_manager.h" |
| 9 #include "content/browser/media/android/browser_surface_view_manager.h" | 9 #include "content/browser/media/android/browser_surface_view_manager.h" |
| 10 #include "content/browser/media/android/media_session.h" | 10 #include "content/browser/media/android/media_session.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 bool has_audio, | 93 bool has_audio, |
| 94 bool is_remote, | 94 bool is_remote, |
| 95 base::TimeDelta duration) { | 95 base::TimeDelta duration) { |
| 96 // |has_video| forced to true since the value doesn't matter at present. | 96 // |has_video| forced to true since the value doesn't matter at present. |
| 97 OnMediaPlaying(render_frame_host, delegate_id, true, has_audio, is_remote, | 97 OnMediaPlaying(render_frame_host, delegate_id, true, has_audio, is_remote, |
| 98 duration); | 98 duration); |
| 99 return media_session_map_.find(MediaPlayerId( | 99 return media_session_map_.find(MediaPlayerId( |
| 100 render_frame_host, delegate_id)) != media_session_map_.end(); | 100 render_frame_host, delegate_id)) != media_session_map_.end(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void MediaWebContentsObserverAndroid::DisconnectMediaSession( | |
| 104 RenderFrameHost* render_frame_host, | |
| 105 int delegate_id) { | |
| 106 session_controllers_manager()->OnEnd( | |
|
boliu
2016/03/29 17:33:57
This doesn't build on m50 branch. session_controll
| |
| 107 MediaPlayerId(render_frame_host, delegate_id)); | |
| 108 } | |
| 109 | |
| 103 #if defined(VIDEO_HOLE) | 110 #if defined(VIDEO_HOLE) |
| 104 void MediaWebContentsObserverAndroid::OnFrameInfoUpdated() { | 111 void MediaWebContentsObserverAndroid::OnFrameInfoUpdated() { |
| 105 for (auto it = media_player_managers_.begin(); | 112 for (auto it = media_player_managers_.begin(); |
| 106 it != media_player_managers_.end(); ++it) { | 113 it != media_player_managers_.end(); ++it) { |
| 107 it->second->OnFrameInfoUpdated(); | 114 it->second->OnFrameInfoUpdated(); |
| 108 } | 115 } |
| 109 } | 116 } |
| 110 #endif // defined(VIDEO_HOLE) | 117 #endif // defined(VIDEO_HOLE) |
| 111 | 118 |
| 112 void MediaWebContentsObserverAndroid::RenderFrameDeleted( | 119 void MediaWebContentsObserverAndroid::RenderFrameDeleted( |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 scoped_ptr<MediaSessionController> controller( | 360 scoped_ptr<MediaSessionController> controller( |
| 354 new MediaSessionController(id, this)); | 361 new MediaSessionController(id, this)); |
| 355 | 362 |
| 356 if (!controller->Initialize(has_audio, is_remote, duration)) | 363 if (!controller->Initialize(has_audio, is_remote, duration)) |
| 357 return; | 364 return; |
| 358 | 365 |
| 359 media_session_map_[id] = std::move(controller); | 366 media_session_map_[id] = std::move(controller); |
| 360 } | 367 } |
| 361 | 368 |
| 362 } // namespace content | 369 } // namespace content |
| OLD | NEW |