Enable Copy Image Address context menu item in the Gtk port
authorchristian@webkit.org <christian@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2011 13:18:23 +0000 (13:18 +0000)
committerchristian@webkit.org <christian@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Mar 2011 13:18:23 +0000 (13:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=55136

Reviewed by Gustavo Noronha Silva.

* page/ContextMenuController.cpp:
* platform/ContextMenuItem.h:
* platform/LocalizationStrategy.h:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/gtk/ContextMenuItemGtk.cpp:
* platform/gtk/LocalizedStringsGtk.cpp:

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

Source/WebCore/ChangeLog
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/LocalizationStrategy.h
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp
Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp

index bfbcbf1..cf232ac 100644 (file)
@@ -1,3 +1,18 @@
+2011-03-04  Christian Dywan  <christian@lanedo.com>
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Enable Copy Image Address context menu item in the Gtk port
+        https://bugs.webkit.org/show_bug.cgi?id=55136
+
+        * page/ContextMenuController.cpp:
+        * platform/ContextMenuItem.h:
+        * platform/LocalizationStrategy.h:
+        * platform/LocalizedStrings.cpp:
+        * platform/LocalizedStrings.h:
+        * platform/gtk/ContextMenuItemGtk.cpp:
+        * platform/gtk/LocalizedStringsGtk.cpp:
+
 2011-03-04  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 0e70e94..f0caaa2 100644 (file)
@@ -207,7 +207,7 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
         // For now, call into the client. This is temporary!
         frame->editor()->copyImage(m_hitTestResult);
         break;
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
     case ContextMenuItemTagCopyImageUrlToClipboard:
         frame->editor()->copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent());
         break;
@@ -647,7 +647,7 @@ void ContextMenuController::populate()
         contextMenuItemTagDownloadImageToDisk());
     ContextMenuItem CopyImageItem(ActionType, ContextMenuItemTagCopyImageToClipboard, 
         contextMenuItemTagCopyImageToClipboard());
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
     ContextMenuItem CopyImageUrlItem(ActionType, ContextMenuItemTagCopyImageUrlToClipboard, 
         contextMenuItemTagCopyImageUrlToClipboard());
 #endif
@@ -733,7 +733,7 @@ void ContextMenuController::populate()
             appendItem(DownloadImageItem, m_contextMenu.get());
             if (imageURL.isLocalFile() || m_hitTestResult.image())
                 appendItem(CopyImageItem, m_contextMenu.get());
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
             appendItem(CopyImageUrlItem, m_contextMenu.get());
 #endif
         }
@@ -1197,7 +1197,7 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
         case ContextMenuItemTagOpenImageInNewWindow:
         case ContextMenuItemTagDownloadImageToDisk:
         case ContextMenuItemTagCopyImageToClipboard:
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
         case ContextMenuItemTagCopyImageUrlToClipboard:
 #endif
             break;
index 6595711..46a6987 100644 (file)
@@ -65,7 +65,7 @@ namespace WebCore {
         ContextMenuItemTagOpenImageInNewWindow,
         ContextMenuItemTagDownloadImageToDisk,
         ContextMenuItemTagCopyImageToClipboard,
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
         ContextMenuItemTagCopyImageUrlToClipboard,
 #endif
         ContextMenuItemTagOpenFrameInNewWindow,
index af2e62f..eba0e7c 100644 (file)
@@ -56,7 +56,7 @@ public:
     virtual String contextMenuItemTagOpenImageInNewWindow() = 0;
     virtual String contextMenuItemTagDownloadImageToDisk() = 0;
     virtual String contextMenuItemTagCopyImageToClipboard() = 0;
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
     virtual String contextMenuItemTagCopyImageUrlToClipboard() = 0;
 #endif
     virtual String contextMenuItemTagOpenFrameInNewWindow() = 0;
index 664ad7e..9656dbe 100644 (file)
@@ -109,7 +109,7 @@ String contextMenuItemTagCopyImageToClipboard()
     return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageToClipboard();
 }
 
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
 String contextMenuItemTagCopyImageUrlToClipboard()
 {
     return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageUrlToClipboard();
index 7ef301c..f22c975 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
     String contextMenuItemTagOpenImageInNewWindow();
     String contextMenuItemTagDownloadImageToDisk();
     String contextMenuItemTagCopyImageToClipboard();
-#if PLATFORM(QT)
+#if PLATFORM(QT) || PLATFORM(GTK)
     String contextMenuItemTagCopyImageUrlToClipboard();
 #endif
     String contextMenuItemTagOpenFrameInNewWindow();
index fee7a14..bdd3962 100644 (file)
@@ -107,6 +107,7 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
         return GTK_STOCK_SELECT_COLOR;
     case ContextMenuItemTagToggleMediaControls:
     case ContextMenuItemTagToggleMediaLoop:
+    case ContextMenuItemTagCopyImageUrlToClipboard:
         // No icon for this.
         return 0;
     case ContextMenuItemTagEnterVideoFullscreen:
index 1bf9a44..eab0ac6 100644 (file)
@@ -116,6 +116,11 @@ String contextMenuItemTagCopyImageToClipboard()
     return String::fromUTF8(_("Cop_y Image"));
 }
 
+String contextMenuItemTagCopyImageUrlToClipboard()
+{
+    return String::fromUTF8(_("Copy Image _Address"));
+}
+
 String contextMenuItemTagOpenVideoInNewWindow()
 {
     return String::fromUTF8(_("Open _Video in New Window"));