| 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/pepper_player_delegate.h" | 5 #include "content/browser/media/session/pepper_player_delegate.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/render_frame_host_impl.h" | 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 8 #include "content/browser/media/session/pepper_playback_observer.h" | 8 #include "content/browser/media/session/pepper_playback_observer.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "media/base/media_switches.h" | 10 #include "media/base/media_switches.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const double kDuckVolume = 0.2f; | 16 const double kDuckVolume = 0.2f; |
| 17 | 17 |
| 18 bool ShouldDuckFlash() { | 18 bool ShouldDuckFlash() { |
| 19 return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 19 return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 20 switches::kEnableDefaultMediaSession) == | 20 switches::kEnableAudioFocus) == |
| 21 switches::kEnableDefaultMediaSessionDuckFlash; | 21 switches::kEnableAudioFocusDuckFlash; |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // anonymous namespace | 24 } // anonymous namespace |
| 25 | 25 |
| 26 const int PepperPlayerDelegate::kPlayerId = 0; | 26 const int PepperPlayerDelegate::kPlayerId = 0; |
| 27 | 27 |
| 28 PepperPlayerDelegate::PepperPlayerDelegate( | 28 PepperPlayerDelegate::PepperPlayerDelegate( |
| 29 RenderFrameHost* render_frame_host, int32_t pp_instance) | 29 RenderFrameHost* render_frame_host, int32_t pp_instance) |
| 30 : render_frame_host_(render_frame_host), | 30 : render_frame_host_(render_frame_host), |
| 31 pp_instance_(pp_instance) {} | 31 pp_instance_(pp_instance) {} |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 RenderFrameHost* PepperPlayerDelegate::render_frame_host() const { | 61 RenderFrameHost* PepperPlayerDelegate::render_frame_host() const { |
| 62 return render_frame_host_; | 62 return render_frame_host_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void PepperPlayerDelegate::SetVolume(int player_id, double volume) { | 65 void PepperPlayerDelegate::SetVolume(int player_id, double volume) { |
| 66 render_frame_host_->Send(new FrameMsg_SetPepperVolume( | 66 render_frame_host_->Send(new FrameMsg_SetPepperVolume( |
| 67 render_frame_host_->GetRoutingID(), pp_instance_, volume)); | 67 render_frame_host_->GetRoutingID(), pp_instance_, volume)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace content | 70 } // namespace content |
| OLD | NEW |