[GTK][GStreamer] FullscreenVideoControllerGtk implementation
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 10:25:16 +0000 (10:25 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 10:25:16 +0000 (10:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107398

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

NATIVE_FULLSCREEN_VIDEO support for the GTK port. The previous
FullscreenVideoController implementation was refactored as a
sub-class of FullscreenVideoControllerGStreamer and hooked in the
MediaPlayerPrivateGStreamer backend.

* GNUmakefile.list.am:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Renamed from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp.
* platform/graphics/gtk/FullscreenVideoControllerGtk.h: Renamed from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h.

Source/WebKit/gtk:

Remove the FullscreenVideoController as it moved to
FullscreenVideoControllerGStreamer and its Gtk subclass in
WebCore. Hook in NATIVE_FULLSCREEN_VIDEO in the ChromeClient in
the two possible scenarios, wether FULLSCREEN_API is enabled or not.

* GNUmakefile.am: Remove FullscreenVideoController.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit):
(WebKit::ChromeClient::enterFullscreenForNode): Hook
NATIVE_FULLSCREEN_VIDEO support.
(WebKit::ChromeClient::exitFullscreenForNode): Ditto
(WebKit::ChromeClient::enterFullScreenForElement): Ditto
(WebKit::ChromeClient::exitFullScreenForElement): Ditto
* WebCoreSupport/ChromeClientGtk.h:
(ChromeClient):
* WebCoreSupport/FullscreenVideoController.cpp: Removed.
* WebCoreSupport/FullscreenVideoController.h: Removed.
* webkit/webkitwebview.cpp: Remove FullscreenVideoController support.
* webkit/webkitwebviewprivate.h: Ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp [moved from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp with 54% similarity]
Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.h [moved from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h with 56% similarity]
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/gtk/webkit/webkitwebviewprivate.h

index c232aaa..4ed6f58 100644 (file)
@@ -1,3 +1,22 @@
+2013-02-01  Philippe Normand  <pnormand@igalia.com>
+
+        [GTK][GStreamer] FullscreenVideoControllerGtk implementation
+        https://bugs.webkit.org/show_bug.cgi?id=107398
+
+        Reviewed by Gustavo Noronha Silva.
+
+        NATIVE_FULLSCREEN_VIDEO support for the GTK port. The previous
+        FullscreenVideoController implementation was refactored as a
+        sub-class of FullscreenVideoControllerGStreamer and hooked in the
+        MediaPlayerPrivateGStreamer backend.
+
+        * GNUmakefile.list.am:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Renamed from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp.
+        * platform/graphics/gtk/FullscreenVideoControllerGtk.h: Renamed from Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h.
+
 2013-02-01  Andrey Lushnikov  <lushnikov@chromium.org>
 
         Web Inspector: fix cursor location in Source Frame
index 27fe798..e2aa90c 100644 (file)
@@ -6082,6 +6082,8 @@ webcoregtk_sources += \
        Source/WebCore/platform/graphics/gtk/ColorGtk.cpp \
        Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.cpp \
        Source/WebCore/platform/graphics/gtk/GdkCairoUtilities.h \
+       Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.cpp \
+       Source/WebCore/platform/graphics/gtk/FullscreenVideoControllerGtk.h \
        Source/WebCore/platform/graphics/gtk/IconGtk.cpp \
        Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
        Source/WebCore/platform/graphics/gtk/ImageGtk.cpp \
index 53faf78..9b86007 100644 (file)
 
 #include "FullscreenVideoControllerGStreamer.h"
 
+#if PLATFORM(GTK)
+#include "FullscreenVideoControllerGtk.h"
+#endif
+
 #include "GStreamerGWorld.h"
 #include "MediaPlayer.h"
 #include "MediaPlayerPrivateGStreamer.h"
@@ -44,6 +48,14 @@ void playerMuteChangedCallback(GObject *element, GParamSpec *pspec, FullscreenVi
     controller->muteChanged();
 }
 
+PassOwnPtr<FullscreenVideoControllerGStreamer> FullscreenVideoControllerGStreamer::create(MediaPlayerPrivateGStreamer* player)
+{
+#if PLATFORM(GTK)
+   return adoptPtr(new FullscreenVideoControllerGtk(player));
+#else
+   return nullptr;
+#endif
+}
 
 FullscreenVideoControllerGStreamer::FullscreenVideoControllerGStreamer(MediaPlayerPrivateGStreamer* player)
     : m_player(player)
index d1c1c76..4844c7f 100644 (file)
@@ -35,6 +35,7 @@ class MediaPlayerClient;
 class FullscreenVideoControllerGStreamer {
     WTF_MAKE_NONCOPYABLE(FullscreenVideoControllerGStreamer);
 public:
+    static PassOwnPtr<FullscreenVideoControllerGStreamer> create(MediaPlayerPrivateGStreamer* player);
     FullscreenVideoControllerGStreamer(MediaPlayerPrivateGStreamer*);
     virtual ~FullscreenVideoControllerGStreamer();
 
index a21cfbd..a77e66a 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007 Collabora Ltd.  All rights reserved.
  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
  * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
- * Copyright (C) 2009, 2010 Igalia S.L
+ * Copyright (C) 2009, 2010, 2011, 2012, 2013 Igalia S.L
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -30,6 +30,7 @@
 #include "Document.h"
 #include "Frame.h"
 #include "FrameView.h"
+#include "FullscreenVideoControllerGStreamer.h"
 #include "GStreamerGWorld.h"
 #include "GStreamerUtilities.h"
 #include "GStreamerVersioning.h"
@@ -269,6 +270,9 @@ MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
     }
 
 #if USE(NATIVE_FULLSCREEN_VIDEO)
+    if (m_fullscreenVideoController)
+        exitFullscreen();
+
     if (m_videoSinkBin) {
         gst_object_unref(m_videoSinkBin);
         m_videoSinkBin = 0;
@@ -1761,12 +1765,18 @@ bool MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin() const
 #if USE(NATIVE_FULLSCREEN_VIDEO)
 void MediaPlayerPrivateGStreamer::enterFullscreen()
 {
-    notImplemented();
+    ASSERT(!m_fullscreenVideoController);
+    m_fullscreenVideoController = FullscreenVideoControllerGStreamer::create(this);
+    if (m_fullscreenVideoController)
+        m_fullscreenVideoController->enterFullscreen();
 }
 
 void MediaPlayerPrivateGStreamer::exitFullscreen()
 {
-    notImplemented();
+    if (!m_fullscreenVideoController)
+        return;
+    m_fullscreenVideoController->exitFullscreen();
+    m_fullscreenVideoController.release();
 }
 #endif
 
index 7398e2f..7eaa05b 100644 (file)
@@ -39,10 +39,7 @@ typedef struct _GstElement GstElement;
 
 namespace WebCore {
 
-#ifdef FullscreenVideoControllerClass
-class FullscreenVideoControllerClass;
-#endif
-
+class FullscreenVideoControllerGStreamer;
 class GraphicsContext;
 class IntSize;
 class IntRect;
@@ -207,9 +204,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
             mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
 #if USE(NATIVE_FULLSCREEN_VIDEO)
             RefPtr<GStreamerGWorld> m_gstGWorld;
-#ifdef FullscreenVideoControllerClass
-            OwnPtr<FullscreenVideoControllerClass> m_fullscreenVideoController;
-#endif
+            OwnPtr<FullscreenVideoControllerGStreamer> m_fullscreenVideoController;
 #endif
             guint m_volumeTimerHandler;
             guint m_muteTimerHandler;
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2010 Igalia S.L
+ *  Copyright (C) 2013 Igalia S.L
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
 
 #include "config.h"
 
-#if ENABLE(VIDEO) && !defined(GST_API_VERSION_1)
+#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)
 
-#include "FullscreenVideoController.h"
+#include "FullscreenVideoControllerGtk.h"
 
+#include "FullscreenVideoControllerGStreamer.h"
 #include "GRefPtrGtk.h"
+#include "GStreamerGWorld.h"
 #include "GtkVersioning.h"
 #include "MediaPlayer.h"
+#include "MediaPlayerPrivateGStreamer.h"
 
 #include <gdk/gdk.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
-#include <gst/gst.h>
 #include <gtk/gtk.h>
-
-using namespace std;
-using namespace WebCore;
+#include <wtf/text/CString.h>
 
 #define HUD_AUTO_HIDE_INTERVAL 3000 // 3 seconds
 #define PROGRESS_BAR_UPDATE_INTERVAL 150 // 150ms
-#define VOLUME_UP_OFFSET 0.05 // 5%
-#define VOLUME_DOWN_OFFSET 0.05 // 5%
 
 // Use symbolic icons only if we build with GTK+-3 support. They could
 // be enabled for the GTK+2 build but we'd need to bump the required
 // version to at least 2.22.
-#if GTK_MAJOR_VERSION < 3
-#define PLAY_ICON_NAME "media-playback-start"
-#define PAUSE_ICON_NAME "media-playback-pause"
-#define EXIT_FULLSCREEN_ICON_NAME "view-restore"
+#if GTK_MAJOR_VERSION > 2
+#define ICON_NAME_SUFFIX "-symbolic"
 #else
-#define PLAY_ICON_NAME "media-playback-start-symbolic"
-#define PAUSE_ICON_NAME "media-playback-pause-symbolic"
-#define EXIT_FULLSCREEN_ICON_NAME "view-restore-symbolic"
+#define ICON_NAME_SUFFIX
 #endif
 
-static gboolean hideHudCallback(FullscreenVideoController* controller)
+#define PLAY_ICON_NAME "media-playback-start"ICON_NAME_SUFFIX
+#define PAUSE_ICON_NAME "media-playback-pause"ICON_NAME_SUFFIX
+#define EXIT_FULLSCREEN_ICON_NAME "view-restore"ICON_NAME_SUFFIX
+
+namespace WebCore {
+
+static gboolean hideHudCallback(FullscreenVideoControllerGtk* controller)
 {
     controller->hideHud();
     return FALSE;
 }
 
-static gboolean onFullscreenGtkMotionNotifyEvent(GtkWidget* widget, GdkEventMotion* event,  FullscreenVideoController* controller)
+static gboolean onFullscreenGtkMotionNotifyEvent(GtkWidget* widget, GdkEventMotion* event,  FullscreenVideoControllerGtk* controller)
 {
     controller->showHud(true);
     return TRUE;
 }
 
-static void onFullscreenGtkActiveNotification(GtkWidget* widget, GParamSpec* property, FullscreenVideoController* controller)
+static void onFullscreenGtkActiveNotification(GtkWidget* widget, GParamSpec* property, FullscreenVideoControllerGtk* controller)
 {
     if (!gtk_window_is_active(GTK_WINDOW(widget)))
         controller->hideHud();
 }
 
-static gboolean onFullscreenGtkConfigureEvent(GtkWidget* widget, GdkEventConfigure* event, FullscreenVideoController* controller)
+static gboolean onFullscreenGtkConfigureEvent(GtkWidget* widget, GdkEventConfigure* event, FullscreenVideoControllerGtk* controller)
 {
     controller->gtkConfigure(event);
     return TRUE;
 }
 
-static void onFullscreenGtkDestroy(GtkWidget* widget, FullscreenVideoController* controller)
+static void onFullscreenGtkDestroy(GtkWidget* widget, FullscreenVideoControllerGtk* controller)
 {
     controller->exitFullscreen();
 }
 
-static void togglePlayPauseActivated(GtkAction* action, FullscreenVideoController* controller)
+static void togglePlayPauseActivated(GtkAction* action, FullscreenVideoControllerGtk* controller)
 {
     controller->togglePlay();
 }
 
-static void exitFullscreenActivated(GtkAction* action, FullscreenVideoController* controller)
+static void exitFullscreenActivated(GtkAction* action, FullscreenVideoControllerGtk* controller)
 {
     controller->exitOnUserRequest();
 }
 
-static gboolean progressBarUpdateCallback(FullscreenVideoController* controller)
+static gboolean progressBarUpdateCallback(FullscreenVideoControllerGtk* controller)
 {
     return controller->updateHudProgressBar();
 }
 
-static gboolean timeScaleButtonPressed(GtkWidget* widget, GdkEventButton* event, FullscreenVideoController* controller)
+static gboolean timeScaleButtonPressed(GtkWidget* widget, GdkEventButton* event, FullscreenVideoControllerGtk* controller)
 {
     if (event->type != GDK_BUTTON_PRESS)
         return FALSE;
@@ -107,64 +107,49 @@ static gboolean timeScaleButtonPressed(GtkWidget* widget, GdkEventButton* event,
     return FALSE;
 }
 
-static gboolean timeScaleButtonReleased(GtkWidget* widget, GdkEventButton* event, FullscreenVideoController* controller)
+static gboolean timeScaleButtonReleased(GtkWidget* widget, GdkEventButton* event, FullscreenVideoControllerGtk* controller)
 {
     controller->endSeek();
     return FALSE;
 }
 
-static void timeScaleValueChanged(GtkWidget* widget, FullscreenVideoController* controller)
+static void timeScaleValueChanged(GtkWidget* widget, FullscreenVideoControllerGtk* controller)
 {
     controller->doSeek();
 }
 
-static void volumeValueChanged(GtkScaleButton *button, gdouble value, FullscreenVideoController* controller)
+static void volumeValueChanged(GtkScaleButton *button, gdouble value, FullscreenVideoControllerGtk* controller)
 {
     controller->setVolume(static_cast<float>(value));
 }
 
-void playerVolumeChangedCallback(GObject *element, GParamSpec *pspec, FullscreenVideoController* controller)
-{
-    controller->volumeChanged();
-}
 
-void playerMuteChangedCallback(GObject *element, GParamSpec *pspec, FullscreenVideoController* controller)
-{
-    controller->muteChanged();
-}
-
-FullscreenVideoController::FullscreenVideoController()
-    : m_hudTimeoutId(0)
+FullscreenVideoControllerGtk::FullscreenVideoControllerGtk(MediaPlayerPrivateGStreamer* player)
+    : FullscreenVideoControllerGStreamer(player)
+    , m_hudTimeoutId(0)
     , m_progressBarUpdateId(0)
     , m_seekLock(false)
     , m_window(0)
     , m_hudWindow(0)
+    , m_keyPressSignalId(0)
+    , m_destroySignalId(0)
+    , m_isActiveSignalId(0)
+    , m_motionNotifySignalId(0)
+    , m_configureEventSignalId(0)
+    , m_hudMotionNotifySignalId(0)
+    , m_timeScaleButtonPressedSignalId(0)
+    , m_timeScaleButtonReleasedSignalId(0)
+    , m_playActionActivateSignalId(0)
+    , m_exitFullcreenActionActivateSignalId(0)
 {
 }
 
-FullscreenVideoController::~FullscreenVideoController()
-{
-    exitFullscreen();
-}
-
-void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement)
-{
-    if (mediaElement == m_mediaElement)
-        return;
-
-    m_mediaElement = mediaElement;
-    if (!m_mediaElement) {
-        // Can't do full-screen, just get out
-        exitFullscreen();
-    }
-}
-
-void FullscreenVideoController::gtkConfigure(GdkEventConfigure* event)
+void FullscreenVideoControllerGtk::gtkConfigure(GdkEventConfigure* event)
 {
     updateHudPosition();
 }
 
-void FullscreenVideoController::showHud(bool autoHide)
+void FullscreenVideoControllerGtk::showHud(bool autoHide)
 {
     if (!m_hudWindow)
         return;
@@ -192,7 +177,7 @@ void FullscreenVideoController::showHud(bool autoHide)
         m_hudTimeoutId = g_timeout_add(HUD_AUTO_HIDE_INTERVAL, reinterpret_cast<GSourceFunc>(hideHudCallback), this);
 }
 
-void FullscreenVideoController::hideHud()
+void FullscreenVideoControllerGtk::hideHud()
 {
     if (m_hudTimeoutId) {
         g_source_remove(m_hudTimeoutId);
@@ -222,12 +207,10 @@ void FullscreenVideoController::hideHud()
     }
 }
 
-static gboolean onFullscreenGtkKeyPressEvent(GtkWidget* widget, GdkEventKey* event, FullscreenVideoController* controller)
+static gboolean onFullscreenGtkKeyPressEvent(GtkWidget* widget, GdkEventKey* event, FullscreenVideoControllerGtk* controller)
 {
     switch (event->keyval) {
     case GDK_Escape:
-    case 'f':
-    case 'F':
         controller->exitOnUserRequest();
         break;
     case GDK_space:
@@ -235,12 +218,10 @@ static gboolean onFullscreenGtkKeyPressEvent(GtkWidget* widget, GdkEventKey* eve
         controller->togglePlay();
         break;
     case GDK_Up:
-        // volume up
-        controller->setVolume(controller->volume() + VOLUME_UP_OFFSET);
+        controller->increaseVolume();
         break;
     case GDK_Down:
-        // volume down
-        controller->setVolume(controller->volume() - VOLUME_DOWN_OFFSET);
+        controller->decreaseVolume();
         break;
     default:
         break;
@@ -249,25 +230,10 @@ static gboolean onFullscreenGtkKeyPressEvent(GtkWidget* widget, GdkEventKey* eve
     return TRUE;
 }
 
-
-void FullscreenVideoController::enterFullscreen()
+void FullscreenVideoControllerGtk::initializeWindow()
 {
-    if (!m_mediaElement)
-        return;
-
-    if (m_mediaElement->platformMedia().type != WebCore::PlatformMedia::GStreamerGWorldType)
-        return;
-
-    m_gstreamerGWorld = m_mediaElement->platformMedia().media.gstreamerGWorld;
-    if (!m_gstreamerGWorld->enterFullscreen())
-        return;
-
     m_window = reinterpret_cast<GtkWidget*>(m_gstreamerGWorld->platformVideoWindow()->window());
 
-    GstElement* pipeline = m_gstreamerGWorld->pipeline();
-    g_signal_connect(pipeline, "notify::volume", G_CALLBACK(playerVolumeChangedCallback), this);
-    g_signal_connect(pipeline, "notify::mute", G_CALLBACK(playerMuteChangedCallback), this);
-
     if (!m_hudWindow)
         createHud();
 
@@ -281,9 +247,9 @@ void FullscreenVideoController::enterFullscreen()
 #endif
     gtk_widget_set_double_buffered(m_window, FALSE);
 
-    g_signal_connect(m_window, "key-press-event", G_CALLBACK(onFullscreenGtkKeyPressEvent), this);
-    g_signal_connect(m_window, "destroy", G_CALLBACK(onFullscreenGtkDestroy), this);
-    g_signal_connect(m_window, "notify::is-active", G_CALLBACK(onFullscreenGtkActiveNotification), this);
+    m_keyPressSignalId = g_signal_connect(m_window, "key-press-event", G_CALLBACK(onFullscreenGtkKeyPressEvent), this);
+    m_destroySignalId = g_signal_connect(m_window, "destroy", G_CALLBACK(onFullscreenGtkDestroy), this);
+    m_isActiveSignalId = g_signal_connect(m_window, "notify::is-active", G_CALLBACK(onFullscreenGtkActiveNotification), this);
 
     gtk_widget_show_all(m_window);
 
@@ -291,14 +257,14 @@ void FullscreenVideoController::enterFullscreen()
     GRefPtr<GdkCursor> cursor(adoptGRef(blankCursor()));
     gdk_window_set_cursor(window, cursor.get());
 
-    g_signal_connect(m_window, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);
-    g_signal_connect(m_window, "configure-event", G_CALLBACK(onFullscreenGtkConfigureEvent), this);
+    m_motionNotifySignalId = g_signal_connect(m_window, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);
+    m_configureEventSignalId = g_signal_connect(m_window, "configure-event", G_CALLBACK(onFullscreenGtkConfigureEvent), this);
 
     gtk_window_fullscreen(GTK_WINDOW(m_window));
     showHud(true);
 }
 
-void FullscreenVideoController::updateHudPosition()
+void FullscreenVideoControllerGtk::updateHudPosition()
 {
     if (!m_hudWindow)
         return;
@@ -307,8 +273,7 @@ void FullscreenVideoController::updateHudPosition()
     GdkScreen* screen = gtk_window_get_screen(GTK_WINDOW(m_window));
     GdkWindow* window = gtk_widget_get_window(m_window);
     GdkRectangle fullscreenRectangle;
-    gdk_screen_get_monitor_geometry(screen, gdk_screen_get_monitor_at_window(screen, window),
-                                    &fullscreenRectangle);
+    gdk_screen_get_monitor_geometry(screen, gdk_screen_get_monitor_at_window(screen, window), &fullscreenRectangle);
 
     // Get the popup window size.
     int hudWidth, hudHeight;
@@ -318,28 +283,26 @@ void FullscreenVideoController::updateHudPosition()
     gtk_window_resize(GTK_WINDOW(m_hudWindow), fullscreenRectangle.width, hudHeight);
 
     // Move the hud to the bottom of the screen.
-    gtk_window_move(GTK_WINDOW(m_hudWindow), fullscreenRectangle.x,
-                    fullscreenRectangle.height + fullscreenRectangle.y - hudHeight);
-}
-
-void FullscreenVideoController::exitOnUserRequest()
-{
-    m_mediaElement->exitFullscreen();
+    gtk_window_move(GTK_WINDOW(m_hudWindow), fullscreenRectangle.x, fullscreenRectangle.height + fullscreenRectangle.y - hudHeight);
 }
 
-void FullscreenVideoController::exitFullscreen()
+void FullscreenVideoControllerGtk::destroyWindow()
 {
     if (!m_hudWindow)
         return;
 
-    g_signal_handlers_disconnect_by_func(m_window, reinterpret_cast<void*>(onFullscreenGtkKeyPressEvent), this);
-    g_signal_handlers_disconnect_by_func(m_window, reinterpret_cast<void*>(onFullscreenGtkDestroy), this);
-    g_signal_handlers_disconnect_by_func(m_window, reinterpret_cast<void*>(onFullscreenGtkMotionNotifyEvent), this);
-    g_signal_handlers_disconnect_by_func(m_window, reinterpret_cast<void*>(onFullscreenGtkConfigureEvent), this);
-
-    GstElement* pipeline = m_mediaElement->platformMedia().media.gstreamerGWorld->pipeline();
-    g_signal_handlers_disconnect_by_func(pipeline, reinterpret_cast<void*>(playerVolumeChangedCallback), this);
-    g_signal_handlers_disconnect_by_func(pipeline, reinterpret_cast<void*>(playerMuteChangedCallback), this);
+    g_signal_handler_disconnect(m_window, m_keyPressSignalId);
+    g_signal_handler_disconnect(m_window, m_destroySignalId);
+    g_signal_handler_disconnect(m_window, m_isActiveSignalId);
+    g_signal_handler_disconnect(m_window, m_motionNotifySignalId);
+    g_signal_handler_disconnect(m_window, m_configureEventSignalId);
+    g_signal_handler_disconnect(m_hudWindow, m_hudMotionNotifySignalId);
+    g_signal_handler_disconnect(m_timeHScale, m_timeScaleButtonPressedSignalId);
+    g_signal_handler_disconnect(m_timeHScale, m_timeScaleButtonReleasedSignalId);
+    g_signal_handler_disconnect(m_timeHScale, m_hscaleUpdateId);
+    g_signal_handler_disconnect(m_volumeButton, m_volumeUpdateId);
+    g_signal_handler_disconnect(m_playPauseAction, m_playActionActivateSignalId);
+    g_signal_handler_disconnect(m_exitFullscreenAction, m_exitFullcreenActionActivateSignalId);
 
     if (m_hudTimeoutId) {
         g_source_remove(m_hudTimeoutId);
@@ -351,158 +314,58 @@ void FullscreenVideoController::exitFullscreen()
         m_progressBarUpdateId = 0;
     }
 
-    if (m_mediaElement->platformMedia().type == WebCore::PlatformMedia::GStreamerGWorldType)
-        m_mediaElement->platformMedia().media.gstreamerGWorld->exitFullscreen();
-
     gtk_widget_hide(m_window);
 
-    gtk_widget_destroy(m_hudWindow);
+    if (m_hudWindow)
+        gtk_widget_destroy(m_hudWindow);
     m_hudWindow = 0;
 }
 
-bool FullscreenVideoController::canPlay() const
-{
-    return m_mediaElement && m_mediaElement->canPlay();
-}
-
-void FullscreenVideoController::play()
-{
-    if (m_mediaElement)
-        m_mediaElement->play();
-
-    playStateChanged();
-    showHud(true);
-}
-
-void FullscreenVideoController::pause()
-{
-    if (m_mediaElement)
-        m_mediaElement->pause();
-
-    playStateChanged();
-    showHud(false);
-}
-
-void FullscreenVideoController::playStateChanged()
+void FullscreenVideoControllerGtk::playStateChanged()
 {
-    if (canPlay())
+    if (m_client->mediaPlayerIsPaused())
         g_object_set(m_playPauseAction, "tooltip", _("Play"), "icon-name", PLAY_ICON_NAME, NULL);
     else
         g_object_set(m_playPauseAction, "tooltip", _("Pause"), "icon-name", PAUSE_ICON_NAME, NULL);
+    showHud(!m_client->mediaPlayerIsPaused());
 }
 
-void FullscreenVideoController::togglePlay()
-{
-    if (canPlay())
-        play();
-    else
-        pause();
-}
-
-float FullscreenVideoController::volume() const
-{
-    return m_mediaElement ? m_mediaElement->volume() : 0;
-}
-
-bool FullscreenVideoController::muted() const
-{
-    return m_mediaElement ? m_mediaElement->muted() : false;
-}
-
-void FullscreenVideoController::setVolume(float volume)
-{
-    if (volume < 0.0 || volume > 1.0)
-        return;
-
-    if (m_mediaElement) {
-        ExceptionCode ec;
-        m_mediaElement->setVolume(volume, ec);
-    }
-}
-
-void FullscreenVideoController::volumeChanged()
+void FullscreenVideoControllerGtk::volumeChanged()
 {
     g_signal_handler_block(m_volumeButton, m_volumeUpdateId);
-    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), volume());
+    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), m_player->volume());
     g_signal_handler_unblock(m_volumeButton, m_volumeUpdateId);
 }
 
-void FullscreenVideoController::muteChanged()
+void FullscreenVideoControllerGtk::muteChanged()
 {
     g_signal_handler_block(m_volumeButton, m_volumeUpdateId);
-    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), muted() ? 0 : volume());
+    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), m_player->muted() ? 0 : m_player->volume());
     g_signal_handler_unblock(m_volumeButton, m_volumeUpdateId);
 }
 
