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

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.h

Issue 2583463002: [MediaSession] Add playbackState attribute to Blink MediaSession and use it to determine playback s… (Closed)
Patch Set: browser tests Created 4 years 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 MediaSession_h 5 #ifndef MediaSession_h
6 #define MediaSession_h 6 #define MediaSession_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/ContextLifecycleObserver.h" 9 #include "core/dom/ContextLifecycleObserver.h"
10 #include "core/events/EventTarget.h" 10 #include "core/events/EventTarget.h"
(...skipping 14 matching lines...) Expand all
25 blink::mojom::blink::MediaSessionClient { 25 blink::mojom::blink::MediaSessionClient {
26 USING_GARBAGE_COLLECTED_MIXIN(MediaSession); 26 USING_GARBAGE_COLLECTED_MIXIN(MediaSession);
27 DEFINE_WRAPPERTYPEINFO(); 27 DEFINE_WRAPPERTYPEINFO();
28 USING_PRE_FINALIZER(MediaSession, dispose); 28 USING_PRE_FINALIZER(MediaSession, dispose);
29 29
30 public: 30 public:
31 static MediaSession* create(ExecutionContext*); 31 static MediaSession* create(ExecutionContext*);
32 32
33 void dispose(); 33 void dispose();
34 34
35 void setPlaybackState(const String&);
36 String playbackState();
37
35 void setMetadata(MediaMetadata*); 38 void setMetadata(MediaMetadata*);
36 MediaMetadata* metadata() const; 39 MediaMetadata* metadata() const;
37 40
38 // EventTarget implementation. 41 // EventTarget implementation.
39 const WTF::AtomicString& interfaceName() const override; 42 const WTF::AtomicString& interfaceName() const override;
40 ExecutionContext* getExecutionContext() const override; 43 ExecutionContext* getExecutionContext() const override;
41 44
42 DEFINE_ATTRIBUTE_EVENT_LISTENER(play); 45 DEFINE_ATTRIBUTE_EVENT_LISTENER(play);
43 DEFINE_ATTRIBUTE_EVENT_LISTENER(pause); 46 DEFINE_ATTRIBUTE_EVENT_LISTENER(pause);
44 DEFINE_ATTRIBUTE_EVENT_LISTENER(playpause); 47 DEFINE_ATTRIBUTE_EVENT_LISTENER(playpause);
(...skipping 17 matching lines...) Expand all
62 bool removeEventListenerInternal(const AtomicString& eventType, 65 bool removeEventListenerInternal(const AtomicString& eventType,
63 const EventListener*, 66 const EventListener*,
64 const EventListenerOptions&) override; 67 const EventListenerOptions&) override;
65 68
66 // blink::mojom::blink::MediaSessionClient implementation. 69 // blink::mojom::blink::MediaSessionClient implementation.
67 void DidReceiveAction(blink::mojom::blink::MediaSessionAction) override; 70 void DidReceiveAction(blink::mojom::blink::MediaSessionAction) override;
68 71
69 // Returns null when the ExecutionContext is not document. 72 // Returns null when the ExecutionContext is not document.
70 mojom::blink::MediaSessionService* getService(); 73 mojom::blink::MediaSessionService* getService();
71 74
75 mojom::blink::MediaSessionPlaybackState m_playbackState;
72 Member<MediaMetadata> m_metadata; 76 Member<MediaMetadata> m_metadata;
73 mojom::blink::MediaSessionServicePtr m_service; 77 mojom::blink::MediaSessionServicePtr m_service;
74 mojo::Binding<blink::mojom::blink::MediaSessionClient> m_clientBinding; 78 mojo::Binding<blink::mojom::blink::MediaSessionClient> m_clientBinding;
75 }; 79 };
76 80
77 } // namespace blink 81 } // namespace blink
78 82
79 #endif // MediaSession_h 83 #endif // MediaSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698