OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ |
6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ | 6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void WasHidden() override; | 46 void WasHidden() override; |
47 void WasShown() override; | 47 void WasShown() override; |
48 bool OnMessageReceived(const IPC::Message& msg) override; | 48 bool OnMessageReceived(const IPC::Message& msg) override; |
49 | 49 |
50 private: | 50 private: |
51 void OnMediaDelegatePause(int delegate_id); | 51 void OnMediaDelegatePause(int delegate_id); |
52 void OnMediaDelegatePlay(int delegate_id); | 52 void OnMediaDelegatePlay(int delegate_id); |
53 void OnMediaDelegateVolumeMultiplierUpdate(int delegate_id, | 53 void OnMediaDelegateVolumeMultiplierUpdate(int delegate_id, |
54 double multiplier); | 54 double multiplier); |
55 | 55 |
| 56 // For platforms which require playback focus approval this will initialize |
| 57 // the volume multiplier to zero. It will be set correctly by the browser |
| 58 // after playback is approved or the playback will be paused if not. |
| 59 // |
| 60 // Currently this is only done on Android. |
| 61 void MuteObserverUntilPlaybackFocusApproved(int delegate_id); |
| 62 |
56 bool has_played_media_ = false; | 63 bool has_played_media_ = false; |
57 IDMap<Observer> id_map_; | 64 IDMap<Observer> id_map_; |
58 | 65 |
59 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); | 66 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); |
60 }; | 67 }; |
61 | 68 |
62 } // namespace media | 69 } // namespace media |
63 | 70 |
64 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ | 71 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ |
OLD | NEW |