OLD | NEW |
---|---|
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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) | 342 static bool paintMediaCastButton(RenderObject* object, const PaintInfo& paintInf o, const IntRect& rect) |
343 { | 343 { |
344 HTMLMediaElement* mediaElement = toParentMediaElement(object); | 344 HTMLMediaElement* mediaElement = toParentMediaElement(object); |
345 if (!mediaElement) | 345 if (!mediaElement) |
346 return false; | 346 return false; |
347 | 347 |
348 static Image* mediaCastOnButton = platformResource("mediaplayerCastOn"); | 348 static Image* mediaCastOn = platformResource("mediaplayerCastOn"); |
349 static Image* mediaCastOffButton = platformResource("mediaplayerCastOff"); | 349 static Image* mediaCastOff = platformResource("mediaplayerCastOff"); |
350 // To ensure that the overlaid cast button is visible when overlaid on pale videos we use a | |
351 // different version of it for the overlaid case with a semi-opaque backgrou nd. | |
352 static Image* mediaOverlayCastOff = platformResource("mediaplayerOverlayCast Off"); | |
350 | 353 |
351 if (mediaElement->isPlayingRemotely()) { | 354 switch (mediaControlElementType(object->node())) { |
352 return paintMediaButton(paintInfo.context, rect, mediaCastOnButton); | 355 case MediaCastOnButton: |
356 case MediaOverlayCastOnButton: | |
357 return paintMediaButton(paintInfo.context, rect, mediaCastOn); | |
358 case MediaCastOffButton: | |
359 return paintMediaButton(paintInfo.context, rect, mediaCastOff); | |
360 case MediaOverlayCastOffButton: | |
361 return paintMediaButton(paintInfo.context, rect, mediaOverlayCastOff); | |
362 default: | |
363 // Should never happen | |
philipj_slow
2014/11/11 08:28:51
ASSERT_NOT_REACHED() and remove comment.
aberent
2014/11/11 09:52:33
Done.
| |
364 return false; | |
353 } | 365 } |
354 | |
355 return paintMediaButton(paintInfo.context, rect, mediaCastOffButton); | |
356 | |
357 } | 366 } |
358 | 367 |
359 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R enderObject* object, const PaintInfo& paintInfo, const IntRect& rect) | 368 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R enderObject* object, const PaintInfo& paintInfo, const IntRect& rect) |
360 { | 369 { |
361 switch (part) { | 370 switch (part) { |
362 case MediaMuteButton: | 371 case MediaMuteButton: |
363 case MediaUnMuteButton: | 372 case MediaUnMuteButton: |
364 return paintMediaMuteButton(object, paintInfo, rect); | 373 return paintMediaMuteButton(object, paintInfo, rect); |
365 case MediaPauseButton: | 374 case MediaPauseButton: |
366 case MediaPlayButton: | 375 case MediaPlayButton: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 { | 467 { |
459 return formatChromiumMediaControlsTime(time, time); | 468 return formatChromiumMediaControlsTime(time, time); |
460 } | 469 } |
461 | 470 |
462 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) | 471 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) |
463 { | 472 { |
464 return formatChromiumMediaControlsTime(currentTime, duration); | 473 return formatChromiumMediaControlsTime(currentTime, duration); |
465 } | 474 } |
466 | 475 |
467 } // namespace blink | 476 } // namespace blink |
OLD | NEW |