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/session/media_session_controller.h" | 5 #include "content/browser/media/session/media_session_controller.h" |
6 | 6 |
7 #include "content/browser/media/media_web_contents_observer.h" | 7 #include "content/browser/media/media_web_contents_observer.h" |
8 #include "content/browser/media/session/media_session_impl.h" | 8 #include "content/browser/media/session/media_session_impl.h" |
9 #include "content/common/media/media_player_delegate_messages.h" | 9 #include "content/common/media/media_player_delegate_messages.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void MediaSessionController::OnSetVolumeMultiplier(int player_id, | 90 void MediaSessionController::OnSetVolumeMultiplier(int player_id, |
91 double volume_multiplier) { | 91 double volume_multiplier) { |
92 DCHECK_EQ(player_id_, player_id); | 92 DCHECK_EQ(player_id_, player_id); |
93 media_web_contents_observer_->Send( | 93 media_web_contents_observer_->Send( |
94 new MediaPlayerDelegateMsg_UpdateVolumeMultiplier( | 94 new MediaPlayerDelegateMsg_UpdateVolumeMultiplier( |
95 id_.first->GetRoutingID(), id_.second, volume_multiplier)); | 95 id_.first->GetRoutingID(), id_.second, volume_multiplier)); |
96 } | 96 } |
97 | 97 |
| 98 RenderFrameHost* MediaSessionController::GetRenderFrameHost() const { |
| 99 return id_.first; |
| 100 } |
| 101 |
98 void MediaSessionController::OnPlaybackPaused() { | 102 void MediaSessionController::OnPlaybackPaused() { |
99 // We check for suspension here since the renderer may issue its own pause | 103 // We check for suspension here since the renderer may issue its own pause |
100 // in response to or while a pause from the browser is in flight. | 104 // in response to or while a pause from the browser is in flight. |
101 if (!media_session_->IsSuspended()) | 105 if (!media_session_->IsSuspended()) |
102 media_session_->OnPlayerPaused(this, player_id_); | 106 media_session_->OnPlayerPaused(this, player_id_); |
103 } | 107 } |
104 | 108 |
105 } // namespace content | 109 } // namespace content |
OLD | NEW |