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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2464163004: [RemotePlayback] Implement 'connecting' state (Closed)
Patch Set: Rebased 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3166 mediaControls()->refreshCastButtonVisibility(); 3166 mediaControls()->refreshCastButtonVisibility();
3167 if (remotePlaybackClient()) 3167 if (remotePlaybackClient())
3168 remotePlaybackClient()->availabilityChanged(routesAvailable); 3168 remotePlaybackClient()->availabilityChanged(routesAvailable);
3169 } 3169 }
3170 3170
3171 void HTMLMediaElement::connectedToRemoteDevice() { 3171 void HTMLMediaElement::connectedToRemoteDevice() {
3172 m_playingRemotely = true; 3172 m_playingRemotely = true;
3173 if (mediaControls()) 3173 if (mediaControls())
3174 mediaControls()->startedCasting(); 3174 mediaControls()->startedCasting();
3175 if (remotePlaybackClient()) 3175 if (remotePlaybackClient())
3176 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connected); 3176 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connecting);
3177 } 3177 }
3178 3178
3179 void HTMLMediaElement::disconnectedFromRemoteDevice() { 3179 void HTMLMediaElement::disconnectedFromRemoteDevice() {
3180 m_playingRemotely = false; 3180 m_playingRemotely = false;
3181 if (mediaControls()) 3181 if (mediaControls())
3182 mediaControls()->stoppedCasting(); 3182 mediaControls()->stoppedCasting();
3183 if (remotePlaybackClient()) 3183 if (remotePlaybackClient())
3184 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Disconnected); 3184 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Disconnected);
3185 } 3185 }
3186 3186
3187 void HTMLMediaElement::cancelledRemotePlaybackRequest() { 3187 void HTMLMediaElement::cancelledRemotePlaybackRequest() {
3188 if (remotePlaybackClient()) 3188 if (remotePlaybackClient())
3189 remotePlaybackClient()->promptCancelled(); 3189 remotePlaybackClient()->promptCancelled();
3190 } 3190 }
3191 3191
3192 void HTMLMediaElement::remotePlaybackStarted() {
3193 if (remotePlaybackClient())
3194 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connected);
3195 }
3196
3192 bool HTMLMediaElement::isAutoplayingMuted() { 3197 bool HTMLMediaElement::isAutoplayingMuted() {
3193 if (!isHTMLVideoElement() || 3198 if (!isHTMLVideoElement() ||
3194 !RuntimeEnabledFeatures::autoplayMutedVideosEnabled()) { 3199 !RuntimeEnabledFeatures::autoplayMutedVideosEnabled()) {
3195 return false; 3200 return false;
3196 } 3201 }
3197 3202
3198 return !paused() && muted() && isLockedPendingUserGesture(); 3203 return !paused() && muted() && isLockedPendingUserGesture();
3199 } 3204 }
3200 3205
3201 void HTMLMediaElement::requestReload(const WebURL& newUrl) { 3206 void HTMLMediaElement::requestReload(const WebURL& newUrl) {
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
4178 4183
4179 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() 4184 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect()
4180 const { 4185 const {
4181 IntRect result; 4186 IntRect result;
4182 if (LayoutObject* object = m_element->layoutObject()) 4187 if (LayoutObject* object = m_element->layoutObject())
4183 result = object->absoluteBoundingBoxRect(); 4188 result = object->absoluteBoundingBoxRect();
4184 return result; 4189 return result;
4185 } 4190 }
4186 4191
4187 } // namespace blink 4192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698