2011-02-07 Qi Zhang <qi.2.zhang@nokia.com>

        Reviewed by Andreas Kling.

        [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
        https://bugs.webkit.org/show_bug.cgi?id=52974

        Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.

        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):
        (WebCore::ContextMenuController::populate):
        (WebCore::ContextMenuController::checkOrEnableIfNeeded):
        * platform/ContextMenuItem.h:
        * platform/LocalizationStrategy.h:
        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagCopyImageUrlToClipboard):
        * platform/LocalizedStrings.h:
2011-02-07  Qi Zhang  <qi.2.zhang@nokia.com>

        Reviewed by Andreas Kling.

        [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
        https://bugs.webkit.org/show_bug.cgi?id=52974

        Add QWebPage::CopyImageUrlToClipboard into QWebPage::WebAction.

        * Api/qwebpage.cpp:
        (webActionForContextMenuAction):
        (QWebPage::triggerAction):
        (QWebPage::action):
        * Api/qwebpage.h:
        * WebCoreSupport/WebPlatformStrategies.cpp:
        (WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
        * WebCoreSupport/WebPlatformStrategies.h:
2011-02-07  Qi Zhang  <qi.2.zhang@nokia.com>

        Reviewed by Andreas Kling.

        [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
        https://bugs.webkit.org/show_bug.cgi?id=52974

        Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 38d5f63d
2011-02-07 Qi Zhang <qi.2.zhang@nokia.com>
Reviewed by Andreas Kling.
[Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
https://bugs.webkit.org/show_bug.cgi?id=52974
Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* platform/ContextMenuItem.h:
* platform/LocalizationStrategy.h:
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagCopyImageUrlToClipboard):
* platform/LocalizedStrings.h:
2011-02-07 Kenichi Ishibashi <bashi@chromium.org>
Reviewed by Kent Tamura.
......@@ -207,6 +207,11 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
// For now, call into the client. This is temporary!
frame->editor()->copyImage(m_hitTestResult);
break;
#if PLATFORM(QT)
case ContextMenuItemTagCopyImageUrlToClipboard:
frame->editor()->copyURL(m_hitTestResult.absoluteImageURL(), m_hitTestResult.textContent());
break;
#endif
case ContextMenuItemTagOpenMediaInNewWindow:
openNewWindow(m_hitTestResult.absoluteMediaURL(), frame);
break;
......@@ -642,6 +647,10 @@ void ContextMenuController::populate()
contextMenuItemTagDownloadImageToDisk());
ContextMenuItem CopyImageItem(ActionType, ContextMenuItemTagCopyImageToClipboard,
contextMenuItemTagCopyImageToClipboard());
#if PLATFORM(QT)
ContextMenuItem CopyImageUrlItem(ActionType, ContextMenuItemTagCopyImageUrlToClipboard,
contextMenuItemTagCopyImageUrlToClipboard());
#endif
ContextMenuItem OpenMediaInNewWindowItem(ActionType, ContextMenuItemTagOpenMediaInNewWindow, String());
ContextMenuItem CopyMediaLinkItem(ActionType, ContextMenuItemTagCopyMediaLinkToClipboard,
String());
......@@ -720,6 +729,9 @@ void ContextMenuController::populate()
appendItem(DownloadImageItem, m_contextMenu.get());
if (imageURL.isLocalFile() || m_hitTestResult.image())
appendItem(CopyImageItem, m_contextMenu.get());
#if PLATFORM(QT)
appendItem(CopyImageUrlItem, m_contextMenu.get());
#endif
}
KURL mediaURL = m_hitTestResult.absoluteMediaURL();
......@@ -1172,6 +1184,9 @@ void ContextMenuController::checkOrEnableIfNeeded(ContextMenuItem& item) const
case ContextMenuItemTagOpenImageInNewWindow:
case ContextMenuItemTagDownloadImageToDisk:
case ContextMenuItemTagCopyImageToClipboard:
#if PLATFORM(QT)
case ContextMenuItemTagCopyImageUrlToClipboard:
#endif
break;
case ContextMenuItemTagOpenMediaInNewWindow:
if (m_hitTestResult.mediaIsVideo())
......
......@@ -65,6 +65,9 @@ namespace WebCore {
ContextMenuItemTagOpenImageInNewWindow,
ContextMenuItemTagDownloadImageToDisk,
ContextMenuItemTagCopyImageToClipboard,
#if PLATFORM(QT)
ContextMenuItemTagCopyImageUrlToClipboard,
#endif
ContextMenuItemTagOpenFrameInNewWindow,
ContextMenuItemTagCopy,
ContextMenuItemTagGoBack,
......
......@@ -55,6 +55,9 @@ public:
virtual String contextMenuItemTagOpenImageInNewWindow() = 0;
virtual String contextMenuItemTagDownloadImageToDisk() = 0;
virtual String contextMenuItemTagCopyImageToClipboard() = 0;
#if PLATFORM(QT)
virtual String contextMenuItemTagCopyImageUrlToClipboard() = 0;
#endif
virtual String contextMenuItemTagOpenFrameInNewWindow() = 0;
virtual String contextMenuItemTagCopy() = 0;
virtual String contextMenuItemTagGoBack() = 0;
......
......@@ -104,6 +104,13 @@ String contextMenuItemTagCopyImageToClipboard()
return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageToClipboard();
}
#if PLATFORM(QT)
String contextMenuItemTagCopyImageUrlToClipboard()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageUrlToClipboard();
}
#endif
String contextMenuItemTagOpenFrameInNewWindow()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenFrameInNewWindow();
......
......@@ -51,6 +51,9 @@ namespace WebCore {
String contextMenuItemTagOpenImageInNewWindow();
String contextMenuItemTagDownloadImageToDisk();
String contextMenuItemTagCopyImageToClipboard();
#if PLATFORM(QT)
String contextMenuItemTagCopyImageUrlToClipboard();
#endif
String contextMenuItemTagOpenFrameInNewWindow();
String contextMenuItemTagCopy();
String contextMenuItemTagGoBack();
......
......@@ -162,6 +162,7 @@ static const char* editorCommandWebActions[] =
0, // OpenImageInNewWindow,
0, // DownloadImageToDisk,
0, // CopyImageToClipboard,
0, // CopyImageUrlToClipboard,
0, // Back,
0, // Forward,
......@@ -404,6 +405,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk;
case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard;
case WebCore::ContextMenuItemTagCopyImageUrlToClipboard: return QWebPage::CopyImageUrlToClipboard;
case WebCore::ContextMenuItemTagOpenFrameInNewWindow: return QWebPage::OpenFrameInNewWindow;
case WebCore::ContextMenuItemTagCopy: return QWebPage::Copy;
case WebCore::ContextMenuItemTagGoBack: return QWebPage::Back;
......@@ -1680,6 +1682,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
\value OpenImageInNewWindow Open the highlighted image in a new window.
\value DownloadImageToDisk Download the highlighted image to the disk.
\value CopyImageToClipboard Copy the highlighted image to the clipboard.
\value CopyImageUrlToClipboard Copy the highlighted image's URL to the clipboard.
\value Back Navigate back in the history of navigated links.
\value Forward Navigate forward in the history of navigated links.
\value Stop Stop loading the current page.
......@@ -2342,6 +2345,9 @@ void QWebPage::triggerAction(WebAction action, bool)
case CopyImageToClipboard:
QApplication::clipboard()->setPixmap(d->hitTestResult.pixmap());
break;
case CopyImageUrlToClipboard:
QApplication::clipboard()->setText(d->hitTestResult.imageUrl().toString());
break;
#endif
case Back:
d->page->goBack();
......@@ -2730,6 +2736,9 @@ QAction *QWebPage::action(WebAction action) const
case CopyImageToClipboard:
text = contextMenuItemTagCopyImageToClipboard();
break;
case CopyImageUrlToClipboard:
text = contextMenuItemTagCopyImageUrlToClipboard();
break;
case Back:
text = contextMenuItemTagGoBack();
......
......@@ -105,6 +105,7 @@ public:
OpenImageInNewWindow,
DownloadImageToDisk,
CopyImageToClipboard,
CopyImageUrlToClipboard,
Back,
Forward,
......
2011-02-07 Qi Zhang <qi.2.zhang@nokia.com>
Reviewed by Andreas Kling.
[Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
https://bugs.webkit.org/show_bug.cgi?id=52974
Add QWebPage::CopyImageUrlToClipboard into QWebPage::WebAction.
* Api/qwebpage.cpp:
(webActionForContextMenuAction):
(QWebPage::triggerAction):
(QWebPage::action):
* Api/qwebpage.h:
* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
* WebCoreSupport/WebPlatformStrategies.h:
2011-02-07 Enrica Casucci <enrica@apple.com>
Reviewed Adam Roben and Darin Adler.
......
......@@ -200,6 +200,11 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return QCoreApplication::translate("QWebPage", "Copy Image", "Copy Link context menu item");
}
String WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard()
{
return QCoreApplication::translate("QWebPage", "Copy Image Address", "Copy Image Address menu item");
}
String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
{
return QCoreApplication::translate("QWebPage", "Open Video", "Open Video in New Window");
......
......@@ -66,6 +66,7 @@ private:
virtual WTF::String contextMenuItemTagOpenImageInNewWindow();
virtual WTF::String contextMenuItemTagDownloadImageToDisk();
virtual WTF::String contextMenuItemTagCopyImageToClipboard();
virtual WTF::String contextMenuItemTagCopyImageUrlToClipboard();
virtual WTF::String contextMenuItemTagOpenFrameInNewWindow();
virtual WTF::String contextMenuItemTagCopy();
virtual WTF::String contextMenuItemTagGoBack();
......
2011-02-07 Qi Zhang <qi.2.zhang@nokia.com>
Reviewed by Andreas Kling.
[Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
https://bugs.webkit.org/show_bug.cgi?id=52974
Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2011-02-07 Enrica Casucci <enrica@apple.com>
Reviewed by Sam Weinig.
......@@ -214,6 +214,13 @@ String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
return UI_STRING("Copy Image", "Copy Image context menu item");
}
#if PLATFORM(QT)
String WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard()
{
return UI_STRING("Copy Image Address", "Copy Image Address menu item");
}
#endif
String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow()
{
return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item");
......
......@@ -68,6 +68,9 @@ private:
virtual String contextMenuItemTagOpenImageInNewWindow();
virtual String contextMenuItemTagDownloadImageToDisk();
virtual String contextMenuItemTagCopyImageToClipboard();
#if PLATFORM(QT)
virtual String contextMenuItemTagCopyImageUrlToClipboard();
#endif
virtual String contextMenuItemTagOpenFrameInNewWindow();
virtual String contextMenuItemTagCopy();
virtual String contextMenuItemTagGoBack();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment