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

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: Give MediaControls to MediaControlElements 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
« no previous file with comments | « Source/core/html/shadow/MediaControlElementTypes.h ('k') | Source/core/html/shadow/MediaControlElements.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..23f88124472c59739be3dcc46c8b79681c53389d 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/shadow/MediaControls.h"
namespace WebCore {
@@ -65,13 +67,23 @@ MediaControlElementType mediaControlElementType(Node* node)
return static_cast<MediaControlDivElement*>(element)->displayType();
}
-MediaControlElement::MediaControlElement(MediaControlElementType displayType, HTMLElement* element)
- : m_mediaController(0)
+MediaControlElement::MediaControlElement(MediaControls& mediaControls, MediaControlElementType displayType, HTMLElement* element)
+ : m_mediaControls(mediaControls)
, m_displayType(displayType)
, m_element(element)
{
}
+HTMLMediaElement& MediaControlElement::mediaElement() const
+{
+ return mediaControls().mediaElement();
+}
+
+MediaControllerInterface& MediaControlElement::mediaControllerInterface() const
+{
+ return mediaControls().mediaControllerInterface();
+}
+
void MediaControlElement::hide()
{
m_element->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
@@ -94,17 +106,17 @@ void MediaControlElement::setDisplayType(MediaControlElementType displayType)
// ----------------------------
-MediaControlDivElement::MediaControlDivElement(Document& document, MediaControlElementType displayType)
- : HTMLDivElement(document)
- , MediaControlElement(displayType, this)
+MediaControlDivElement::MediaControlDivElement(MediaControls& mediaControls, MediaControlElementType displayType)
+ : HTMLDivElement(mediaControls.document())
+ , MediaControlElement(mediaControls, displayType, this)
{
}
// ----------------------------
-MediaControlInputElement::MediaControlInputElement(Document& document, MediaControlElementType displayType)
- : HTMLInputElement(document, 0, false)
- , MediaControlElement(displayType, this)
+MediaControlInputElement::MediaControlInputElement(MediaControls& mediaControls, MediaControlElementType displayType)
+ : HTMLInputElement(mediaControls.document(), 0, false)
+ , MediaControlElement(mediaControls, displayType, this)
{
}
@@ -115,8 +127,8 @@ bool MediaControlInputElement::isMouseFocusable() const
// ----------------------------
-MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document& document, MediaControlElementType displayType)
- : MediaControlDivElement(document, displayType)
+MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(MediaControls& mediaControls, MediaControlElementType displayType)
+ : MediaControlDivElement(mediaControls, displayType)
, m_currentValue(0)
{
}
« no previous file with comments | « Source/core/html/shadow/MediaControlElementTypes.h ('k') | Source/core/html/shadow/MediaControlElements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698