Title: [154987] trunk/Source/WebKit2
Revision
154987
Author
commit-qu...@webkit.org
Date
2013-09-03 09:51:03 -0700 (Tue, 03 Sep 2013)

Log Message

[GTK] [WK2] TestContextMenu default-menu fails
https://bugs.webkit.org/show_bug.cgi?id=120459

Patch by Brian Holt <brian.h...@samsung.com> on 2013-09-03
Reviewed by Gustavo Noronha Silva.

Add context menu items for downloading media elements.

* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetActionTag):
(webkitContextMenuActionGetForContextMenuItem):
(webkitContextMenuActionGetLabel):
* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/tests/TestContextMenu.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (154986 => 154987)


--- trunk/Source/WebKit2/ChangeLog	2013-09-03 16:39:29 UTC (rev 154986)
+++ trunk/Source/WebKit2/ChangeLog	2013-09-03 16:51:03 UTC (rev 154987)
@@ -1,3 +1,19 @@
+2013-09-03  Brian Holt  <brian.h...@samsung.com>
+
+        [GTK] [WK2] TestContextMenu default-menu fails
+        https://bugs.webkit.org/show_bug.cgi?id=120459
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Add context menu items for downloading media elements.
+
+        * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
+        (webkitContextMenuActionGetActionTag):
+        (webkitContextMenuActionGetForContextMenuItem):
+        (webkitContextMenuActionGetLabel):
+        * UIProcess/API/gtk/WebKitContextMenuActions.h:
+        * UIProcess/API/gtk/tests/TestContextMenu.cpp:
+
 2013-09-02  Darin Adler  <da...@apple.com>
 
         Cut down on double hashing and code needlessly using hash table iterators

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp (154986 => 154987)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp	2013-09-03 16:39:29 UTC (rev 154986)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp	2013-09-03 16:51:03 UTC (rev 154987)
@@ -123,6 +123,9 @@
         return ContextMenuItemTagMediaPlayPause;
     case WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE:
         return ContextMenuItemTagMediaMute;
+    case WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK:
+    case WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK:
+        return ContextMenuItemTagDownloadMediaToDisk;
     case WEBKIT_CONTEXT_MENU_ACTION_CUSTOM:
         return ContextMenuItemBaseApplicationTag;
     default:
@@ -214,6 +217,9 @@
             WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY : WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE;
     case ContextMenuItemTagMediaMute:
         return WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE;
+    case ContextMenuItemTagDownloadMediaToDisk:
+        return menuItem->title() == contextMenuItemTagDownloadVideoToDisk() ?
+            WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK : WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK;
     case ContextMenuItemBaseApplicationTag:
         return WEBKIT_CONTEXT_MENU_ACTION_CUSTOM;
     default:
@@ -306,6 +312,10 @@
         return contextMenuItemTagMediaPause();
     case WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE:
         return contextMenuItemTagMediaMute();
+    case WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK:
+        return contextMenuItemTagDownloadVideoToDisk();
+    case WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK:
+        return contextMenuItemTagDownloadAudioToDisk();
     case WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION:
     case WEBKIT_CONTEXT_MENU_ACTION_CUSTOM:
     case WEBKIT_CONTEXT_MENU_ACTION_SPELLING_GUESS:

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h (154986 => 154987)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h	2013-09-03 16:39:29 UTC (rev 154986)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.h	2013-09-03 16:51:03 UTC (rev 154987)
@@ -72,6 +72,8 @@
  * @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY: Play current media element.
  * @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE: Pause current media element.
  * @WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE: Mute current media element.
+ * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK: Download video to disk.
+ * @WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK: Download audio to disk.
  * @WEBKIT_CONTEXT_MENU_ACTION_CUSTOM: Custom action defined by applications.
  *
  * Enum values used to denote the stock actions for
@@ -121,6 +123,8 @@
     WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY,
     WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PAUSE,
     WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE,
+    WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK,
+    WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK,
 
     WEBKIT_CONTEXT_MENU_ACTION_CUSTOM = 10000
 } WebKitContextMenuAction;

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp (154986 => 154987)


--- trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp	2013-09-03 16:39:29 UTC (rev 154986)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestContextMenu.cpp	2013-09-03 16:51:03 UTC (rev 154987)
@@ -309,6 +309,7 @@
             iter = checkCurrentItemIsSeparatorAndGetNext(iter);
             iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_VIDEO_LINK_TO_CLIPBOARD, Visible | Enabled);
             iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_VIDEO_IN_NEW_WINDOW, Visible | Enabled);
+            iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK, Visible | Enabled);
             break;
         case Editable:
             g_assert(!webkit_hit_test_result_context_is_link(hitTestResult));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to