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

Unified Diff: Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp

Issue 7472040: Merge 91337 - [chromium] Media player controls do not fade out. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 5 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/WebCore/html/shadow/MediaControlRootElementChromium.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp
===================================================================
--- Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp (revision 91476)
+++ Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp (working copy)
@@ -30,6 +30,7 @@
#include "MediaControlRootElementChromium.h"
#include "MediaControlElements.h"
+#include "MouseEvent.h"
#include "Page.h"
#include "RenderTheme.h"
@@ -49,6 +50,7 @@
, m_volumeSliderContainer(0)
, m_panel(0)
, m_opaque(true)
+ , m_isMouseOverControls(false)
{
}
@@ -209,6 +211,9 @@
{
m_timeline->setPosition(m_mediaElement->currentTime());
updateTimeDisplay();
+
+ if (!m_isMouseOverControls && m_mediaElement->hasVideo())
+ makeTransparent();
}
void MediaControlRootElementChromium::playbackStopped()
@@ -259,6 +264,32 @@
reset();
}
+bool MediaControlRootElementChromium::containsRelatedTarget(Event* event)
+{
+ if (!event->isMouseEvent())
+ return false;
+ EventTarget* relatedTarget = static_cast<MouseEvent*>(event)->relatedTarget();
+ if (!relatedTarget)
+ return false;
+ return contains(relatedTarget->toNode());
+}
+
+void MediaControlRootElementChromium::defaultEventHandler(Event* event)
+{
+ MediaControls::defaultEventHandler(event);
+
+ if (event->type() == eventNames().mouseoverEvent) {
+ if (!containsRelatedTarget(event)) {
+ m_isMouseOverControls = true;
+ if (!m_mediaElement->canPlay())
+ makeOpaque();
+ }
+ } else if (event->type() == eventNames().mouseoutEvent) {
+ if (!containsRelatedTarget(event))
+ m_isMouseOverControls = false;
+ }
+}
+
void MediaControlRootElementChromium::changedClosedCaptionsVisibility()
{
}
« no previous file with comments | « Source/WebCore/html/shadow/MediaControlRootElementChromium.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698