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

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

Issue 2479603003: Revert of Adding new media controls to MediaNotification (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « content/public/browser/media_session_observer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "modules/mediasession/MediaSession.h" 5 #include "modules/mediasession/MediaSession.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/DocumentUserGestureToken.h"
10 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
11 #include "core/events/Event.h" 10 #include "core/events/Event.h"
12 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
13 #include "modules/EventTargetModules.h" 12 #include "modules/EventTargetModules.h"
14 #include "modules/mediasession/MediaMetadata.h" 13 #include "modules/mediasession/MediaMetadata.h"
15 #include "modules/mediasession/MediaMetadataSanitizer.h" 14 #include "modules/mediasession/MediaMetadataSanitizer.h"
16 #include "platform/UserGestureIndicator.h"
17 #include "public/platform/InterfaceProvider.h" 15 #include "public/platform/InterfaceProvider.h"
18 #include "wtf/Optional.h" 16 #include "wtf/Optional.h"
19 #include <memory> 17 #include <memory>
20 18
21 namespace blink { 19 namespace blink {
22 20
23 namespace { 21 namespace {
24 22
25 using ::blink::mojom::blink::MediaSessionAction; 23 using ::blink::mojom::blink::MediaSessionAction;
26 24
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 getService(m_scriptState.get())) { 141 getService(m_scriptState.get())) {
144 auto mojomAction = eventNameToMojomAction(eventType); 142 auto mojomAction = eventNameToMojomAction(eventType);
145 DCHECK(mojomAction.has_value()); 143 DCHECK(mojomAction.has_value());
146 service->DisableAction(mojomAction.value()); 144 service->DisableAction(mojomAction.value());
147 } 145 }
148 return EventTarget::removeEventListenerInternal(eventType, listener, options); 146 return EventTarget::removeEventListenerInternal(eventType, listener, options);
149 } 147 }
150 148
151 void MediaSession::DidReceiveAction( 149 void MediaSession::DidReceiveAction(
152 blink::mojom::blink::MediaSessionAction action) { 150 blink::mojom::blink::MediaSessionAction action) {
153 DCHECK(getExecutionContext()->isDocument());
154 Document* document = toDocument(getExecutionContext());
155 UserGestureIndicator gestureIndicator(
156 DocumentUserGestureToken::create(document));
157 dispatchEvent(Event::create(mojomActionToEventName(action))); 151 dispatchEvent(Event::create(mojomActionToEventName(action)));
158 } 152 }
159 153
160 DEFINE_TRACE(MediaSession) { 154 DEFINE_TRACE(MediaSession) {
161 visitor->trace(m_metadata); 155 visitor->trace(m_metadata);
162 EventTargetWithInlineData::trace(visitor); 156 EventTargetWithInlineData::trace(visitor);
163 } 157 }
164 158
165 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « content/public/browser/media_session_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698