OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
37 | 37 |
38 namespace WebCore { | 38 namespace WebCore { |
39 | 39 |
40 class Clock; | 40 class Clock; |
41 class Event; | 41 class Event; |
42 class ExceptionState; | 42 class ExceptionState; |
43 class HTMLMediaElement; | 43 class HTMLMediaElement; |
44 class ExecutionContext; | 44 class ExecutionContext; |
45 | 45 |
46 class MediaController : public RefCounted<MediaController>, public ScriptWrappab
le, public MediaControllerInterface, public EventTargetWithInlineData { | 46 class MediaController FINAL : public RefCounted<MediaController>, public ScriptW
rappable, public MediaControllerInterface, public EventTargetWithInlineData { |
47 REFCOUNTED_EVENT_TARGET(MediaController); | 47 REFCOUNTED_EVENT_TARGET(MediaController); |
48 public: | 48 public: |
49 static PassRefPtr<MediaController> create(ExecutionContext*); | 49 static PassRefPtr<MediaController> create(ExecutionContext*); |
50 virtual ~MediaController(); | 50 virtual ~MediaController(); |
51 | 51 |
52 void addMediaElement(HTMLMediaElement*); | 52 void addMediaElement(HTMLMediaElement*); |
53 void removeMediaElement(HTMLMediaElement*); | 53 void removeMediaElement(HTMLMediaElement*); |
54 bool containsMediaElement(HTMLMediaElement*) const; | 54 bool containsMediaElement(HTMLMediaElement*) const; |
55 | 55 |
56 const String& mediaGroup() const { return m_mediaGroup; } | 56 const String& mediaGroup() const { return m_mediaGroup; } |
57 | 57 |
58 virtual PassRefPtr<TimeRanges> buffered() const; | 58 virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; |
59 virtual PassRefPtr<TimeRanges> seekable() const; | 59 virtual PassRefPtr<TimeRanges> seekable() const OVERRIDE; |
60 virtual PassRefPtr<TimeRanges> played(); | 60 virtual PassRefPtr<TimeRanges> played() OVERRIDE; |
61 | 61 |
62 virtual double duration() const; | 62 virtual double duration() const OVERRIDE; |
63 virtual double currentTime() const; | 63 virtual double currentTime() const OVERRIDE; |
64 virtual void setCurrentTime(double, ExceptionState&); | 64 virtual void setCurrentTime(double, ExceptionState&) OVERRIDE; |
65 | 65 |
66 virtual bool paused() const { return m_paused; } | 66 virtual bool paused() const OVERRIDE { return m_paused; } |
67 virtual void play(); | 67 virtual void play() OVERRIDE; |
68 virtual void pause(); | 68 virtual void pause() OVERRIDE; |
69 void unpause(); | 69 void unpause(); |
70 | 70 |
71 virtual double defaultPlaybackRate() const { return m_defaultPlaybackRate; } | 71 virtual double defaultPlaybackRate() const OVERRIDE { return m_defaultPlayba
ckRate; } |
72 virtual void setDefaultPlaybackRate(double); | 72 virtual void setDefaultPlaybackRate(double) OVERRIDE; |
73 | 73 |
74 virtual double playbackRate() const; | 74 virtual double playbackRate() const OVERRIDE; |
75 virtual void setPlaybackRate(double); | 75 virtual void setPlaybackRate(double) OVERRIDE; |
76 | 76 |
77 virtual double volume() const { return m_volume; } | 77 virtual double volume() const OVERRIDE { return m_volume; } |
78 virtual void setVolume(double, ExceptionState&); | 78 virtual void setVolume(double, ExceptionState&) OVERRIDE; |
79 | 79 |
80 virtual bool muted() const { return m_muted; } | 80 virtual bool muted() const OVERRIDE { return m_muted; } |
81 virtual void setMuted(bool); | 81 virtual void setMuted(bool) OVERRIDE; |
82 | 82 |
83 virtual ReadyState readyState() const { return m_readyState; } | 83 virtual ReadyState readyState() const OVERRIDE { return m_readyState; } |
84 | 84 |
85 enum PlaybackState { WAITING, PLAYING, ENDED }; | 85 enum PlaybackState { WAITING, PLAYING, ENDED }; |
86 const AtomicString& playbackState() const; | 86 const AtomicString& playbackState() const; |
87 | 87 |
88 virtual bool supportsFullscreen() const { return false; } | 88 virtual bool supportsFullscreen() const OVERRIDE { return false; } |
89 virtual bool isFullscreen() const { return false; } | 89 virtual bool isFullscreen() const OVERRIDE { return false; } |
90 virtual void enterFullscreen() { } | 90 virtual void enterFullscreen() OVERRIDE { } |
91 | 91 |
92 virtual bool hasAudio() const; | 92 virtual bool hasAudio() const OVERRIDE; |
93 virtual bool hasVideo() const; | 93 virtual bool hasVideo() const OVERRIDE; |
94 virtual bool hasClosedCaptions() const; | 94 virtual bool hasClosedCaptions() const OVERRIDE; |
95 virtual void setClosedCaptionsVisible(bool); | 95 virtual void setClosedCaptionsVisible(bool) OVERRIDE; |
96 virtual bool closedCaptionsVisible() const { return m_closedCaptionsVisible;
} | 96 virtual bool closedCaptionsVisible() const OVERRIDE { return m_closedCaption
sVisible; } |
97 | 97 |
98 virtual void beginScrubbing(); | 98 virtual void beginScrubbing() OVERRIDE; |
99 virtual void endScrubbing(); | 99 virtual void endScrubbing() OVERRIDE; |
100 | 100 |
101 virtual bool canPlay() const; | 101 virtual bool canPlay() const OVERRIDE; |
102 | 102 |
103 virtual bool hasCurrentSrc() const; | 103 virtual bool hasCurrentSrc() const OVERRIDE; |
104 | 104 |
105 bool isBlocked() const; | 105 bool isBlocked() const; |
106 | 106 |
107 void clearExecutionContext() { m_executionContext = 0; } | 107 void clearExecutionContext() { m_executionContext = 0; } |
108 | 108 |
109 private: | 109 private: |
110 MediaController(ExecutionContext*); | 110 MediaController(ExecutionContext*); |
111 void reportControllerState(); | 111 void reportControllerState(); |
112 void updateReadyState(); | 112 void updateReadyState(); |
113 void updatePlaybackState(); | 113 void updatePlaybackState(); |
(...skipping 28 matching lines...) Expand all Loading... |
142 bool m_closedCaptionsVisible; | 142 bool m_closedCaptionsVisible; |
143 OwnPtr<Clock> m_clock; | 143 OwnPtr<Clock> m_clock; |
144 ExecutionContext* m_executionContext; | 144 ExecutionContext* m_executionContext; |
145 Timer<MediaController> m_timeupdateTimer; | 145 Timer<MediaController> m_timeupdateTimer; |
146 double m_previousTimeupdateTime; | 146 double m_previousTimeupdateTime; |
147 }; | 147 }; |
148 | 148 |
149 } // namespace WebCore | 149 } // namespace WebCore |
150 | 150 |
151 #endif | 151 #endif |
OLD | NEW |