Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: content/renderer/media/renderer_webmediaplayer_delegate.h

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 #if defined(OS_ANDROID) 21 #if defined(OS_ANDROID)
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #endif // OS_ANDROID 23 #endif // OS_ANDROID
24 24
25 namespace blink { 25 namespace blink {
26 class WebMediaPlayer; 26 class WebMediaPlayer;
27 } 27 }
28 28
29 namespace media { 29 namespace media {
30 30
31 enum class MediaContentType;
32
31 // An interface to allow a WebMediaPlayerImpl to communicate changes of state 33 // An interface to allow a WebMediaPlayerImpl to communicate changes of state
32 // to objects that need to know. 34 // to objects that need to know.
33 class CONTENT_EXPORT RendererWebMediaPlayerDelegate 35 class CONTENT_EXPORT RendererWebMediaPlayerDelegate
34 : public content::RenderFrameObserver, 36 : public content::RenderFrameObserver,
35 public NON_EXPORTED_BASE(WebMediaPlayerDelegate), 37 public NON_EXPORTED_BASE(WebMediaPlayerDelegate),
36 public NON_EXPORTED_BASE( 38 public NON_EXPORTED_BASE(
37 base::SupportsWeakPtr<RendererWebMediaPlayerDelegate>) { 39 base::SupportsWeakPtr<RendererWebMediaPlayerDelegate>) {
38 public: 40 public:
39 explicit RendererWebMediaPlayerDelegate(content::RenderFrame* render_frame); 41 explicit RendererWebMediaPlayerDelegate(content::RenderFrame* render_frame);
40 ~RendererWebMediaPlayerDelegate() override; 42 ~RendererWebMediaPlayerDelegate() override;
41 43
42 // Returns true if this RenderFrame has ever seen media playback before. 44 // Returns true if this RenderFrame has ever seen media playback before.
43 bool has_played_media() const { return has_played_media_; } 45 bool has_played_media() const { return has_played_media_; }
44 46
45 // WebMediaPlayerDelegate implementation. 47 // WebMediaPlayerDelegate implementation.
46 int AddObserver(Observer* observer) override; 48 int AddObserver(Observer* observer) override;
47 void RemoveObserver(int delegate_id) override; 49 void RemoveObserver(int delegate_id) override;
48 void DidPlay(int delegate_id, 50 void DidPlay(int delegate_id,
49 bool has_video, 51 bool has_video,
50 bool has_audio, 52 bool has_audio,
51 bool is_remote, 53 bool is_remote,
52 base::TimeDelta duration) override; 54 MediaContentType media_content_type) override;
53 void DidPause(int delegate_id, bool reached_end_of_stream) override; 55 void DidPause(int delegate_id, bool reached_end_of_stream) override;
54 void PlayerGone(int delegate_id) override; 56 void PlayerGone(int delegate_id) override;
55 bool IsHidden() override; 57 bool IsHidden() override;
56 bool IsPlayingBackgroundVideo() override; 58 bool IsPlayingBackgroundVideo() override;
57 59
58 // content::RenderFrameObserver overrides. 60 // content::RenderFrameObserver overrides.
59 void WasHidden() override; 61 void WasHidden() override;
60 void WasShown() override; 62 void WasShown() override;
61 bool OnMessageReceived(const IPC::Message& msg) override; 63 bool OnMessageReceived(const IPC::Message& msg) override;
62 void OnDestruct() override; 64 void OnDestruct() override;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // OnMediaDelegatePlay() should allow the videos to play in the background or 128 // OnMediaDelegatePlay() should allow the videos to play in the background or
127 // not. 129 // not.
128 std::set<int> playing_videos_; 130 std::set<int> playing_videos_;
129 131
130 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); 132 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate);
131 }; 133 };
132 134
133 } // namespace media 135 } // namespace media
134 136
135 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 137 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.cc ('k') | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698