| 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 #include <set> | 10 #include <set> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 bool IsStale(int player_id) override; | 59 bool IsStale(int player_id) override; |
| 60 void SetIsEffectivelyFullscreen(int player_id, bool is_fullscreen) override; | 60 void SetIsEffectivelyFullscreen(int player_id, bool is_fullscreen) override; |
| 61 | 61 |
| 62 // content::RenderFrameObserver overrides. | 62 // content::RenderFrameObserver overrides. |
| 63 void WasHidden() override; | 63 void WasHidden() override; |
| 64 void WasShown() override; | 64 void WasShown() override; |
| 65 bool OnMessageReceived(const IPC::Message& msg) override; | 65 bool OnMessageReceived(const IPC::Message& msg) override; |
| 66 void OnDestruct() override; | 66 void OnDestruct() override; |
| 67 | 67 |
| 68 // Zeros out |idle_cleanup_interval_|, sets |idle_timeout_| to |idle_timeout|, | 68 // Zeros out |idle_cleanup_interval_|, sets |idle_timeout_| to |idle_timeout|, |
| 69 // and |is_low_end_device_| to |is_low_end_device|. A zero cleanup interval | 69 // and |is_jelly_bean_| to |is_jelly_bean|. A zero cleanup interval |
| 70 // will cause the idle timer to run with each run of the message loop. | 70 // will cause the idle timer to run with each run of the message loop. |
| 71 void SetIdleCleanupParamsForTesting(base::TimeDelta idle_timeout, | 71 void SetIdleCleanupParamsForTesting(base::TimeDelta idle_timeout, |
| 72 base::TickClock* tick_clock, | 72 base::TickClock* tick_clock, |
| 73 bool is_low_end_device); | 73 bool is_jelly_bean); |
| 74 bool IsIdleCleanupTimerRunningForTesting() const; | 74 bool IsIdleCleanupTimerRunningForTesting() const; |
| 75 | 75 |
| 76 // Note: Does not call OnFrameHidden()/OnFrameShown(). | 76 // Note: Does not call OnFrameHidden()/OnFrameShown(). |
| 77 void SetFrameHiddenForTesting(bool is_hidden); | 77 void SetFrameHiddenForTesting(bool is_hidden); |
| 78 | 78 |
| 79 friend class RendererWebMediaPlayerDelegateTest; | 79 friend class RendererWebMediaPlayerDelegateTest; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 void OnMediaDelegatePause(int player_id); | 82 void OnMediaDelegatePause(int player_id); |
| 83 void OnMediaDelegatePlay(int player_id); | 83 void OnMediaDelegatePlay(int player_id); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 base::TimeTicks background_video_start_time_; | 138 base::TimeTicks background_video_start_time_; |
| 139 #endif // OS_ANDROID | 139 #endif // OS_ANDROID |
| 140 | 140 |
| 141 // The currently playing local videos. Used to determine whether | 141 // The currently playing local videos. Used to determine whether |
| 142 // OnMediaDelegatePlay() should allow the videos to play in the background or | 142 // OnMediaDelegatePlay() should allow the videos to play in the background or |
| 143 // not. | 143 // not. |
| 144 std::set<int> playing_videos_; | 144 std::set<int> playing_videos_; |
| 145 | 145 |
| 146 // Determined at construction time based on system information; determines | 146 // Determined at construction time based on system information; determines |
| 147 // when the idle cleanup timer should be fired more aggressively. | 147 // when the idle cleanup timer should be fired more aggressively. |
| 148 bool is_low_end_device_; | 148 bool is_jelly_bean_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); | 150 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace media | 153 } // namespace media |
| 154 | 154 |
| 155 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ | 155 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ |
| OLD | NEW |