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

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: Unified watch availability code. 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 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3245 3245
3246 void HTMLMediaElement::RequestSeek(double time) { 3246 void HTMLMediaElement::RequestSeek(double time) {
3247 // The player is the source of this seek request. 3247 // The player is the source of this seek request.
3248 setCurrentTime(time); 3248 setCurrentTime(time);
3249 } 3249 }
3250 3250
3251 void HTMLMediaElement::RemoteRouteAvailabilityChanged( 3251 void HTMLMediaElement::RemoteRouteAvailabilityChanged(
3252 WebRemotePlaybackAvailability availability) { 3252 WebRemotePlaybackAvailability availability) {
3253 if (RemotePlaybackClient()) 3253 if (RemotePlaybackClient())
3254 RemotePlaybackClient()->AvailabilityChanged(availability); 3254 RemotePlaybackClient()->AvailabilityChanged(availability);
3255
3256 // TODO(mlamouri): the RemotePlayback object should be used in order to
3257 // register to watch availability but the object is in modules/ and core/ has
3258 // no access to it. It will have to be done when the media controls move to
3259 // modules/.
3260 if (GetMediaControls())
3261 GetMediaControls()->OnRemotePlaybackAvailabilityChanged();
3262 } 3255 }
3263 3256
3264 bool HTMLMediaElement::HasRemoteRoutes() const { 3257 bool HTMLMediaElement::HasRemoteRoutes() const {
3265 // TODO(mlamouri): this is only used for controls related code. It shouldn't 3258 // TODO(mlamouri): used by MediaControlsPainter; should be refactored out.
3266 // live in HTMLMediaElement.
3267 return RemotePlaybackClient() && 3259 return RemotePlaybackClient() &&
3268 RemotePlaybackClient()->RemotePlaybackAvailable(); 3260 RemotePlaybackClient()->RemotePlaybackAvailable();
3269 } 3261 }
3270 3262
3271 void HTMLMediaElement::ConnectedToRemoteDevice() { 3263 void HTMLMediaElement::ConnectedToRemoteDevice() {
3272 playing_remotely_ = true; 3264 playing_remotely_ = true;
3273 if (RemotePlaybackClient()) 3265 if (RemotePlaybackClient())
3274 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnecting); 3266 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnecting);
3275
3276 // TODO(mlamouri): the RemotePlayback object should be used in order to listen
3277 // for events but the object is in modules/ and core/ has no access to it. It
3278 // will have to be done when the media controls move to modules/.
3279 if (GetMediaControls())
3280 GetMediaControls()->OnRemotePlaybackConnecting();
3281 } 3267 }
3282 3268
3283 void HTMLMediaElement::DisconnectedFromRemoteDevice() { 3269 void HTMLMediaElement::DisconnectedFromRemoteDevice() {
3284 playing_remotely_ = false; 3270 playing_remotely_ = false;
3285 if (RemotePlaybackClient()) 3271 if (RemotePlaybackClient())
3286 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kDisconnected); 3272 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kDisconnected);
3287
3288 // TODO(mlamouri): the RemotePlayback object should be used in order to listen
3289 // for events but the object is in modules/ and core/ has no access to it. It
3290 // will have to be done when the media controls move to modules/.
3291 if (GetMediaControls())
3292 GetMediaControls()->OnRemotePlaybackDisconnected();
3293 } 3273 }
3294 3274
3295 void HTMLMediaElement::CancelledRemotePlaybackRequest() { 3275 void HTMLMediaElement::CancelledRemotePlaybackRequest() {
3296 if (RemotePlaybackClient()) 3276 if (RemotePlaybackClient())
3297 RemotePlaybackClient()->PromptCancelled(); 3277 RemotePlaybackClient()->PromptCancelled();
3298 } 3278 }
3299 3279
3300 void HTMLMediaElement::RemotePlaybackStarted() { 3280 void HTMLMediaElement::RemotePlaybackStarted() {
3301 if (RemotePlaybackClient()) 3281 if (RemotePlaybackClient())
3302 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected); 3282 RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected);
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4289 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4269 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4290 } 4270 }
4291 4271
4292 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { 4272 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) {
4293 mostly_filling_viewport_ = true; 4273 mostly_filling_viewport_ = true;
4294 if (web_media_player_) 4274 if (web_media_player_)
4295 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); 4275 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_);
4296 } 4276 }
4297 4277
4298 } // namespace blink 4278 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698