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

Side by Side Diff: Source/core/rendering/RenderMediaControls.cpp

Issue 291163004: Implement media cast buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reenable previously crashing tests - now fixed Created 6 years, 3 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
« no previous file with comments | « Source/core/html/shadow/MediaControls.cpp ('k') | Source/core/rendering/RenderTheme.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. 2 * Copyright (C) 2009 Apple Inc.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return false; 332 return false;
333 333
334 static Image* mediaClosedCaptionButton = platformResource("mediaplayerClosed Caption"); 334 static Image* mediaClosedCaptionButton = platformResource("mediaplayerClosed Caption");
335 static Image* mediaClosedCaptionButtonDisabled = platformResource("mediaplay erClosedCaptionDisabled"); 335 static Image* mediaClosedCaptionButtonDisabled = platformResource("mediaplay erClosedCaptionDisabled");
336 336
337 if (mediaElement->closedCaptionsVisible()) 337 if (mediaElement->closedCaptionsVisible())
338 return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButto n); 338 return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButto n);
339 339
340 return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButtonDis abled); 340 return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButtonDis abled);
341 } 341 }
342 static bool paintMediaCastButton(RenderObject* object, const PaintInfo& paintInf o, const IntRect& rect)
343 {
344 HTMLMediaElement* mediaElement = toParentMediaElement(object);
345 if (!mediaElement)
346 return false;
342 347
348 static Image* mediaCastOnButton = platformResource("mediaplayerCastOn");
349 static Image* mediaCastOffButton = platformResource("mediaplayerCastOff");
350
351 if (mediaElement->isPlayingRemotely()) {
352 return paintMediaButton(paintInfo.context, rect, mediaCastOnButton);
353 }
354
355 return paintMediaButton(paintInfo.context, rect, mediaCastOffButton);
356
357 }
343 358
344 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R enderObject* object, const PaintInfo& paintInfo, const IntRect& rect) 359 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R enderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
345 { 360 {
346 switch (part) { 361 switch (part) {
347 case MediaMuteButton: 362 case MediaMuteButton:
348 case MediaUnMuteButton: 363 case MediaUnMuteButton:
349 return paintMediaMuteButton(object, paintInfo, rect); 364 return paintMediaMuteButton(object, paintInfo, rect);
350 case MediaPauseButton: 365 case MediaPauseButton:
351 case MediaPlayButton: 366 case MediaPlayButton:
352 return paintMediaPlayButton(object, paintInfo, rect); 367 return paintMediaPlayButton(object, paintInfo, rect);
353 case MediaShowClosedCaptionsButton: 368 case MediaShowClosedCaptionsButton:
354 return paintMediaToggleClosedCaptionsButton(object, paintInfo, rect); 369 return paintMediaToggleClosedCaptionsButton(object, paintInfo, rect);
355 case MediaSlider: 370 case MediaSlider:
356 return paintMediaSlider(object, paintInfo, rect); 371 return paintMediaSlider(object, paintInfo, rect);
357 case MediaSliderThumb: 372 case MediaSliderThumb:
358 return paintMediaSliderThumb(object, paintInfo, rect); 373 return paintMediaSliderThumb(object, paintInfo, rect);
359 case MediaVolumeSlider: 374 case MediaVolumeSlider:
360 return paintMediaVolumeSlider(object, paintInfo, rect); 375 return paintMediaVolumeSlider(object, paintInfo, rect);
361 case MediaVolumeSliderThumb: 376 case MediaVolumeSliderThumb:
362 return paintMediaVolumeSliderThumb(object, paintInfo, rect); 377 return paintMediaVolumeSliderThumb(object, paintInfo, rect);
363 case MediaEnterFullscreenButton: 378 case MediaEnterFullscreenButton:
364 case MediaExitFullscreenButton: 379 case MediaExitFullscreenButton:
365 return paintMediaFullscreenButton(object, paintInfo, rect); 380 return paintMediaFullscreenButton(object, paintInfo, rect);
366 case MediaOverlayPlayButton: 381 case MediaOverlayPlayButton:
367 return paintMediaOverlayPlayButton(object, paintInfo, rect); 382 return paintMediaOverlayPlayButton(object, paintInfo, rect);
383 case MediaCastOffButton:
384 case MediaCastOnButton:
385 case MediaOverlayCastOffButton:
386 case MediaOverlayCastOnButton:
387 return paintMediaCastButton(object, paintInfo, rect);
368 case MediaVolumeSliderContainer: 388 case MediaVolumeSliderContainer:
369 case MediaTimelineContainer: 389 case MediaTimelineContainer:
370 case MediaCurrentTimeDisplay: 390 case MediaCurrentTimeDisplay:
371 case MediaTimeRemainingDisplay: 391 case MediaTimeRemainingDisplay:
372 case MediaControlsPanel: 392 case MediaControlsPanel:
373 case MediaStatusDisplay: 393 case MediaStatusDisplay:
374 case MediaHideClosedCaptionsButton: 394 case MediaHideClosedCaptionsButton:
375 case MediaTextTrackDisplayContainer: 395 case MediaTextTrackDisplayContainer:
376 case MediaTextTrackDisplay: 396 case MediaTextTrackDisplay:
377 case MediaFullScreenVolumeSlider: 397 case MediaFullScreenVolumeSlider:
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 { 458 {
439 return formatChromiumMediaControlsTime(time, time); 459 return formatChromiumMediaControlsTime(time, time);
440 } 460 }
441 461
442 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) 462 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration)
443 { 463 {
444 return formatChromiumMediaControlsTime(currentTime, duration); 464 return formatChromiumMediaControlsTime(currentTime, duration);
445 } 465 }
446 466
447 } // namespace blink 467 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControls.cpp ('k') | Source/core/rendering/RenderTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698