2011-04-06 Alexis Menard <alexis.menard@openbossa.org>
[WebKit-https.git] / Source / WebKit / qt / WebCoreSupport / ChromeClientQt.cpp
index bec4bc4c3abdb5f3099680d963e0ad1e1fc06906..083593ca169abf89f1a8a3d72aa63053490e7073 100644 (file)
 #include <qtooltip.h>
 #include <wtf/OwnPtr.h>
 
-#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
+#if ENABLE(VIDEO)
 #include "FullScreenVideoQt.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
 #include "HTMLVideoElement.h"
+#if USE(QT_MULTIMEDIA)
 #include "MediaPlayerPrivateQt.h"
 #endif
+#endif
 
 namespace WebCore {
 
@@ -90,7 +92,7 @@ bool ChromeClientQt::dumpVisitedLinksCallbacks = false;
 ChromeClientQt::ChromeClientQt(QWebPage* webPage)
     : m_webPage(webPage)
     , m_eventLoop(0)
-#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
+#if ENABLE(VIDEO)
     , m_fullScreenVideo(0)
 #endif
 {
@@ -102,7 +104,7 @@ ChromeClientQt::~ChromeClientQt()
     if (m_eventLoop)
         m_eventLoop->exit();
 
-#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
+#if ENABLE(VIDEO)
     delete m_fullScreenVideo;
 #endif
 }
@@ -650,7 +652,7 @@ IntRect ChromeClientQt::visibleRectForTiledBackingStore() const
 }
 #endif
 
-#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
+#if ENABLE(VIDEO)
 FullScreenVideoQt* ChromeClientQt::fullScreenVideo()
 {
     if (!m_fullScreenVideo)
@@ -673,13 +675,6 @@ void ChromeClientQt::enterFullscreenForNode(Node* node)
 {
     ASSERT(node && node->hasTagName(HTMLNames::videoTag));
 
-    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node);
-    PlatformMedia platformMedia = videoElement->platformMedia();
-
-    ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType);
-    if (platformMedia.type != PlatformMedia::QtMediaPlayerType)
-        return;
-
     fullScreenVideo()->enterFullScreenForNode(node);
 }
 
@@ -687,13 +682,6 @@ void ChromeClientQt::exitFullscreenForNode(Node* node)
 {
     ASSERT(node && node->hasTagName(HTMLNames::videoTag));
 
-    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node);
-    PlatformMedia platformMedia = videoElement->platformMedia();
-
-    ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType);
-    if (platformMedia.type != PlatformMedia::QtMediaPlayerType)
-        return;
-
     fullScreenVideo()->exitFullScreenForNode(node);
 } 
 #endif