-float FullscreenVideoController::currentTime() const
-{
-    return m_mediaElement ? m_mediaElement->currentTime() : 0;
-}
-
-void FullscreenVideoController::setCurrentTime(float value)
-{
-    if (m_mediaElement) {
-        ExceptionCode ec;
-        m_mediaElement->setCurrentTime(value, ec);
-    }
-}
-
-float FullscreenVideoController::duration() const
-{
-    return m_mediaElement ? m_mediaElement->duration() : 0;
-}
-
-float FullscreenVideoController::percentLoaded() const
-{
-    return m_mediaElement ? m_mediaElement->percentLoaded() : 0;
-}
-
-void FullscreenVideoController::beginSeek()
+void FullscreenVideoControllerGtk::beginSeek()
 {
     m_seekLock = true;
-
-    if (m_mediaElement)
-        m_mediaElement->beginScrubbing();
 }
 
-void FullscreenVideoController::doSeek()
+void FullscreenVideoControllerGtk::doSeek()
 {
     if (!m_seekLock)
-         return;
+        return;
 
-    setCurrentTime(gtk_range_get_value(GTK_RANGE(m_timeHScale))*duration() / 100);
+    m_player->seek(gtk_range_get_value(GTK_RANGE(m_timeHScale))*m_player->duration() / 100);
 }
 
