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

Unified Diff: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp

Issue 2767823002: Media Remoting: Add interstitial elements to media element shadow dom. (Closed)
Patch Set: Remove cast text message element. Not assuming remoting interstitial is media control. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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 7b9e47b1e600ce256c5607af738a8516cea9c1cb..7f3dd29b7faf380a38dc48403a1a27036a7563f3 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;
+
// 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,

Powered by Google App Engine
This is Rietveld 408576698