| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
| 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace blink { | 8 namespace blink { |
| 9 class WebMediaPlayer; | 9 class WebMediaPlayer; |
| 10 } | 10 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual void OnHidden() = 0; | 24 virtual void OnHidden() = 0; |
| 25 virtual void OnShown() = 0; | 25 virtual void OnShown() = 0; |
| 26 | 26 |
| 27 // Requests a WebMediaPlayer instance to release all idle resources. If | 27 // Requests a WebMediaPlayer instance to release all idle resources. If |
| 28 // |must_suspend| is true, the player must stop playback, release all idle | 28 // |must_suspend| is true, the player must stop playback, release all idle |
| 29 // resources, and finally call WebMediaPlayerDelegate::PlayerGone(). If | 29 // resources, and finally call WebMediaPlayerDelegate::PlayerGone(). If |
| 30 // |must_suspend| is false, the player may ignore the request. Optionally, | 30 // |must_suspend| is false, the player may ignore the request. Optionally, |
| 31 // it may do some or all of the same actions as when |must_suspend| is true. | 31 // it may do some or all of the same actions as when |must_suspend| is true. |
| 32 // To be clear, the player is not required to call PlayerGone() when | 32 // To be clear, the player is not required to call PlayerGone() when |
| 33 // |must_suspend| is false. | 33 // |must_suspend| is false. |
| 34 virtual void OnSuspendRequested(bool must_suspend) = 0; | 34 // Return false to reject the request and indicate that further calls to |
| 35 // OnSuspendRequested() are required. Otherwise the Observer is removed |
| 36 // from the idle list. |
| 37 virtual bool OnSuspendRequested(bool must_suspend) = 0; |
| 35 | 38 |
| 36 virtual void OnPlay() = 0; | 39 virtual void OnPlay() = 0; |
| 37 virtual void OnPause() = 0; | 40 virtual void OnPause() = 0; |
| 38 | 41 |
| 39 // Playout volume should be set to current_volume * multiplier. The range is | 42 // Playout volume should be set to current_volume * multiplier. The range is |
| 40 // [0, 1] and is typically 1. | 43 // [0, 1] and is typically 1. |
| 41 virtual void OnVolumeMultiplierUpdate(double multiplier) = 0; | 44 virtual void OnVolumeMultiplierUpdate(double multiplier) = 0; |
| 42 }; | 45 }; |
| 43 | 46 |
| 44 WebMediaPlayerDelegate() {} | 47 WebMediaPlayerDelegate() {} |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 // frame. | 77 // frame. |
| 75 virtual bool IsPlayingBackgroundVideo() = 0; | 78 virtual bool IsPlayingBackgroundVideo() = 0; |
| 76 | 79 |
| 77 protected: | 80 protected: |
| 78 virtual ~WebMediaPlayerDelegate() {} | 81 virtual ~WebMediaPlayerDelegate() {} |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace media | 84 } // namespace media |
| 82 | 85 |
| 83 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ | 86 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_DELEGATE_H_ |
| OLD | NEW |