MediaRemoteControls.h [plain text]
#pragma once
#if ENABLE(MEDIA_SESSION)
#include "EventTarget.h"
#include <wtf/RefCounted.h>
namespace WebCore {
class MediaSession;
class MediaRemoteControls : public RefCounted<MediaRemoteControls>, public EventTargetWithInlineData {
public:
static Ref<MediaRemoteControls> create(ScriptExecutionContext& context, MediaSession* session = nullptr)
{
return adoptRef(*new MediaRemoteControls(context, session));
}
bool previousTrackEnabled() const { return m_previousTrackEnabled; }
void setPreviousTrackEnabled(bool);
bool nextTrackEnabled() const { return m_nextTrackEnabled; }
void setNextTrackEnabled(bool);
using RefCounted<MediaRemoteControls>::ref;
using RefCounted<MediaRemoteControls>::deref;
void clearSession();
virtual ~MediaRemoteControls();
EventTargetInterface eventTargetInterface() const override { return MediaRemoteControlsEventTargetInterfaceType; }
ScriptExecutionContext* scriptExecutionContext() const override { return &m_scriptExecutionContext; }
private:
MediaRemoteControls(ScriptExecutionContext&, MediaSession*);
ScriptExecutionContext& m_scriptExecutionContext;
bool m_previousTrackEnabled { false };
bool m_nextTrackEnabled { false };
MediaSession* m_session { nullptr };
void refEventTarget() final { ref(); }
void derefEventTarget() final { deref(); }
};
}
#endif // ENABLE(MEDIA_SESSION)