[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

benjamin.poulain at nokia.com benjamin.poulain at nokia.com
Fri Jan 21 14:56:50 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit d5f43946c32ab18afa26fda05784172a9730b63e
Author: benjamin.poulain at nokia.com <benjamin.poulain at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 5 06:24:55 2011 +0000

    2011-01-04  Benjamin Poulain  <benjamin.poulain at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] [WK2] Add support for non-trivial context menu action
            https://bugs.webkit.org/show_bug.cgi?id=51902
    
            Fix the preprocessor guard for ContextMenuItemTagSelectAll in
            the implementation of ContextMenuController::contextMenuItemSelected(). The guard was
            inconsistent with what is defined in ContextMenuItem.h.
    
            * page/ContextMenuController.cpp:
            (WebCore::ContextMenuController::contextMenuItemSelected):
    2011-01-04  Benjamin Poulain  <benjamin.poulain at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] [WK2] Add support for non-trivial context menu action
            https://bugs.webkit.org/show_bug.cgi?id=51902
    
            Implement a call back from the QAction triggered in the UIProcess to the
            action in WebProcess.
    
            A few basic actions have been implemented based on this feature.
    
            * UIProcess/API/qt/qwkpage.cpp:
            (contextMenuActionForWebAction):
            (QWKPage::triggerAction):
            (QWKPage::action):
            * UIProcess/API/qt/qwkpage.h:
            * UIProcess/qt/WebContextMenuProxyQt.cpp:
            (WebKit::webActionForContextMenuAction):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75047 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0c3704d..48a928c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-04  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] [WK2] Add support for non-trivial context menu action
+        https://bugs.webkit.org/show_bug.cgi?id=51902
+
+        Fix the preprocessor guard for ContextMenuItemTagSelectAll in
+        the implementation of ContextMenuController::contextMenuItemSelected(). The guard was
+        inconsistent with what is defined in ContextMenuItem.h.
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::contextMenuItemSelected):
+
 2011-01-04  Tony Gentilcore  <tonyg at chromium.org>
 
         Reviewed by Ryosuke Niwa.
diff --git a/WebCore/page/ContextMenuController.cpp b/WebCore/page/ContextMenuController.cpp
index 36d880d..ac89db2 100644
--- a/WebCore/page/ContextMenuController.cpp
+++ b/WebCore/page/ContextMenuController.cpp
@@ -262,6 +262,8 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
     case ContextMenuItemTagDelete:
         frame->editor()->performDelete();
         break;
+#endif
+#if PLATFORM(GTK) || PLATFORM(QT)
     case ContextMenuItemTagSelectAll:
         frame->editor()->command("SelectAll").execute();
         break;
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index a937f64..209d29b 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-04  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] [WK2] Add support for non-trivial context menu action
+        https://bugs.webkit.org/show_bug.cgi?id=51902
+
+        Implement a call back from the QAction triggered in the UIProcess to the
+        action in WebProcess.
+
+        A few basic actions have been implemented based on this feature.
+
+        * UIProcess/API/qt/qwkpage.cpp:
+        (contextMenuActionForWebAction):
+        (QWKPage::triggerAction):
+        (QWKPage::action):
+        * UIProcess/API/qt/qwkpage.h:
+        * UIProcess/qt/WebContextMenuProxyQt.cpp:
+        (WebKit::webActionForContextMenuAction):
+
 2011-01-04  Siddharth Mathur  <siddharth.mathur at nokia.com>
 
         Reviewed by Laszlo Gombos.
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index ea7b3ab..e113bd0 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -53,6 +53,32 @@
 using namespace WebKit;
 using namespace WebCore;
 
+static WebCore::ContextMenuAction contextMenuActionForWebAction(QWKPage::WebAction action)
+{
+    switch (action) {
+    case QWKPage::OpenLink:
+        return WebCore::ContextMenuItemTagOpenLink;
+    case QWKPage::OpenLinkInNewWindow:
+        return WebCore::ContextMenuItemTagOpenLinkInNewWindow;
+    case QWKPage::CopyLinkToClipboard:
+        return WebCore::ContextMenuItemTagCopyLinkToClipboard;
+    case QWKPage::OpenImageInNewWindow:
+        return WebCore::ContextMenuItemTagOpenImageInNewWindow;
+    case QWKPage::Cut:
+        return WebCore::ContextMenuItemTagCut;
+    case QWKPage::Copy:
+        return WebCore::ContextMenuItemTagCopy;
+    case QWKPage::Paste:
+        return WebCore::ContextMenuItemTagPaste;
+    case QWKPage::SelectAll:
+        return WebCore::ContextMenuItemTagSelectAll;
+    default:
+        ASSERT(false);
+        break;
+    }
+    return WebCore::ContextMenuItemTagNoAction;
+}
+
 QWKPagePrivate::QWKPagePrivate(QWKPage* qq, QWKContext* c)
     : q(qq)
     , context(c)
