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

Unified Diff: Source/core/html/shadow/MediaControlElementTypes.cpp

Issue 195473002: Let MediaControls use the parent HTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/html/shadow/MediaControlElementTypes.cpp
diff --git a/Source/core/html/shadow/MediaControlElementTypes.cpp b/Source/core/html/shadow/MediaControlElementTypes.cpp
index 7c216b83499cb5063590cebd003cd9e05513cc3f..38319687052f33aaca767d7b6792d5c16890dc2a 100644
--- a/Source/core/html/shadow/MediaControlElementTypes.cpp
+++ b/Source/core/html/shadow/MediaControlElementTypes.cpp
@@ -36,6 +36,8 @@
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/css/StylePropertySet.h"
#include "core/events/MouseEvent.h"
+#include "core/html/HTMLMediaElement.h"
+#include "core/html/MediaController.h"
namespace WebCore {
@@ -65,13 +67,20 @@ MediaControlElementType mediaControlElementType(Node* node)
return static_cast<MediaControlDivElement*>(element)->displayType();
}
-MediaControlElement::MediaControlElement(MediaControlElementType displayType, HTMLElement* element)
- : m_mediaController(0)
+MediaControlElement::MediaControlElement(HTMLMediaElement& mediaElement, MediaControlElementType displayType, HTMLElement* element)
acolwell GONE FROM CHROMIUM 2014/03/12 00:22:32 WDYT about handing in MediaControls into these bas
philipj_slow 2014/03/12 04:30:11 I started writing this patch before merging MediaC
+ : m_mediaElement(mediaElement)
, m_displayType(displayType)
, m_element(element)
{
}
+MediaControllerInterface& MediaControlElement::mediaControllerInterface() const
+{
+ if (m_mediaElement.controller())
+ return *m_mediaElement.controller();
+ return m_mediaElement;
+}
+
void MediaControlElement::hide()
{
m_element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
@@ -94,17 +103,17 @@ void MediaControlElement::setDisplayType(MediaControlElementType displayType)
// ----------------------------
-MediaControlDivElement::MediaControlDivElement(Document& document, MediaControlElementType displayType)
- : HTMLDivElement(document)
- , MediaControlElement(displayType, this)
+MediaControlDivElement::MediaControlDivElement(HTMLMediaElement& mediaElement, MediaControlElementType displayType)
+ : HTMLDivElement(mediaElement.document())
+ , MediaControlElement(mediaElement, displayType, this)
{
}
// ----------------------------
-MediaControlInputElement::MediaControlInputElement(Document& document, MediaControlElementType displayType)
- : HTMLInputElement(document, 0, false)
- , MediaControlElement(displayType, this)
+MediaControlInputElement::MediaControlInputElement(HTMLMediaElement& mediaElement, MediaControlElementType displayType)
+ : HTMLInputElement(mediaElement.document(), 0, false)
+ , MediaControlElement(mediaElement, displayType, this)
{
}
@@ -115,8 +124,8 @@ bool MediaControlInputElement::isMouseFocusable() const
// ----------------------------
-MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document& document, MediaControlElementType displayType)
- : MediaControlDivElement(document, displayType)
+MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(HTMLMediaElement& mediaElement, MediaControlElementType displayType)
+ : MediaControlDivElement(mediaElement, displayType)
, m_currentValue(0)
{
}

Powered by Google App Engine
This is Rietveld 408576698