-void FullscreenVideoController::endSeek()
+void FullscreenVideoControllerGtk::endSeek()
 {
-    if (m_mediaElement)
-        m_mediaElement->endScrubbing();
-
     m_seekLock = false;
 }
 
-static String timeToString(float time)
+gboolean FullscreenVideoControllerGtk::updateHudProgressBar()
 {
-    if (!isfinite(time))
-        time = 0;
-    int seconds = fabsf(time);
-    int hours = seconds / (60 * 60);
-    int minutes = (seconds / 60) % 60;
-    seconds %= 60;
-
-    if (hours) {
-        if (hours > 9)
-            return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-        return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-    }
-
-    return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds);
-}
-
-gboolean FullscreenVideoController::updateHudProgressBar()
-{
-    float mediaDuration(duration());
-    float mediaPosition(currentTime());
+    float mediaDuration(m_player->duration());
+    float mediaPosition(m_player->currentTime());
 
     if (!m_seekLock) {
         gdouble value = 0.0;
@@ -514,22 +377,21 @@ gboolean FullscreenVideoController::updateHudProgressBar()
         gtk_adjustment_set_value(adjustment, value);
     }
 
-    gtk_range_set_fill_level(GTK_RANGE(m_timeHScale), percentLoaded()* 100);
+    gtk_range_set_fill_level(GTK_RANGE(m_timeHScale), (m_player->maxTimeLoaded() / mediaDuration)* 100);
 
-    gchar* label = g_strdup_printf("%s / %s", timeToString(mediaPosition).utf8().data(),
-                                   timeToString(mediaDuration).utf8().data());
+    gchar* label = g_strdup_printf("%s / %s", timeToString(mediaPosition).utf8().data(), timeToString(mediaDuration).utf8().data());
     gtk_label_set_text(GTK_LABEL(m_timeLabel), label);
     g_free(label);
     return TRUE;
 }
 
-void FullscreenVideoController::createHud()
+void FullscreenVideoControllerGtk::createHud()
 {
     m_hudWindow = gtk_window_new(GTK_WINDOW_POPUP);
     gtk_window_set_gravity(GTK_WINDOW(m_hudWindow), GDK_GRAVITY_SOUTH_WEST);
     gtk_window_set_type_hint(GTK_WINDOW(m_hudWindow), GDK_WINDOW_TYPE_HINT_NORMAL);
 
-    g_signal_connect(m_hudWindow, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);
+    m_hudMotionNotifySignalId = g_signal_connect(m_hudWindow, "motion-notify-event", G_CALLBACK(onFullscreenGtkMotionNotifyEvent), this);
 
 #ifdef GTK_API_VERSION_2
     GtkWidget* hbox = gtk_hbox_new(FALSE, 4);
@@ -539,9 +401,7 @@ void FullscreenVideoController::createHud()
     gtk_container_add(GTK_CONTAINER(m_hudWindow), hbox);
 
     m_playPauseAction = gtk_action_new("play", _("Play / Pause"), _("Play or pause the media"), PAUSE_ICON_NAME);
-    g_signal_connect(m_playPauseAction, "activate", G_CALLBACK(togglePlayPauseActivated), this);
-
-    playStateChanged();
+    m_playActionActivateSignalId = g_signal_connect(m_playPauseAction, "activate", G_CALLBACK(togglePlayPauseActivated), this);
 
     GtkWidget* item = gtk_action_create_tool_item(m_playPauseAction);
     gtk_box_pack_start(GTK_BOX(hbox), item, FALSE, TRUE, 0);
@@ -557,8 +417,8 @@ void FullscreenVideoController::createHud()
 #endif
     gtk_scale_set_draw_value(GTK_SCALE(m_timeHScale), FALSE);
     gtk_range_set_show_fill_level(GTK_RANGE(m_timeHScale), TRUE);
-    g_signal_connect(m_timeHScale, "button-press-event", G_CALLBACK(timeScaleButtonPressed), this);
-    g_signal_connect(m_timeHScale, "button-release-event", G_CALLBACK(timeScaleButtonReleased), this);
+    m_timeScaleButtonPressedSignalId = g_signal_connect(m_timeHScale, "button-press-event", G_CALLBACK(timeScaleButtonPressed), this);
+    m_timeScaleButtonReleasedSignalId = g_signal_connect(m_timeHScale, "button-release-event", G_CALLBACK(timeScaleButtonReleased), this);
     m_hscaleUpdateId = g_signal_connect(m_timeHScale, "value-changed", G_CALLBACK(timeScaleValueChanged), this);
 
     gtk_box_pack_start(GTK_BOX(hbox), m_timeHScale, TRUE, TRUE, 0);
@@ -569,18 +429,19 @@ void FullscreenVideoController::createHud()
     // Volume button.
     m_volumeButton = gtk_volume_button_new();
     gtk_box_pack_start(GTK_BOX(hbox), m_volumeButton, FALSE, TRUE, 0);
-    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), volume());
+    gtk_scale_button_set_value(GTK_SCALE_BUTTON(m_volumeButton), m_player->volume());
     m_volumeUpdateId = g_signal_connect(m_volumeButton, "value-changed", G_CALLBACK(volumeValueChanged), this);
 
