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

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

Issue 1115203003: De-virtualize media control painting methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Mac doesn't want cast button Created 5 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
« no previous file with comments | « Source/core/paint/MediaControlsPainter.h ('k') | Source/core/paint/ThemePainter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/MediaControlsPainter.cpp
diff --git a/Source/core/paint/MediaControlsPainter.cpp b/Source/core/paint/MediaControlsPainter.cpp
index c4f48399a688c05b9cb7fa6ac1a7c3ac6173fd28..5fdfb85d4c1139ef76b236e4914d96bc80427625 100644
--- a/Source/core/paint/MediaControlsPainter.cpp
+++ b/Source/core/paint/MediaControlsPainter.cpp
@@ -31,6 +31,7 @@
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/html/HTMLMediaElement.h"
#include "core/html/TimeRanges.h"
+#include "core/html/shadow/MediaControlElementTypes.h"
#include "core/paint/PaintInfo.h"
#include "core/style/ComputedStyle.h"
#include "platform/graphics/Gradient.h"
@@ -69,7 +70,7 @@ static bool paintMediaButton(GraphicsContext* context, const IntRect& rect, Imag
return true;
}
-static bool paintMediaMuteButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaMuteButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -96,7 +97,7 @@ static bool paintMediaMuteButton(LayoutObject* object, const PaintInfo& paintInf
return paintMediaButton(paintInfo.context, rect, soundLevel3);
}
-static bool paintMediaPlayButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaPlayButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -113,7 +114,7 @@ static bool paintMediaPlayButton(LayoutObject* object, const PaintInfo& paintInf
return paintMediaButton(paintInfo.context, rect, image);
}
-static bool paintMediaOverlayPlayButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaOverlayPlayButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -196,7 +197,7 @@ static void paintSliderRangeHighlight(const IntRect& rect, const ComputedStyle&
const int mediaSliderThumbWidth = 32;
-static bool paintMediaSlider(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaSlider(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -256,7 +257,7 @@ static bool paintMediaSlider(LayoutObject* object, const PaintInfo& paintInfo, c
return true;
}
-static bool paintMediaSliderThumb(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaSliderThumb(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
if (!object->node())
return false;
@@ -274,7 +275,7 @@ static bool paintMediaSliderThumb(LayoutObject* object, const PaintInfo& paintIn
const int mediaVolumeSliderThumbWidth = 24;
-static bool paintMediaVolumeSlider(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaVolumeSlider(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -311,7 +312,7 @@ static bool paintMediaVolumeSlider(LayoutObject* object, const PaintInfo& paintI
return true;
}
-static bool paintMediaVolumeSliderThumb(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaVolumeSliderThumb(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
if (!object->node())
return false;
@@ -327,7 +328,7 @@ static bool paintMediaVolumeSliderThumb(LayoutObject* object, const PaintInfo& p
return paintMediaButton(paintInfo.context, rect, mediaVolumeSliderThumb);
}
-static bool paintMediaFullscreenButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaFullscreenButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -337,7 +338,7 @@ static bool paintMediaFullscreenButton(LayoutObject* object, const PaintInfo& pa
return paintMediaButton(paintInfo.context, rect, mediaFullscreenButton);
}
-static bool paintMediaToggleClosedCaptionsButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+bool MediaControlsPainter::paintMediaToggleClosedCaptionsButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -351,7 +352,8 @@ static bool paintMediaToggleClosedCaptionsButton(LayoutObject* object, const Pai
return paintMediaButton(paintInfo.context, rect, mediaClosedCaptionButtonDisabled);
}
-static bool paintMediaCastButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
+
+bool MediaControlsPainter::paintMediaCastButton(LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
{
HTMLMediaElement* mediaElement = toParentMediaElement(object);
if (!mediaElement)
@@ -377,49 +379,6 @@ static bool paintMediaCastButton(LayoutObject* object, const PaintInfo& paintInf
}
}
-bool MediaControlsPainter::paintMediaControlsPart(MediaControlElementType part, LayoutObject* object, const PaintInfo& paintInfo, const IntRect& rect)
-{
- switch (part) {
- case MediaMuteButton:
- case MediaUnMuteButton:
- return paintMediaMuteButton(object, paintInfo, rect);
- case MediaPauseButton:
- case MediaPlayButton:
- return paintMediaPlayButton(object, paintInfo, rect);
- case MediaShowClosedCaptionsButton:
- return paintMediaToggleClosedCaptionsButton(object, paintInfo, rect);
- case MediaSlider:
- return paintMediaSlider(object, paintInfo, rect);
- case MediaSliderThumb:
- return paintMediaSliderThumb(object, paintInfo, rect);
- case MediaVolumeSlider:
- return paintMediaVolumeSlider(object, paintInfo, rect);
- case MediaVolumeSliderThumb:
- return paintMediaVolumeSliderThumb(object, paintInfo, rect);
- case MediaEnterFullscreenButton:
- case MediaExitFullscreenButton:
- return paintMediaFullscreenButton(object, paintInfo, rect);
- case MediaOverlayPlayButton:
- return paintMediaOverlayPlayButton(object, paintInfo, rect);
- case MediaCastOffButton:
- case MediaCastOnButton:
- case MediaOverlayCastOffButton:
- case MediaOverlayCastOnButton:
- return paintMediaCastButton(object, paintInfo, rect);
- case MediaVolumeSliderContainer:
- case MediaTimelineContainer:
- case MediaCurrentTimeDisplay:
- case MediaTimeRemainingDisplay:
- case MediaControlsPanel:
- case MediaHideClosedCaptionsButton:
- case MediaFullScreenVolumeSlider:
- case MediaFullScreenVolumeSliderThumb:
- ASSERT_NOT_REACHED();
- break;
- }
- return false;
-}
-
const int mediaSliderThumbHeight = 24;
const int mediaVolumeSliderThumbHeight = 24;
« no previous file with comments | « Source/core/paint/MediaControlsPainter.h ('k') | Source/core/paint/ThemePainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698