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

Unified Diff: Source/core/rendering/RenderMediaControls.cpp

Issue 291163004: Implement media cast buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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: Source/core/rendering/RenderMediaControls.cpp
diff --git a/Source/core/rendering/RenderMediaControls.cpp b/Source/core/rendering/RenderMediaControls.cpp
index 90b28aa442f4ae9c026107676cd0a4a99dec4866..ef37fcadcc1bc59345dd1c0119c42764c52891d8 100644
--- a/Source/core/rendering/RenderMediaControls.cpp
+++ b/Source/core/rendering/RenderMediaControls.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "core/rendering/RenderMediaControls.h"
+#include "base/logging.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/html/HTMLMediaElement.h"
@@ -335,7 +336,29 @@ static bool paintMediaToggleClosedCaptionsButton(RenderObject* object, const Pai
return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButtonDisabled);
}
+static bool paintMediaCastOffButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+{
+ LOG(INFO) << "Painting Cast Off Button";
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ static Image* mediaCastOffButton = platformResource("mediaplayerCastOff");
+ return paintMediaButton(paintInfo.context, rect, mediaCastOffButton);
+
+}
+static bool paintMediaCastOnButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+{
+ LOG(INFO) << "Painting Cast On Button";
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ static Image* mediaCastOnButton = platformResource("mediaplayerCastOn");
+ return paintMediaButton(paintInfo.context, rect, mediaCastOnButton);
+
+}
bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
@@ -361,6 +384,10 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
return paintMediaFullscreenButton(object, paintInfo, rect);
case MediaOverlayPlayButton:
return paintMediaOverlayPlayButton(object, paintInfo, rect);
+ case MediaCastOffButton:
+ return paintMediaCastOffButton(object, paintInfo, rect);
+ case MediaCastOnButton:
+ return paintMediaCastOnButton(object, paintInfo, rect);
case MediaVolumeSliderContainer:
case MediaTimelineContainer:
case MediaCurrentTimeDisplay:

Powered by Google App Engine
This is Rietveld 408576698