Chromium Code Reviews| Index: content/browser/media/android/media_session.cc |
| diff --git a/content/browser/media/android/media_session.cc b/content/browser/media/android/media_session.cc |
| index a8b64efec4c97877fd06bbb644fb14dc63781919..0c66243dc03665c0debe241efc5934416a46be09 100644 |
| --- a/content/browser/media/android/media_session.cc |
| +++ b/content/browser/media/android/media_session.cc |
| @@ -55,6 +55,26 @@ MediaSession::~MediaSession() { |
| DCHECK(audio_focus_state_ == State::INACTIVE); |
| } |
| +bool MediaSession::Activate() { |
| + if (audio_focus_state_ == State::ACTIVE) |
| + return true; |
| + |
| + const Type type = Type::Content; |
| + if (!RequestSystemAudioFocus(type)) |
| + return false; |
| + |
| + audio_focus_state_ = State::ACTIVE; |
| + audio_focus_type_ = type; |
| + UpdateWebContents(); |
| + |
| + return true; |
| +} |
| + |
| +void MediaSession::Deactivate() { |
| + AbandonSystemAudioFocusIfNeeded(); |
|
mlamouri (slow - plz ping)
2015/08/24 12:55:24
Looking at that code, it's a bit odd that RequestS
philipj_slow
2015/08/26 07:39:48
Yes, this doesn't make any sense, I just hacked un
|
| + DCHECK(audio_focus_state_ == State::INACTIVE); |
| +} |
| + |
| bool MediaSession::AddPlayer(MediaSessionObserver* observer, |
| int player_id, |
| Type type) { |