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 48ec7094c28e43d7dee482b96a00a0a776209e43..7f42aa1e4366ce0a2f2f87f2ab84769bd0ff2310 100644 |
| --- a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
| @@ -57,6 +57,10 @@ static const int kMediaSliderThumbPaintHeight = 12; |
| static const int kMediaOverlayPlayButtonWidth = 48; |
| static const int kMediaOverlayPlayButtonHeight = 48; |
| +// Overlay media remoting cast button size. |
| +static const int kMediaRemotingCastIconWidth = 44; |
| +static const int kMediaRemotingCastIconHeight = 36; |
| + |
| // Alpha for disabled elements. |
| static const float kDisabledAlpha = 0.4; |
| @@ -217,6 +221,28 @@ static void PaintRoundedSliderBackground(const IntRect& rect, |
| slider_background_color); |
| } |
| +bool MediaControlsPainter::PaintMediaRemotingCastIcon( |
| + const LayoutObject& object, |
| + const PaintInfo& paintInfo, |
| + const IntRect& rect) { |
| + const HTMLMediaElement* media_element = ToParentMediaElement(object); |
| + if (!media_element) |
| + return false; |
| + |
| + static Image* cast_icon = PlatformResource("mediaremotingCast"); |
| + |
| + const int button_width = std::min(rect.Width(), kMediaRemotingCastIconWidth); |
|
liberato (no reviews please)
2017/04/12 21:57:44
what size box do you see here? from the css, it l
xjz
2017/04/13 00:08:48
Done.
|
| + const int button_height = |
| + std::min(rect.Height(), kMediaRemotingCastIconHeight); |
| + |
| + return PaintMediaButton( |
| + paintInfo.context, |
| + IntRect(rect.X() + (rect.Width() - button_width) / 2, |
| + rect.Y() + (rect.Height() - button_height) / 2, button_width, |
| + button_height), |
| + cast_icon); |
| +} |
| + |
| static void PaintSliderRangeHighlight(const IntRect& rect, |
| const ComputedStyle& style, |
| GraphicsContext& context, |