-
     m_exitFullscreenAction = gtk_action_new("exit", _("Exit Fullscreen"), _("Exit from fullscreen mode"), EXIT_FULLSCREEN_ICON_NAME);
-    g_signal_connect(m_exitFullscreenAction, "activate", G_CALLBACK(exitFullscreenActivated), this);
+    m_exitFullcreenActionActivateSignalId = g_signal_connect(m_exitFullscreenAction, "activate", G_CALLBACK(exitFullscreenActivated), this);
     g_object_set(m_exitFullscreenAction, "icon-name", EXIT_FULLSCREEN_ICON_NAME, NULL);
     item = gtk_action_create_tool_item(m_exitFullscreenAction);
     gtk_box_pack_start(GTK_BOX(hbox), item, FALSE, TRUE, 0);
 
-
     m_progressBarUpdateId = g_timeout_add(PROGRESS_BAR_UPDATE_INTERVAL, reinterpret_cast<GSourceFunc>(progressBarUpdateCallback), this);
+
+    playStateChanged();
 }
 
+} // namespace WebCore
 #endif
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2010 Igalia S.L
+ *  Copyright (C) 2013 Igalia S.L
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
  *  Boston, MA 02110-1301, USA.
  */
 
-#ifndef FullscreenVideoController_h
-#define FullscreenVideoController_h
+#ifndef FullscreenVideoControllerGtk_h
+#define FullscreenVideoControllerGtk_h
 
