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

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

Issue 2464163004: [RemotePlayback] Implement 'connecting' state (Closed)
Patch Set: Fixed mocks 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 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after
3086 mediaControls()->refreshCastButtonVisibility(); 3086 mediaControls()->refreshCastButtonVisibility();
3087 if (remotePlaybackClient()) 3087 if (remotePlaybackClient())
3088 remotePlaybackClient()->availabilityChanged(routesAvailable); 3088 remotePlaybackClient()->availabilityChanged(routesAvailable);
3089 } 3089 }
3090 3090
3091 void HTMLMediaElement::connectedToRemoteDevice() { 3091 void HTMLMediaElement::connectedToRemoteDevice() {
3092 m_playingRemotely = true; 3092 m_playingRemotely = true;
3093 if (mediaControls()) 3093 if (mediaControls())
3094 mediaControls()->startedCasting(); 3094 mediaControls()->startedCasting();
3095 if (remotePlaybackClient()) 3095 if (remotePlaybackClient())
3096 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connected); 3096 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connecting);
3097 } 3097 }
3098 3098
3099 void HTMLMediaElement::disconnectedFromRemoteDevice() { 3099 void HTMLMediaElement::disconnectedFromRemoteDevice() {
3100 m_playingRemotely = false; 3100 m_playingRemotely = false;
3101 if (mediaControls()) 3101 if (mediaControls())
3102 mediaControls()->stoppedCasting(); 3102 mediaControls()->stoppedCasting();
3103 if (remotePlaybackClient()) 3103 if (remotePlaybackClient())
3104 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Disconnected); 3104 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Disconnected);
3105 } 3105 }
3106 3106
3107 void HTMLMediaElement::cancelledRemotePlaybackRequest() { 3107 void HTMLMediaElement::cancelledRemotePlaybackRequest() {
3108 if (remotePlaybackClient()) 3108 if (remotePlaybackClient())
3109 remotePlaybackClient()->promptCancelled(); 3109 remotePlaybackClient()->promptCancelled();
3110 } 3110 }
3111 3111
3112 void HTMLMediaElement::remotePlaybackStarted() {
3113 if (remotePlaybackClient())
3114 remotePlaybackClient()->stateChanged(WebRemotePlaybackState::Connected);
3115 }
3116
3112 void HTMLMediaElement::requestReload(const WebURL& newUrl) { 3117 void HTMLMediaElement::requestReload(const WebURL& newUrl) {
3113 DCHECK(webMediaPlayer()); 3118 DCHECK(webMediaPlayer());
3114 DCHECK(!m_srcObject); 3119 DCHECK(!m_srcObject);
3115 DCHECK(newUrl.isValid()); 3120 DCHECK(newUrl.isValid());
3116 DCHECK(isSafeToLoadURL(newUrl, Complain)); 3121 DCHECK(isSafeToLoadURL(newUrl, Complain));
3117 resetMediaPlayerAndMediaSource(); 3122 resetMediaPlayerAndMediaSource();
3118 startPlayerLoad(newUrl); 3123 startPlayerLoad(newUrl);
3119 } 3124 }
3120 3125
3121 // MediaPlayerPresentation methods 3126 // MediaPlayerPresentation methods
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 4097
4093 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() 4098 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect()
4094 const { 4099 const {
4095 IntRect result; 4100 IntRect result;
4096 if (LayoutObject* object = m_element->layoutObject()) 4101 if (LayoutObject* object = m_element->layoutObject())
4097 result = object->absoluteBoundingBoxRect(); 4102 result = object->absoluteBoundingBoxRect();
4098 return result; 4103 return result;
4099 } 4104 }
4100 4105
4101 } // namespace blink 4106 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698