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

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

Issue 716613002: Use different icons for the overlay and non-overlay cast buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMediaControls.cpp
diff --git a/Source/core/rendering/RenderMediaControls.cpp b/Source/core/rendering/RenderMediaControls.cpp
index 9124b8745353b370af37ff92ec7b038d568e2168..1ea9981d651b3fe3b2395ac4ef79776d819f44fb 100644
--- a/Source/core/rendering/RenderMediaControls.cpp
+++ b/Source/core/rendering/RenderMediaControls.cpp
@@ -345,15 +345,24 @@ static bool paintMediaCastButton(RenderObject* object, const PaintInfo& paintInf
if (!mediaElement)
return false;
- static Image* mediaCastOnButton = platformResource("mediaplayerCastOn");
- static Image* mediaCastOffButton = platformResource("mediaplayerCastOff");
+ static Image* mediaCastOn = platformResource("mediaplayerCastOn");
+ static Image* mediaCastOff = platformResource("mediaplayerCastOff");
+ // To ensure that the overlaid cast button is visible when overlaid on pale videos we use a
+ // different version of it for the overlaid case with a semi-opaque background.
+ static Image* mediaOverlayCastOff = platformResource("mediaplayerOverlayCastOff");
- if (mediaElement->isPlayingRemotely()) {
- return paintMediaButton(paintInfo.context, rect, mediaCastOnButton);
+ switch (mediaControlElementType(object->node())) {
+ case MediaCastOnButton:
+ case MediaOverlayCastOnButton:
+ return paintMediaButton(paintInfo.context, rect, mediaCastOn);
+ case MediaCastOffButton:
+ return paintMediaButton(paintInfo.context, rect, mediaCastOff);
+ case MediaOverlayCastOffButton:
+ return paintMediaButton(paintInfo.context, rect, mediaOverlayCastOff);
+ default:
+ // Should never happen
philipj_slow 2014/11/11 08:28:51 ASSERT_NOT_REACHED() and remove comment.
aberent 2014/11/11 09:52:33 Done.
+ return false;
}
-
- return paintMediaButton(paintInfo.context, rect, mediaCastOffButton);
-
}
bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698