-#if ENABLE(VIDEO) && !defined(GST_API_VERSION_1)
+#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)
 
-#include "GStreamerGWorld.h"
-#include "HTMLMediaElement.h"
-#include <wtf/RefPtr.h>
-#include <wtf/gobject/GRefPtr.h>
+#include "FullscreenVideoControllerGStreamer.h"
 
-class FullscreenVideoController {
-    WTF_MAKE_NONCOPYABLE(FullscreenVideoController);
-public:
-    FullscreenVideoController();
-    virtual ~FullscreenVideoController();
+namespace WebCore {
 
-    void setMediaElement(WebCore::HTMLMediaElement*);
-    WebCore::HTMLMediaElement* mediaElement() const { return m_mediaElement.get(); }
+class FullscreenVideoControllerGtk : public FullscreenVideoControllerGStreamer {
+public:
+    FullscreenVideoControllerGtk(MediaPlayerPrivateGStreamer*);
 
-    void gtkConfigure(GdkEventConfigure* event);
+    void gtkConfigure(GdkEventConfigure*);
 
-    void enterFullscreen();
-    void exitFullscreen();
+    void playStateChanged();
 
-    void exitOnUserRequest();
-    void togglePlay();
     void beginSeek();
     void doSeek();
     void endSeek();
@@ -51,31 +42,16 @@ public:
     void showHud(bool);
     gboolean updateHudProgressBar();
 
-    float volume() const;
-    void setVolume(float);
     void volumeChanged();
     void muteChanged();
 
 private:
-    bool canPlay() const;
-    void play();
-    void pause();
-    void playStateChanged();
-
-    bool muted() const;
-
-    float currentTime() const;
-    void setCurrentTime(float);
-
-    float duration() const;
-    float percentLoaded() const;
+    void initializeWindow();
+    void destroyWindow();
 
     void createHud();
     void updateHudPosition();
 
-    RefPtr<WebCore::HTMLMediaElement> m_mediaElement;
-    RefPtr<WebCore::GStreamerGWorld> m_gstreamerGWorld;
-
     guint m_hudTimeoutId;
     guint m_progressBarUpdateId;
     guint m_progressBarFillUpdateId;
@@ -89,8 +65,20 @@ private:
     GtkWidget* m_timeHScale;
     GtkWidget* m_timeLabel;
     GtkWidget* m_volumeButton;
+
+    unsigned long m_keyPressSignalId;
+    unsigned long m_destroySignalId;
+    unsigned long m_isActiveSignalId;
+    unsigned long m_motionNotifySignalId;
+    unsigned long m_configureEventSignalId;
+    unsigned long m_hudMotionNotifySignalId;
+    unsigned long m_timeScaleButtonPressedSignalId;
+    unsigned long m_timeScaleButtonReleasedSignalId;
+    unsigned long m_playActionActivateSignalId;
+    unsigned long m_exitFullcreenActionActivateSignalId;
 };
 
+}
 #endif
 
-#endif // FullscreenVideoController_h
+#endif // FullscreenVideoControllerGtk_h
index 979aa5f..a28eba2 100644 (file)
@@ -1,3 +1,30 @@
+2013-02-01  Philippe Normand  <pnormand@igalia.com>
+
+        [GTK][GStreamer] FullscreenVideoControllerGtk implementation
+        https://bugs.webkit.org/show_bug.cgi?id=107398
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Remove the FullscreenVideoController as it moved to
+        FullscreenVideoControllerGStreamer and its Gtk subclass in
+        WebCore. Hook in NATIVE_FULLSCREEN_VIDEO in the ChromeClient in
+        the two possible scenarios, wether FULLSCREEN_API is enabled or not.
+
+        * GNUmakefile.am: Remove FullscreenVideoController.
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit):
+        (WebKit::ChromeClient::enterFullscreenForNode): Hook
+        NATIVE_FULLSCREEN_VIDEO support.
+        (WebKit::ChromeClient::exitFullscreenForNode): Ditto
+        (WebKit::ChromeClient::enterFullScreenForElement): Ditto
+        (WebKit::ChromeClient::exitFullScreenForElement): Ditto
+        * WebCoreSupport/ChromeClientGtk.h:
+        (ChromeClient):
+        * WebCoreSupport/FullscreenVideoController.cpp: Removed.
+        * WebCoreSupport/FullscreenVideoController.h: Removed.
+        * webkit/webkitwebview.cpp: Remove FullscreenVideoController support.
+        * webkit/webkitwebviewprivate.h: Ditto
+
 2013-01-31  Aurimas Liutikas  <aurimas@chromium.org>
 
         Editor::m_compositionNode not updated on HTMLInputElement::setValue()
