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 <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 int AddObserver(Observer* observer) override; | 41 int AddObserver(Observer* observer) override; |
42 void RemoveObserver(int delegate_id) override; | 42 void RemoveObserver(int delegate_id) override; |
43 void DidPlay(int delegate_id, | 43 void DidPlay(int delegate_id, |
44 bool has_video, | 44 bool has_video, |
45 bool has_audio, | 45 bool has_audio, |
46 bool is_remote, | 46 bool is_remote, |
47 base::TimeDelta duration) override; | 47 base::TimeDelta duration) override; |
48 void DidPause(int delegate_id, bool reached_end_of_stream) override; | 48 void DidPause(int delegate_id, bool reached_end_of_stream) override; |
49 void PlayerGone(int delegate_id) override; | 49 void PlayerGone(int delegate_id) override; |
50 bool IsHidden() override; | 50 bool IsHidden() override; |
| 51 mojom::Remoter* GetRemoter() override; |
51 | 52 |
52 // content::RenderFrameObserver overrides. | 53 // content::RenderFrameObserver overrides. |
53 void WasHidden() override; | 54 void WasHidden() override; |
54 void WasShown() override; | 55 void WasShown() override; |
55 bool OnMessageReceived(const IPC::Message& msg) override; | 56 bool OnMessageReceived(const IPC::Message& msg) override; |
56 void OnDestruct() override; | 57 void OnDestruct() override; |
57 | 58 |
58 // Zeros out |idle_cleanup_interval_|, and sets |idle_timeout_| to | 59 // Zeros out |idle_cleanup_interval_|, and sets |idle_timeout_| to |
59 // |idle_timeout|. A zero cleanup interval will cause the idle timer to run | 60 // |idle_timeout|. A zero cleanup interval will cause the idle timer to run |
60 // with each run of the message loop. | 61 // with each run of the message loop. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 // The polling interval used for checking the delegates to see if any have | 96 // The polling interval used for checking the delegates to see if any have |
96 // exceeded |idle_timeout_| since their last pause state. | 97 // exceeded |idle_timeout_| since their last pause state. |
97 base::TimeDelta idle_cleanup_interval_; | 98 base::TimeDelta idle_cleanup_interval_; |
98 | 99 |
99 // Clock used for calculating when delegates have expired. May be overridden | 100 // Clock used for calculating when delegates have expired. May be overridden |
100 // for testing. | 101 // for testing. |
101 std::unique_ptr<base::DefaultTickClock> default_tick_clock_; | 102 std::unique_ptr<base::DefaultTickClock> default_tick_clock_; |
102 base::TickClock* tick_clock_; | 103 base::TickClock* tick_clock_; |
103 | 104 |
| 105 // Lazy-bound pointer to the Remoter service in the browser process. |
| 106 mojom::RemoterPtr remoter_; |
| 107 |
104 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); | 108 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); |
105 }; | 109 }; |
106 | 110 |
107 } // namespace media | 111 } // namespace media |
108 | 112 |
109 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ | 113 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ |
OLD | NEW |