| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (!mediaElement) | 99 if (!mediaElement) |
| 100 return false; | 100 return false; |
| 101 | 101 |
| 102 static Image* mediaPlay = platformResource("mediaplayerPlay"); | 102 static Image* mediaPlay = platformResource("mediaplayerPlay"); |
| 103 static Image* mediaPause = platformResource("mediaplayerPause"); | 103 static Image* mediaPause = platformResource("mediaplayerPause"); |
| 104 static Image* mediaPlayDisabled = platformResource("mediaplayerPlayDisabled"
); | 104 static Image* mediaPlayDisabled = platformResource("mediaplayerPlayDisabled"
); |
| 105 | 105 |
| 106 if (!hasSource(mediaElement)) | 106 if (!hasSource(mediaElement)) |
| 107 return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled); | 107 return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled); |
| 108 | 108 |
| 109 return paintMediaButton(paintInfo.context, rect, mediaElement->canPlay() ? m
ediaPlay : mediaPause); | 109 return paintMediaButton(paintInfo.context, rect, mediaElement->togglePlaySta
teWillPlay() ? mediaPlay : mediaPause); |
| 110 } | 110 } |
| 111 | 111 |
| 112 static bool paintMediaOverlayPlayButton(RenderObject* object, const PaintInfo& p
aintInfo, const IntRect& rect) | 112 static bool paintMediaOverlayPlayButton(RenderObject* object, const PaintInfo& p
aintInfo, const IntRect& rect) |
| 113 { | 113 { |
| 114 HTMLMediaElement* mediaElement = toParentMediaElement(object); | 114 HTMLMediaElement* mediaElement = toParentMediaElement(object); |
| 115 if (!mediaElement) | 115 if (!mediaElement) |
| 116 return false; | 116 return false; |
| 117 | 117 |
| 118 if (!hasSource(mediaElement) || !mediaElement->canPlay()) | 118 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay()) |
| 119 return false; | 119 return false; |
| 120 | 120 |
| 121 static Image* mediaOverlayPlay = platformResource("mediaplayerOverlayPlay"); | 121 static Image* mediaOverlayPlay = platformResource("mediaplayerOverlayPlay"); |
| 122 return paintMediaButton(paintInfo.context, rect, mediaOverlayPlay); | 122 return paintMediaButton(paintInfo.context, rect, mediaOverlayPlay); |
| 123 } | 123 } |
| 124 | 124 |
| 125 static Image* getMediaSliderThumb() | 125 static Image* getMediaSliderThumb() |
| 126 { | 126 { |
| 127 static Image* mediaSliderThumb = platformResource("mediaplayerSliderThumb"); | 127 static Image* mediaSliderThumb = platformResource("mediaplayerSliderThumb"); |
| 128 return mediaSliderThumb; | 128 return mediaSliderThumb; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 { | 434 { |
| 435 return formatChromiumMediaControlsTime(time, time); | 435 return formatChromiumMediaControlsTime(time, time); |
| 436 } | 436 } |
| 437 | 437 |
| 438 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl
oat duration) | 438 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl
oat duration) |
| 439 { | 439 { |
| 440 return formatChromiumMediaControlsTime(currentTime, duration); | 440 return formatChromiumMediaControlsTime(currentTime, duration); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace WebCore | 443 } // namespace WebCore |
| OLD | NEW |