Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/media/pepper/pepper_player_delegate.h" | |
| 6 | |
| 7 #include "content/browser/frame_host/render_frame_host_impl.h" | |
| 8 #include "content/browser/media/pepper/pepper_web_contents_observer.h" | |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | |
| 10 #include "content/common/frame_messages.h" | |
| 11 | |
| 12 namespace content { | |
| 13 PepperPlayerDelegate::PepperPlayerDelegate( | |
| 14 PepperWebContentsObserver* pepper_web_contents_observer, | |
| 15 int32_t pp_instance) | |
| 16 : pepper_web_contents_observer_(pepper_web_contents_observer), | |
| 17 pp_instance_(pp_instance) {} | |
| 18 | |
| 19 PepperPlayerDelegate::~PepperPlayerDelegate() {} | |
|
mlamouri (slow - plz ping)
2016/06/23 13:23:19
`= default;` instead of `{}`
Zhiqiang Zhang (Slow)
2016/06/24 17:43:20
Done.
| |
| 20 | |
| 21 void PepperPlayerDelegate::OnSuspend(int player_id) { | |
| 22 DCHECK_EQ(player_id, 0); | |
| 23 OnSetVolume(player_id, 0.0f); | |
|
mlamouri (slow - plz ping)
2016/06/23 13:23:20
0.0f isn't really ducking. Was that intended?
Zhiqiang Zhang (Slow)
2016/06/24 17:43:20
Using 0.2f
| |
| 24 } | |
| 25 | |
| 26 void PepperPlayerDelegate::OnResume(int player_id) { | |
| 27 DCHECK_EQ(player_id, 0); | |
| 28 OnSetVolume(player_id, 1.0f); | |
| 29 } | |
| 30 | |
| 31 void PepperPlayerDelegate::OnSetVolumeMultiplier(int player_id, | |
| 32 double volume_multiplier) { | |
| 33 DCHECK_EQ(player_id, 0); | |
| 34 OnSetVolume(player_id, volume_multiplier); | |
| 35 } | |
| 36 | |
| 37 void PepperPlayerDelegate::OnSetVolume(int player_id, double volume) { | |
| 38 WebContentsImpl* contents = static_cast<WebContentsImpl*>( | |
| 39 pepper_web_contents_observer_->web_contents()); | |
| 40 pepper_web_contents_observer_->Send( | |
| 41 new FrameMsg_SetPepperVolume(contents->GetMainFrame()->routing_id(), | |
| 42 pp_instance_, volume)); | |
| 43 } | |
| 44 } | |
| OLD | NEW |