index 8406038..f820372 100644 (file)
@@ -210,8 +210,6 @@ webkitgtk_sources += \
        Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
        Source/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.cpp \
        Source/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h \
-       Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp \
-       Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h \
        Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.cpp \
        Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.h \
        Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp \
index 14d8cdf..670f645 100644 (file)
 #include "DatabaseManager.h"
 #endif
 
+#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
+#include "HTMLMediaElement.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -896,8 +900,7 @@ PassRefPtr<WebCore::SearchPopupMenu> ChromeClient::createSearchPopupMenu(WebCore
     return adoptRef(new SearchPopupMenuGtk(client));
 }
 
-#if ENABLE(VIDEO)
-
+#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
 bool ChromeClient::supportsFullscreenForNode(const Node* node)
 {
     return node->hasTagName(HTMLNames::videoTag);
@@ -905,12 +908,28 @@ bool ChromeClient::supportsFullscreenForNode(const Node* node)
 
 void ChromeClient::enterFullscreenForNode(Node* node)
 {
-    webViewEnterFullscreen(m_webView, node);
+    if (!node)
+        return;
+
+    HTMLElement* element = static_cast<HTMLElement*>(node);
+    if (element && element->isMediaElement()) {
+        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        if (mediaElement->player() && mediaElement->player()->canEnterFullscreen())
+            mediaElement->player()->enterFullscreen();
+    }
 }
 
 void ChromeClient::exitFullscreenForNode(Node* node)
 {
-    webViewExitFullscreen(m_webView);
+    if (!node)
+        return;
+
+    HTMLElement* element = static_cast<HTMLElement*>(node);
+    if (element && element->isMediaElement()) {
+        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        if (mediaElement->player())
+            mediaElement->player()->exitFullscreen();
+    }
 }
 #endif
 
@@ -949,6 +968,19 @@ void ChromeClient::enterFullScreenForElement(WebCore::Element* element)
     if (returnValue)
         return;
 
+#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
+    if (element && element->isMediaElement()) {
+        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element);
+        if (mediaElement->player() && mediaElement->player()->canEnterFullscreen()) {
+            element->document()->webkitWillEnterFullScreenForElement(element);
+            mediaElement->player()->enterFullscreen();
+            m_fullScreenElement = element;
+            element->document()->webkitDidEnterFullScreenForElement(element);
+        }
+        return;
+    }
+#endif
+
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
     if (!widgetIsOnscreenToplevelWindow(window))
         return;
