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

Unified Diff: third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp

Issue 2348703002: [Blink, RemotePlayback] Added the disableRemotePlayback check to prompt(). (Closed)
Patch Set: Removed the newline from expected.txt Created 4 years, 3 months 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 | « third_party/WebKit/LayoutTests/media/remoteplayback/disable-remote-playback-prompt-throws.html ('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/remoteplayback/RemotePlayback.cpp
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
index a79e321554cd934336f420935d49d64160b2c75b..063d01b780ae362caac540c498ff23a6f15f231a 100644
--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
+++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlayback.cpp
@@ -5,6 +5,7 @@
#include "modules/remoteplayback/RemotePlayback.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "core/HTMLNames.h"
#include "core/dom/DOMException.h"
#include "core/dom/Document.h"
#include "core/events/Event.h"
@@ -82,11 +83,16 @@ ScriptPromise RemotePlayback::getAvailability(ScriptState* scriptState)
ScriptPromise RemotePlayback::prompt(ScriptState* scriptState)
{
- // TODO(avayvod): implement steps 3, 4, 5, 8, 9 of the algorithm.
+ // TODO(avayvod): implement steps 4, 5, 8, 9 of the algorithm.
// https://crbug.com/647441
ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
+ if (m_mediaElement->fastHasAttribute(HTMLNames::disableremoteplaybackAttr)) {
+ resolver->reject(DOMException::create(InvalidStateError, "disableRemotePlayback attribute is present."));
+ return promise;
+ }
+
// TODO(avayvod): should we have a separate flag to disable the user gesture
// requirement (for tests) or reuse the one for the PresentationRequest::start()?
if (!UserGestureIndicator::utilizeUserGesture()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/media/remoteplayback/disable-remote-playback-prompt-throws.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698