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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 Image * image = !object.node()->isMediaControlElement() || mediaControlEleme
ntType(object.node()) == MediaPlayButton ? mediaPlay : mediaPause; | 156 Image * image = !object.node()->isMediaControlElement() || mediaControlEleme
ntType(object.node()) == MediaPlayButton ? mediaPlay : mediaPause; |
157 return paintMediaButton(paintInfo.context, rect, image); | 157 return paintMediaButton(paintInfo.context, rect, image); |
158 } | 158 } |
159 | 159 |
160 bool MediaControlsPainter::paintMediaOverlayPlayButton(const LayoutObject& objec
t, const PaintInfo& paintInfo, const IntRect& rect) | 160 bool MediaControlsPainter::paintMediaOverlayPlayButton(const LayoutObject& objec
t, const PaintInfo& paintInfo, const IntRect& rect) |
161 { | 161 { |
162 const HTMLMediaElement* mediaElement = toParentMediaElement(object); | 162 const HTMLMediaElement* mediaElement = toParentMediaElement(object); |
163 if (!mediaElement) | 163 if (!mediaElement) |
164 return false; | 164 return false; |
165 | 165 |
166 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay()) | 166 if (!hasSource(mediaElement) || !mediaElement->paused()) |
167 return false; | 167 return false; |
168 | 168 |
169 static Image* mediaOverlayPlay = platformResource("mediaplayerOverlayPlay", | 169 static Image* mediaOverlayPlay = platformResource("mediaplayerOverlayPlay", |
170 "mediaplayerOverlayPlayNew"); | 170 "mediaplayerOverlayPlayNew"); |
171 | 171 |
172 IntRect buttonRect(rect); | 172 IntRect buttonRect(rect); |
173 if (RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) { | 173 if (RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) { |
174 // Overlay play button covers the entire player, so center and draw a | 174 // Overlay play button covers the entire player, so center and draw a |
175 // smaller button. Center in the entire element. | 175 // smaller button. Center in the entire element. |
176 const LayoutBox* box = mediaElement->layoutObject()->enclosingBox(); | 176 const LayoutBox* box = mediaElement->layoutObject()->enclosingBox(); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 } | 570 } |
571 | 571 |
572 float zoomLevel = style.effectiveZoom(); | 572 float zoomLevel = style.effectiveZoom(); |
573 if (thumbImage) { | 573 if (thumbImage) { |
574 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); | 574 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); |
575 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); | 575 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); |
576 } | 576 } |
577 } | 577 } |
578 | 578 |
579 } // namespace blink | 579 } // namespace blink |
OLD | NEW |