2010-09-20 Philippe Normand <pnormand@igalia.com>
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2010 06:54:09 +0000 (06:54 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Sep 2010 06:54:09 +0000 (06:54 +0000)
commitbad61d8c48f9d5db50e74b041d16bce4df16f1cb
treed05807c2fd33e5dc960096e715008ca53c477fa5
parent65c9ef527ad350a61a13d27cea5779539874c398
2010-09-20  Philippe Normand  <pnormand@igalia.com>

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New items in the media Element context menu:
        - play/pause
        - mute/unmute
        - controls display control
        - switch to fullscreen (for video only)
        - loop playback control
        - copy media url to clipboard
        - open in new window

        Test: media/context-menu-actions.html

        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):
        * platform/ContextMenu.cpp:
        (WebCore::ContextMenu::populate):
        (WebCore::ContextMenu::checkOrEnableIfNeeded):
        * platform/ContextMenuItem.h:
        * platform/LocalizationStrategy.h:
        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/LocalizedStrings.h:
        * platform/android/LocalizedStringsAndroid.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/brew/LocalizedStringsBrew.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/efl/LocalizedStringsEfl.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/gtk/ContextMenuItemGtk.cpp:
        (WebCore::gtkStockIDFromContextMenuAction):
        * platform/gtk/LocalizedStringsGtk.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/haiku/LocalizedStringsHaiku.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * platform/wx/LocalizedStringsWx.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::absoluteMediaURL):
        (WebCore::HitTestResult::mediaSupportsFullscreen):
        (WebCore::HitTestResult::mediaElement):
        (WebCore::HitTestResult::toggleMediaControlsDisplay):
        (WebCore::HitTestResult::toggleMediaLoopPlayback):
        (WebCore::HitTestResult::enterFullscreenForVideo):
        (WebCore::HitTestResult::mediaControlsEnabled):
        (WebCore::HitTestResult::mediaLoopEnabled):
        (WebCore::HitTestResult::mediaPlaying):
        (WebCore::HitTestResult::toggleMediaPlayState):
        (WebCore::HitTestResult::mediaHasAudio):
        (WebCore::HitTestResult::mediaMuted):
        (WebCore::HitTestResult::toggleMediaMuteState):
        * rendering/HitTestResult.h:

LayoutTests:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New test checking the actions that can be triggered by activating
        the contex-menu of the media element. Skipped on mac, qt and win
        because of lack of DRT support.

        * media/context-menu-actions-expected.txt: Added.
        * media/context-menu-actions.html: Added.
        * platform/mac/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:

WebKit:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        Updated localizable strings.

        * English.lproj/Localizable.strings:

WebKit/chromium:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New localized strings for the media element context-menu.

        * src/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagOpenVideoInNewWindow):
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):
        (WebCore::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebCore::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebCore::contextMenuItemTagToggleMediaControls):
        (WebCore::contextMenuItemTagToggleMediaLoop):
        (WebCore::contextMenuItemTagEnterVideoFullscreen):
        (WebCore::contextMenuItemTagMediaPlay):
        (WebCore::contextMenuItemTagMediaPause):
        (WebCore::contextMenuItemTagMediaMute):

WebKit/mac:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New localized strings for the media element context-menu.

        * WebCoreSupport/WebPlatformStrategies.h:
        * WebCoreSupport/WebPlatformStrategies.mm:
        (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
        (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
        (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
        (WebPlatformStrategies::contextMenuItemTagMediaPlay):
        (WebPlatformStrategies::contextMenuItemTagMediaPause):
        (WebPlatformStrategies::contextMenuItemTagMediaMute):

Webkit/qt:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        * WebCoreSupport/WebPlatformStrategies.cpp:
        * WebCoreSupport/WebPlatformStrategies.h:
        (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagToggleMediaControls)
        (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop)
        (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen)
        (WebPlatformStrategies::contextMenuItemTagMediaPlay)
        (WebPlatformStrategies::contextMenuItemTagMediaPause)
        (WebPlatformStrategies::contextMenuItemTagMediaMute)

WebKit/win:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New localized strings for the media element context-menu.

        * WebCoreSupport/WebPlatformStrategies.cpp:
        (WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
        (WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
        (WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
        (WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
        (WebPlatformStrategies::contextMenuItemTagMediaPlay):
        (WebPlatformStrategies::contextMenuItemTagMediaPause):
        (WebPlatformStrategies::contextMenuItemTagMediaMute):
        * WebCoreSupport/WebPlatformStrategies.h:

WebKit2:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        New localized strings for the media element context-menu.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow):
        (WebKit::WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow):
        (WebKit::WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard):
        (WebKit::WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard):
        (WebKit::WebPlatformStrategies::contextMenuItemTagToggleMediaControls):
        (WebKit::WebPlatformStrategies::contextMenuItemTagToggleMediaLoop):
        (WebKit::WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen):
        (WebKit::WebPlatformStrategies::contextMenuItemTagMediaPlay):
        (WebKit::WebPlatformStrategies::contextMenuItemTagMediaPause):
        (WebKit::WebPlatformStrategies::contextMenuItemTagMediaMute):
        (WebKit::WebPlatformStrategies::contextMenuItemTagMediaUnMute):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

WebKitTools:

        Reviewed by Eric Carlson.

        [GTK] enhanced context menu for media elements
        https://bugs.webkit.org/show_bug.cgi?id=45021

        EventSender::contextClick() now returns an array of js
        objects. Each object has a title property and a click() method.

        * DumpRenderTree/gtk/EventSender.cpp:
        (getMenuItemTitleCallback):
        (setMenuItemTitleCallback):
        (menuItemClickCallback):
        (getMenuItemClass):
        (contextClickCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@67928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
LayoutTests/ChangeLog
LayoutTests/media/context-menu-actions-expected.txt [new file with mode: 0644]
LayoutTests/media/context-menu-actions.html [new file with mode: 0644]
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/page/ContextMenuController.cpp
WebCore/platform/ContextMenu.cpp
WebCore/platform/ContextMenuItem.h
WebCore/platform/LocalizationStrategy.h
WebCore/platform/LocalizedStrings.cpp
WebCore/platform/LocalizedStrings.h
WebCore/platform/android/LocalizedStringsAndroid.cpp
WebCore/platform/brew/LocalizedStringsBrew.cpp
WebCore/platform/efl/LocalizedStringsEfl.cpp
WebCore/platform/gtk/ContextMenuItemGtk.cpp
WebCore/platform/gtk/LocalizedStringsGtk.cpp
WebCore/platform/haiku/LocalizedStringsHaiku.cpp
WebCore/platform/wx/LocalizedStringsWx.cpp
WebCore/rendering/HitTestResult.cpp
WebCore/rendering/HitTestResult.h
WebKit/ChangeLog
WebKit/English.lproj/Localizable.strings
WebKit/chromium/ChangeLog
WebKit/chromium/src/LocalizedStrings.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
WebKit/win/WebCoreSupport/WebPlatformStrategies.h
WebKit2/ChangeLog
WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/EventSender.cpp