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

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

Issue 2782373002: Remove MediaControls methods needed for the Cast button (Closed)
Patch Set: Fixed more tests Created 3 years, 8 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 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 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after
3152 3152
3153 void HTMLMediaElement::RequestSeek(double time) { 3153 void HTMLMediaElement::RequestSeek(double time) {
3154 // The player is the source of this seek request. 3154 // The player is the source of this seek request.
3155 setCurrentTime(time); 3155 setCurrentTime(time);
3156 } 3156 }
3157 3157
3158 void HTMLMediaElement::RemoteRouteAvailabilityChanged( 3158 void HTMLMediaElement::RemoteRouteAvailabilityChanged(
3159 WebRemotePlaybackAvailability availability) { 3159 WebRemotePlaybackAvailability availability) {
3160 if (RemotePlaybackClient()) 3160 if (RemotePlaybackClient())
3161 RemotePlaybackClient()->AvailabilityChanged(availability); 3161 RemotePlaybackClient()->AvailabilityChanged(availability);
3162
3163 // TODO(mlamouri): the RemotePlayback object should be used in order to
3164 // register to watch availability but the object is in modules/ and core/ has
3165 // no access to it. It will have to be done when the media controls move to
3166 // modules/.
3167 if (GetMediaControls())
3168 GetMediaControls()->OnRemotePlaybackAvailabilityChanged();
3169 } 3162 }
3170 3163
3171 bool HTMLMediaElement::HasRemoteRoutes() const { 3164 bool HTMLMediaElement::HasRemoteRoutes() const {
3172 // TODO(mlamouri): this is only used for controls related code. It shouldn't 3165 // TODO(mlamouri): used by MediaControlsPainter; should be refactored out.
3173 // live in HTMLMediaElement.
3174 return RemotePlaybackClient() && 3166 return RemotePlaybackClient() &&
3175 RemotePlaybackClient()->RemotePlaybackAvailable(); 3167 RemotePlaybackClient()->RemotePlaybackAvailable();
3176 } 3168 }
3177 3169
3178 void HTMLMediaElement::ConnectedToRemoteDevice() { 3170 void HTMLMediaElement::ConnectedToRemoteDevice() {
3179 playing_remotely_ = true; 3171 playing_remotely_ = true;
3180 if (RemotePlaybackClient()) 3172 if (RemotePlaybackClient())
3181 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnecting); 3173 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnecting);
3182
3183 // TODO(mlamouri): the RemotePlayback object should be used in order to listen
3184 // for events but the object is in modules/ and core/ has no access to it. It
3185 // will have to be done when the media controls move to modules/.
3186 if (GetMediaControls())
3187 GetMediaControls()->OnRemotePlaybackConnecting();
3188 } 3174 }
3189 3175
3190 void HTMLMediaElement::DisconnectedFromRemoteDevice() { 3176 void HTMLMediaElement::DisconnectedFromRemoteDevice() {
3191 playing_remotely_ = false; 3177 playing_remotely_ = false;
3192 if (RemotePlaybackClient()) 3178 if (RemotePlaybackClient())
3193 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kDisconnected); 3179 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kDisconnected);
3194
3195 // TODO(mlamouri): the RemotePlayback object should be used in order to listen
3196 // for events but the object is in modules/ and core/ has no access to it. It
3197 // will have to be done when the media controls move to modules/.
3198 if (GetMediaControls())
3199 GetMediaControls()->OnRemotePlaybackDisconnected();
3200 } 3180 }
3201 3181
3202 void HTMLMediaElement::CancelledRemotePlaybackRequest() { 3182 void HTMLMediaElement::CancelledRemotePlaybackRequest() {
3203 if (RemotePlaybackClient()) 3183 if (RemotePlaybackClient())
3204 RemotePlaybackClient()->PromptCancelled(); 3184 RemotePlaybackClient()->PromptCancelled();
3205 } 3185 }
3206 3186
3207 void HTMLMediaElement::RemotePlaybackStarted() { 3187 void HTMLMediaElement::RemotePlaybackStarted() {
3208 if (RemotePlaybackClient()) 3188 if (RemotePlaybackClient())
3209 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected); 3189 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected);
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
4116 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4096 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4117 } 4097 }
4118 4098
4119 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { 4099 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) {
4120 mostly_filling_viewport_ = true; 4100 mostly_filling_viewport_ = true;
4121 if (web_media_player_) 4101 if (web_media_player_)
4122 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); 4102 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_);
4123 } 4103 }
4124 4104
4125 } // namespace blink 4105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698