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

Side by Side Diff: Source/core/paint/MediaControlsPainter.cpp

Issue 1296333002: Removed clientHeight() from MediaControlsPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: switched to pixelSnappedHeight() Created 5 years, 4 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 | « no previous file | no next file » | 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
177 if (!box)
178 return false;
179 int mediaHeight = box->pixelSnappedHeight();
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698