| 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 "chromecast/browser/cast_media_blocker.h" | 5 #include "chromecast/browser/cast_media_blocker.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_checker.h" | 7 #include "base/threading/thread_checker.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 | 9 |
| 10 namespace chromecast { | 10 namespace chromecast { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 if (state_ == BLOCKED && !suspended_) { | 42 if (state_ == BLOCKED && !suspended_) { |
| 43 web_contents()->SuspendMediaSession(); | 43 web_contents()->SuspendMediaSession(); |
| 44 } else if (state_ == UNBLOCKING && suspended_) { | 44 } else if (state_ == UNBLOCKING && suspended_) { |
| 45 web_contents()->ResumeMediaSession(); | 45 web_contents()->ResumeMediaSession(); |
| 46 state_ = UNBLOCKED; | 46 state_ = UNBLOCKED; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void CastMediaBlocker::MediaSessionStateChanged( | 50 void CastMediaBlocker::MediaSessionStateChanged(bool is_controllable, |
| 51 bool is_controllable, | 51 bool is_suspended) { |
| 52 bool is_suspended, | |
| 53 const base::Optional<content::MediaMetadata>& metadata) { | |
| 54 controllable_ = is_controllable; | 52 controllable_ = is_controllable; |
| 55 suspended_ = is_suspended; | 53 suspended_ = is_suspended; |
| 56 UpdateMediaBlockedState(); | 54 UpdateMediaBlockedState(); |
| 57 } | 55 } |
| 58 | 56 |
| 59 } // namespace shell | 57 } // namespace shell |
| 60 } // namespace chromecast | 58 } // namespace chromecast |
| OLD | NEW |