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

Unified Diff: third_party/WebKit/Source/modules/mediasession/MediaSession.cpp

Issue 2441403002: Add media controls in media notification (Closed)
Patch Set: using Java "enum" generated from mojom 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/strings/android_chrome_strings.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
index af2ae8f94ff1df8ff4f934ebf11ab2582ddd4785..ab3bfc3f92a8dff7c4e705056c2709f5d69d3f48 100644
--- a/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
+++ b/third_party/WebKit/Source/modules/mediasession/MediaSession.cpp
@@ -6,12 +6,14 @@
#include "bindings/core/v8/ScriptState.h"
#include "core/dom/Document.h"
+#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/ExecutionContext.h"
#include "core/events/Event.h"
#include "core/frame/LocalFrame.h"
#include "modules/EventTargetModules.h"
#include "modules/mediasession/MediaMetadata.h"
#include "modules/mediasession/MediaMetadataSanitizer.h"
+#include "platform/UserGestureIndicator.h"
#include "public/platform/InterfaceProvider.h"
#include "wtf/Optional.h"
#include <memory>
@@ -148,6 +150,10 @@ bool MediaSession::removeEventListenerInternal(
void MediaSession::DidReceiveAction(
blink::mojom::blink::MediaSessionAction action) {
+ DCHECK(getExecutionContext()->isDocument());
+ Document* document = toDocument(getExecutionContext());
+ UserGestureIndicator gestureIndicator(
+ DocumentUserGestureToken::create(document));
dispatchEvent(Event::create(mojomActionToEventName(action)));
}
« no previous file with comments | « chrome/android/java/strings/android_chrome_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698