@@ -556,24 +582,28 @@ void QWKPage::setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize)
 }
 
 #ifndef QT_NO_ACTION
-void QWKPage::triggerAction(WebAction action, bool)
+void QWKPage::triggerAction(WebAction webAction, bool)
 {
-    switch (action) {
+    switch (webAction) {
     case Back:
         d->page->goBack();
-        break;
+        return;
     case Forward:
         d->page->goForward();
-        break;
+        return;
     case Stop:
         d->page->stopLoading();
-        break;
+        return;
     case Reload:
         d->page->reload(/* reloadFromOrigin */ true);
-        break;
+        return;
     default:
         break;
     }
+
+    QAction* qtAction = action(webAction);
+    WebKit::WebContextMenuItemData menuItemData(ActionType, contextMenuActionForWebAction(webAction), qtAction->text(), qtAction->isEnabled(), qtAction->isChecked());
+    d->page->contextMenuItemSelected(menuItemData);
 }
 #endif // QT_NO_ACTION
 
@@ -592,6 +622,18 @@ QAction* QWKPage::action(WebAction action) const
     bool checkable = false;
 
     switch (action) {
+    case OpenLink:
+        text = contextMenuItemTagOpenLink();
+        break;
+    case OpenLinkInNewWindow:
+        text = contextMenuItemTagOpenLinkInNewWindow();
+        break;
+    case CopyLinkToClipboard:
+        text = contextMenuItemTagCopyLinkToClipboard();
+        break;
+    case OpenImageInNewWindow:
+        text = contextMenuItemTagOpenImageInNewWindow();
+        break;
     case Back:
         text = contextMenuItemTagGoBack();
         icon = style->standardIcon(QStyle::SP_ArrowBack);
@@ -608,6 +650,18 @@ QAction* QWKPage::action(WebAction action) const
         text = contextMenuItemTagReload();
         icon = style->standardIcon(QStyle::SP_BrowserReload);
         break;
+    case Cut:
+        text = contextMenuItemTagCut();
+        break;
+    case Copy:
+        text = contextMenuItemTagCopy();
+        break;
+    case Paste:
+        text = contextMenuItemTagPaste();
+        break;
+    case SelectAll:
+        text = contextMenuItemTagSelectAll();
+        break;
     default:
         return 0;
         break;
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.h b/WebKit2/UIProcess/API/qt/qwkpage.h
index 2c01f8d..554ad8e 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.h
+++ b/WebKit2/UIProcess/API/qt/qwkpage.h
@@ -28,11 +28,21 @@ public:
     enum WebAction {
         NoWebAction = - 1,
 
+        OpenLink,
+        OpenLinkInNewWindow,
+        CopyLinkToClipboard,
+        OpenImageInNewWindow,
+
         Back,
         Forward,
         Stop,
         Reload,
 
+        Cut,
+        Copy,
+        Paste,
+        SelectAll,
+
         WebActionCount
     };
 
diff --git a/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp b/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
index f05dde6..566a22e 100644
--- a/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
+++ b/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
@@ -38,6 +38,14 @@ namespace WebKit {
 static QWKPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAction action)
 {
     switch (action) {
+    case WebCore::ContextMenuItemTagOpenLink:
+        return QWKPage::OpenLink;
+    case WebCore::ContextMenuItemTagOpenLinkInNewWindow:
+        return QWKPage::OpenLinkInNewWindow;
+    case WebCore::ContextMenuItemTagCopyLinkToClipboard:
+        return QWKPage::CopyLinkToClipboard;
+    case WebCore::ContextMenuItemTagOpenImageInNewWindow:
+        return QWKPage::OpenImageInNewWindow;
     case WebCore::ContextMenuItemTagGoBack:
         return QWKPage::Back;
     case WebCore::ContextMenuItemTagGoForward:
@@ -46,6 +54,14 @@ static QWKPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuActi
         return QWKPage::Stop;
     case WebCore::ContextMenuItemTagReload:
         return QWKPage::Reload;
+    case WebCore::ContextMenuItemTagCut:
+        return QWKPage::Cut;
+    case WebCore::ContextMenuItemTagCopy:
+        return QWKPage::Copy;
+    case WebCore::ContextMenuItemTagPaste:
+        return QWKPage::Paste;
+    case WebCore::ContextMenuItemTagSelectAll:
+        return QWKPage::SelectAll;
     default:
         break;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list