@@ -976,6 +1008,19 @@ void ChromeClient::exitFullScreenForElement(WebCore::Element*)
     if (returnValue)
         return;
 
+#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
+    if (m_fullScreenElement && m_fullScreenElement->isMediaElement()) {
+        m_fullScreenElement->document()->webkitWillExitFullScreenForElement(m_fullScreenElement.get());
+        HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(m_fullScreenElement.get());
+        if (mediaElement->player()) {
+            mediaElement->player()->exitFullscreen();
+            m_fullScreenElement->document()->webkitDidExitFullScreenForElement(m_fullScreenElement.get());
+            m_fullScreenElement.clear();
+        }
+        return;
+    }
+#endif
+
     GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(m_webView));
     ASSERT(widgetIsOnscreenToplevelWindow(window));
     g_signal_handlers_disconnect_by_func(window, reinterpret_cast<void*>(onFullscreenGtkKeyPressEvent), this);
index 1e9331c..dc2d952 100644 (file)
@@ -135,7 +135,7 @@ namespace WebKit {
         virtual bool hasOpenedPopup() const;
         virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
         virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
-#if ENABLE(VIDEO)
+#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
         virtual bool supportsFullscreenForNode(const Node*);
         virtual void enterFullscreenForNode(Node*);
         virtual void exitFullscreenForNode(Node*);
index 92b6526..8513aaf 100644 (file)
@@ -5315,34 +5315,6 @@ webkit_web_view_get_snapshot(WebKitWebView* webView)
     return surface;
 }
 
-void webViewEnterFullscreen(WebKitWebView* webView, Node* node)
-{
-    if (!node->hasTagName(HTMLNames::videoTag))
-        return;
-
-#if ENABLE(VIDEO) && !defined(GST_API_VERSION_1)
-    HTMLMediaElement* videoElement = static_cast<HTMLMediaElement*>(node);
-    WebKitWebViewPrivate* priv = webView->priv;
-
-    // First exit Fullscreen for the old mediaElement.
-    if (priv->fullscreenVideoController)
-        priv->fullscreenVideoController->exitFullscreen();
-
-    priv->fullscreenVideoController = new FullscreenVideoController;
-    priv->fullscreenVideoController->setMediaElement(videoElement);
-    priv->fullscreenVideoController->enterFullscreen();
-#endif
-}
-
-void webViewExitFullscreen(WebKitWebView* webView)
-{
-#if ENABLE(VIDEO) && !defined(GST_API_VERSION_1)
-    WebKitWebViewPrivate* priv = webView->priv;
-    if (priv->fullscreenVideoController)
-        priv->fullscreenVideoController->exitFullscreen();
-#endif
-}
-
 #if ENABLE(ICONDATABASE)
 void webkitWebViewIconLoaded(WebKitFaviconDatabase* database, const char* frameURI, WebKitWebView* webView)
 {
index 0ae522c..4665c33 100644 (file)
@@ -24,7 +24,6 @@
 #define webkitwebviewprivate_h
 
 #include "AcceleratedCompositingContext.h"
-#include "FullscreenVideoController.h"
 #include "GeolocationClientMock.h"
 #include "GtkClickCounter.h"
 #include "GtkDragAndDropHelper.h"
@@ -91,10 +90,6 @@ struct _WebKitWebViewPrivate {
 
     gboolean disposing;
 
-#if ENABLE(VIDEO) && !defined(GST_API_VERSION_1)
-    FullscreenVideoController* fullscreenVideoController;
-#endif
-
     // These are hosted here because the DataSource object is
     // created too late in the frame loading process.
     GRefPtr<WebKitWebResource> mainResource;
@@ -143,9 +138,6 @@ GList* webkit_web_view_get_subresources(WebKitWebView*);
 void webkit_web_view_set_tooltip_text(WebKitWebView*, const char*);
 GtkMenu* webkit_web_view_get_context_menu(WebKitWebView*);
 
-void webViewEnterFullscreen(WebKitWebView* webView, WebCore::Node*);
-void webViewExitFullscreen(WebKitWebView* webView);
-
 void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*);
 
 #if ENABLE(ICONDATABASE)