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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2587083002: Media Controls: add comments regarding cast/remote related calls from element. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControls.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index cd50a3baaef58bdc1e26e7f12e7b61cdcffb8efc..23c2a4e06df643fbb8827d0830195da37120fb57 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -548,8 +548,11 @@ void HTMLMediaElement::parseAttribute(const QualifiedName& name,
if (oldValue != value) {
if (m_webMediaPlayer)
m_webMediaPlayer->requestRemotePlaybackDisabled(!value.isNull());
+ // TODO(mlamouri): there is no direct API to expose if
+ // disableRemotePLayback attribute has changed. It will require a direct
+ // access to MediaControls for the moment.
if (mediaControls())
- mediaControls()->refreshCastButtonVisibility();
+ mediaControls()->onDisableRemotePlaybackAttributeChanged();
}
} else {
HTMLElement::parseAttribute(name, oldValue, value);
@@ -3087,29 +3090,44 @@ void HTMLMediaElement::remoteRouteAvailabilityChanged(
WebRemotePlaybackAvailability availability) {
if (remotePlaybackClient())
remotePlaybackClient()->availabilityChanged(availability);
+
+ // TODO(mlamouri): the RemotePlayback object should be used in order to
+ // register to watch availability but the object is in modules/ and core/ has
+ // no access to it. It will have to be done when the media controls move to
+ // modules/.
if (mediaControls())
- mediaControls()->refreshCastButtonVisibility();
+ mediaControls()->onRemotePlaybackAvailabilityChanged();
}
bool HTMLMediaElement::hasRemoteRoutes() const {
+ // TODO(mlamouri): this is only used for controls related code. It shouldn't
+ // live in HTMLMediaElement.
return remotePlaybackClient() &&
remotePlaybackClient()->remotePlaybackAvailable();
}
void HTMLMediaElement::connectedToRemoteDevice() {
m_playingRemotely = true;
- if (mediaControls())
- mediaControls()->startedCasting();
if (remotePlaybackClient())
remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connecting);
+
+ // TODO(mlamouri): the RemotePlayback object should be used in order to listen
+ // for events but the object is in modules/ and core/ has no access to it. It
+ // will have to be done when the media controls move to modules/.
+ if (mediaControls())
+ mediaControls()->onRemotePlaybackConnecting();
}
void HTMLMediaElement::disconnectedFromRemoteDevice() {
m_playingRemotely = false;
- if (mediaControls())
- mediaControls()->stoppedCasting();
if (remotePlaybackClient())
remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Disconnected);
+
+ // TODO(mlamouri): the RemotePlayback object should be used in order to listen
+ // for events but the object is in modules/ and core/ has no access to it. It
+ // will have to be done when the media controls move to modules/.
+ if (mediaControls())
+ mediaControls()->onRemotePlaybackDisconnected();
}
void HTMLMediaElement::cancelledRemotePlaybackRequest() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698