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

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: Updated with new UX design. 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 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,

Powered by Google App Engine
This is Rietveld 408576698