| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 6 #define CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void MaybeUpdateAudibleState(bool recently_audible); | 33 void MaybeUpdateAudibleState(bool recently_audible); |
| 34 | 34 |
| 35 // WebContentsObserver implementation. | 35 // WebContentsObserver implementation. |
| 36 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; | 36 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| 37 bool OnMessageReceived(const IPC::Message& message, | 37 bool OnMessageReceived(const IPC::Message& message, |
| 38 RenderFrameHost* render_frame_host) override; | 38 RenderFrameHost* render_frame_host) override; |
| 39 void WasShown() override; | 39 void WasShown() override; |
| 40 void WasHidden() override; | 40 void WasHidden() override; |
| 41 | 41 |
| 42 bool has_audio_power_save_blocker_for_testing() const { | 42 bool has_audio_power_save_blocker_for_testing() const { |
| 43 return audio_power_save_blocker_; | 43 return !!audio_power_save_blocker_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool has_video_power_save_blocker_for_testing() const { | 46 bool has_video_power_save_blocker_for_testing() const { |
| 47 return video_power_save_blocker_; | 47 return !!video_power_save_blocker_; |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host, | 51 void OnMediaPlayingNotification(RenderFrameHost* render_frame_host, |
| 52 int64_t player_cookie, | 52 int64_t player_cookie, |
| 53 bool has_video, | 53 bool has_video, |
| 54 bool has_audio, | 54 bool has_audio, |
| 55 bool is_remote); | 55 bool is_remote); |
| 56 void OnMediaPausedNotification(RenderFrameHost* render_frame_host, | 56 void OnMediaPausedNotification(RenderFrameHost* render_frame_host, |
| 57 int64_t player_cookie); | 57 int64_t player_cookie); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 87 ActiveMediaPlayerMap active_video_players_; | 87 ActiveMediaPlayerMap active_video_players_; |
| 88 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; | 88 scoped_ptr<PowerSaveBlocker> audio_power_save_blocker_; |
| 89 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; | 89 scoped_ptr<PowerSaveBlocker> video_power_save_blocker_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserver); | 91 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserver); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace content | 94 } // namespace content |
| 95 | 95 |
| 96 #endif // CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ | 96 #endif // CONTENT_BROWSER_MEDIA_MEDIA_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |