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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay()) | 166 if (!hasSource(mediaElement) || !mediaElement->togglePlayStateWillPlay()) |
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 int mediaHeight = mediaElement->clientHeight(); | 176 const LayoutBox* box = mediaElement->layoutObject()->enclosingBox(); |
liberato (no reviews please)
2015/08/18 16:26:41
That was much easier than i expected. gets rid of
fs
2015/08/18 16:41:19
You mean the stuff in MediaControls::notifyPanelWi
| |
177 if (!box) | |
178 return false; | |
179 int mediaHeight = ceil(box->size().height().toDouble()); | |
fs
2015/08/18 16:41:18
You could consider using pixelSnappedHeight() here
| |
177 buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidthNew / 2); | 180 buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidthNew / 2); |
178 buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeightNew / 2 | 181 buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeightNew / 2 |
179 + (mediaHeight - rect.height()) / 2); | 182 + (mediaHeight - rect.height()) / 2); |
180 buttonRect.setWidth(mediaOverlayPlayButtonWidthNew); | 183 buttonRect.setWidth(mediaOverlayPlayButtonWidthNew); |
181 buttonRect.setHeight(mediaOverlayPlayButtonHeightNew); | 184 buttonRect.setHeight(mediaOverlayPlayButtonHeightNew); |
182 } | 185 } |
183 | 186 |
184 return paintMediaButton(paintInfo.context, buttonRect, mediaOverlayPlay); | 187 return paintMediaButton(paintInfo.context, buttonRect, mediaOverlayPlay); |
185 } | 188 } |
186 | 189 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
567 } | 570 } |
568 | 571 |
569 float zoomLevel = style.effectiveZoom(); | 572 float zoomLevel = style.effectiveZoom(); |
570 if (thumbImage) { | 573 if (thumbImage) { |
571 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); | 574 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); |
572 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); | 575 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); |
573 } | 576 } |
574 } | 577 } |
575 | 578 |
576 } // namespace blink | 579 } // namespace blink |
OLD | NEW |