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

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

Issue 196533020: Remove dead code for dragging MediaControlPanelElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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/MediaControlElements.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/shadow/MediaControlElements.cpp
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp
index 5e0437684f1e317363d5768406afd98078b9227b..b44c0fd75afcdaa5d930babc4801b8ad19519b67 100644
--- a/Source/core/html/shadow/MediaControlElements.cpp
+++ b/Source/core/html/shadow/MediaControlElements.cpp
@@ -61,8 +61,6 @@ static const double fadeOutDuration = 0.3;
MediaControlPanelElement::MediaControlPanelElement(MediaControls& mediaControls)
: MediaControlDivElement(mediaControls, MediaControlsPanel)
- , m_canBeDragged(false)
- , m_isBeingDragged(false)
, m_isDisplayed(false)
, m_opaque(true)
, m_transitionTimer(this, &MediaControlPanelElement::transitionTimerFired)
@@ -80,54 +78,6 @@ const AtomicString& MediaControlPanelElement::shadowPseudoId() const
return id;
}
-void MediaControlPanelElement::startDrag(const LayoutPoint& eventLocation)
-{
- if (!m_canBeDragged)
- return;
-
- if (m_isBeingDragged)
- return;
-
- RenderObject* renderer = this->renderer();
- if (!renderer || !renderer->isBox())
- return;
-
- LocalFrame* frame = document().frame();
- if (!frame)
- return;
-
- m_lastDragEventLocation = eventLocation;
-
- frame->eventHandler().setCapturingMouseEventsNode(this);
-
- m_isBeingDragged = true;
-}
-
-void MediaControlPanelElement::continueDrag(const LayoutPoint& eventLocation)
-{
- if (!m_isBeingDragged)
- return;
-
- LayoutSize distanceDragged = eventLocation - m_lastDragEventLocation;
- m_cumulativeDragOffset.move(distanceDragged);
- m_lastDragEventLocation = eventLocation;
- setPosition(m_cumulativeDragOffset);
-}
-
-void MediaControlPanelElement::endDrag()
-{
- if (!m_isBeingDragged)
- return;
-
- m_isBeingDragged = false;
-
- LocalFrame* frame = document().frame();
- if (!frame)
- return;
-
- frame->eventHandler().setCapturingMouseEventsNode(nullptr);
-}
-
void MediaControlPanelElement::startTimer()
{
stopTimer();
@@ -153,35 +103,6 @@ void MediaControlPanelElement::transitionTimerFired(Timer<MediaControlPanelEleme
stopTimer();
}
-void MediaControlPanelElement::setPosition(const LayoutPoint& position)
-{
- // FIXME: Do we really want to up-convert these to doubles and not round? crbug.com/350474
- double left = position.x().toFloat();
- double top = position.y().toFloat();
-
- // Set the left and top to control the panel's position; this depends on it being absolute positioned.
- // Set the margin to zero since the position passed in will already include the effect of the margin.
- setInlineStyleProperty(CSSPropertyLeft, left, CSSPrimitiveValue::CSS_PX);
- setInlineStyleProperty(CSSPropertyTop, top, CSSPrimitiveValue::CSS_PX);
- setInlineStyleProperty(CSSPropertyMarginLeft, 0.0, CSSPrimitiveValue::CSS_PX);
- setInlineStyleProperty(CSSPropertyMarginTop, 0.0, CSSPrimitiveValue::CSS_PX);
-
- classList().add("dragged", IGNORE_EXCEPTION);
-}
-
-void MediaControlPanelElement::resetPosition()
-{
- removeInlineStyleProperty(CSSPropertyLeft);
- removeInlineStyleProperty(CSSPropertyTop);
- removeInlineStyleProperty(CSSPropertyMarginLeft);
- removeInlineStyleProperty(CSSPropertyMarginTop);
-
- classList().remove("dragged", IGNORE_EXCEPTION);
-
- m_cumulativeDragOffset.setX(0);
- m_cumulativeDragOffset.setY(0);
-}
-
void MediaControlPanelElement::makeOpaque()
{
if (m_opaque)
@@ -210,36 +131,6 @@ void MediaControlPanelElement::makeTransparent()
startTimer();
}
-void MediaControlPanelElement::defaultEventHandler(Event* event)
adamk 2014/03/14 23:42:56 It's strange that we'd actually run this code...th
philipj_slow 2014/03/15 03:02:36 The defaultEventHandler implementations in this fi
-{
- MediaControlDivElement::defaultEventHandler(event);
-
- if (event->isMouseEvent()) {
- LayoutPoint location = toMouseEvent(event)->absoluteLocation();
- if (event->type() == EventTypeNames::mousedown && event->target() == this) {
- startDrag(location);
- event->setDefaultHandled();
- } else if (event->type() == EventTypeNames::mousemove && m_isBeingDragged)
- continueDrag(location);
- else if (event->type() == EventTypeNames::mouseup && m_isBeingDragged) {
- continueDrag(location);
- endDrag();
- event->setDefaultHandled();
- }
- }
-}
-
-void MediaControlPanelElement::setCanBeDragged(bool canBeDragged)
-{
- if (m_canBeDragged == canBeDragged)
- return;
-
- m_canBeDragged = canBeDragged;
-
- if (!canBeDragged)
- endDrag();
-}
-
void MediaControlPanelElement::setIsDisplayed(bool isDisplayed)
{
m_isDisplayed = isDisplayed;
« no previous file with comments | « Source/core/html/shadow/MediaControlElements.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698