Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| index 5d69ffe655861f1781dc423559320c34026f807f..1800aecdc04b77835fe7265f411ba5f921857ca8 100644 |
| --- a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| @@ -56,6 +56,10 @@ static const int mediaSliderThumbPaintHeight = 12; |
| static const int mediaOverlayPlayButtonWidth = 48; |
| static const int mediaOverlayPlayButtonHeight = 48; |
| +// Overlay media remoting cast button size. |
| +static const int MediaRemotingCastIconWidth = 88; |
| +static const int MediaRemotingCastIconHeight = 72; |
|
kinuko
2017/04/04 03:18:05
The naming looks inconsistent here and above, woul
xjz
2017/04/04 20:56:27
Done.
|
| + |
| // Alpha for disabled elements. |
| static const float kDisabledAlpha = 0.4; |
| @@ -203,6 +207,26 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton( |
| return paintMediaButton(paintInfo.context, buttonRect, mediaOverlayPlay); |
| } |
| +bool MediaControlsPainter::paintMediaRemotingCastIcon( |
| + const LayoutObject& object, |
| + const PaintInfo& paintInfo, |
| + const IntRect& rect) { |
| + const HTMLMediaElement* mediaElement = toParentMediaElement(object); |
| + if (!mediaElement) |
| + return false; |
| + |
| + static Image* mediaremotingCast = platformResource("mediaremotingCast"); |
| + |
| + const int buttonWidth = std::min(rect.width(), MediaRemotingCastIconWidth); |
| + const int buttonHeight = std::min(rect.height(), MediaRemotingCastIconHeight); |
| + |
| + return paintMediaButton(paintInfo.context, |
| + IntRect(rect.x() + (rect.width() - buttonWidth) / 2, |
| + rect.y() + (rect.height() - buttonHeight) / 2, |
| + buttonWidth, buttonHeight), |
| + mediaremotingCast); |
| +} |
| + |
| static void paintRoundedSliderBackground(const IntRect& rect, |
| const ComputedStyle& style, |
| GraphicsContext& context, |