Changeset 75047 in webkit
- Timestamp:
- Jan 4, 2011 10:24:55 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r75045 r75047 1 2011-01-04 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] [WK2] Add support for non-trivial context menu action 6 https://bugs.webkit.org/show_bug.cgi?id=51902 7 8 Fix the preprocessor guard for ContextMenuItemTagSelectAll in 9 the implementation of ContextMenuController::contextMenuItemSelected(). The guard was 10 inconsistent with what is defined in ContextMenuItem.h. 11 12 * page/ContextMenuController.cpp: 13 (WebCore::ContextMenuController::contextMenuItemSelected): 14 1 15 2011-01-04 Tony Gentilcore <tonyg@chromium.org> 2 16 -
trunk/WebCore/page/ContextMenuController.cpp
r74941 r75047 263 263 frame->editor()->performDelete(); 264 264 break; 265 #endif 266 #if PLATFORM(GTK) || PLATFORM(QT) 265 267 case ContextMenuItemTagSelectAll: 266 268 frame->editor()->command("SelectAll").execute(); -
trunk/WebKit2/ChangeLog
r75046 r75047 1 2011-01-04 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] [WK2] Add support for non-trivial context menu action 6 https://bugs.webkit.org/show_bug.cgi?id=51902 7 8 Implement a call back from the QAction triggered in the UIProcess to the 9 action in WebProcess. 10 11 A few basic actions have been implemented based on this feature. 12 13 * UIProcess/API/qt/qwkpage.cpp: 14 (contextMenuActionForWebAction): 15 (QWKPage::triggerAction): 16 (QWKPage::action): 17 * UIProcess/API/qt/qwkpage.h: 18 * UIProcess/qt/WebContextMenuProxyQt.cpp: 19 (WebKit::webActionForContextMenuAction): 20 1 21 2011-01-04 Siddharth Mathur <siddharth.mathur@nokia.com> 2 22 -
trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp
r74964 r75047 53 53 using namespace WebKit; 54 54 using namespace WebCore; 55 56 static WebCore::ContextMenuAction contextMenuActionForWebAction(QWKPage::WebAction action) 57 { 58 switch (action) { 59 case QWKPage::OpenLink: 60 return WebCore::ContextMenuItemTagOpenLink; 61 case QWKPage::OpenLinkInNewWindow: 62 return WebCore::ContextMenuItemTagOpenLinkInNewWindow; 63 case QWKPage::CopyLinkToClipboard: 64 return WebCore::ContextMenuItemTagCopyLinkToClipboard; 65 case QWKPage::OpenImageInNewWindow: 66 return WebCore::ContextMenuItemTagOpenImageInNewWindow; 67 case QWKPage::Cut: 68 return WebCore::ContextMenuItemTagCut; 69 case QWKPage::Copy: 70 return WebCore::ContextMenuItemTagCopy; 71 case QWKPage::Paste: 72 return WebCore::ContextMenuItemTagPaste; 73 case QWKPage::SelectAll: 74 return WebCore::ContextMenuItemTagSelectAll; 75 default: 76 ASSERT(false); 77 break; 78 } 79 return WebCore::ContextMenuItemTagNoAction; 80 } 55 81 56 82 QWKPagePrivate::QWKPagePrivate(QWKPage* qq, QWKContext* c) … … 557 583 558 584 #ifndef QT_NO_ACTION 559 void QWKPage::triggerAction(WebAction action, bool)560 { 561 switch ( action) {585 void QWKPage::triggerAction(WebAction webAction, bool) 586 { 587 switch (webAction) { 562 588 case Back: 563 589 d->page->goBack(); 564 break;590 return; 565 591 case Forward: 566 592 d->page->goForward(); 567 break;593 return; 568 594 case Stop: 569 595 d->page->stopLoading(); 570 break;596 return; 571 597 case Reload: 572 598 d->page->reload(/* reloadFromOrigin */ true); 573 break;599 return; 574 600 default: 575 601 break; 576 602 } 603 604 QAction* qtAction = action(webAction); 605 WebKit::WebContextMenuItemData menuItemData(ActionType, contextMenuActionForWebAction(webAction), qtAction->text(), qtAction->isEnabled(), qtAction->isChecked()); 606 d->page->contextMenuItemSelected(menuItemData); 577 607 } 578 608 #endif // QT_NO_ACTION … … 593 623 594 624 switch (action) { 625 case OpenLink: 626 text = contextMenuItemTagOpenLink(); 627 break; 628 case OpenLinkInNewWindow: 629 text = contextMenuItemTagOpenLinkInNewWindow(); 630 break; 631 case CopyLinkToClipboard: 632 text = contextMenuItemTagCopyLinkToClipboard(); 633 break; 634 case OpenImageInNewWindow: 635 text = contextMenuItemTagOpenImageInNewWindow(); 636 break; 595 637 case Back: 596 638 text = contextMenuItemTagGoBack(); … … 608 650 text = contextMenuItemTagReload(); 609 651 icon = style->standardIcon(QStyle::SP_BrowserReload); 652 break; 653 case Cut: 654 text = contextMenuItemTagCut(); 655 break; 656 case Copy: 657 text = contextMenuItemTagCopy(); 658 break; 659 case Paste: 660 text = contextMenuItemTagPaste(); 661 break; 662 case SelectAll: 663 text = contextMenuItemTagSelectAll(); 610 664 break; 611 665 default: -
trunk/WebKit2/UIProcess/API/qt/qwkpage.h
r74964 r75047 29 29 NoWebAction = - 1, 30 30 31 OpenLink, 32 OpenLinkInNewWindow, 33 CopyLinkToClipboard, 34 OpenImageInNewWindow, 35 31 36 Back, 32 37 Forward, 33 38 Stop, 34 39 Reload, 40 41 Cut, 42 Copy, 43 Paste, 44 SelectAll, 35 45 36 46 WebActionCount -
trunk/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp
r74964 r75047 39 39 { 40 40 switch (action) { 41 case WebCore::ContextMenuItemTagOpenLink: 42 return QWKPage::OpenLink; 43 case WebCore::ContextMenuItemTagOpenLinkInNewWindow: 44 return QWKPage::OpenLinkInNewWindow; 45 case WebCore::ContextMenuItemTagCopyLinkToClipboard: 46 return QWKPage::CopyLinkToClipboard; 47 case WebCore::ContextMenuItemTagOpenImageInNewWindow: 48 return QWKPage::OpenImageInNewWindow; 41 49 case WebCore::ContextMenuItemTagGoBack: 42 50 return QWKPage::Back; … … 47 55 case WebCore::ContextMenuItemTagReload: 48 56 return QWKPage::Reload; 57 case WebCore::ContextMenuItemTagCut: 58 return QWKPage::Cut; 59 case WebCore::ContextMenuItemTagCopy: 60 return QWKPage::Copy; 61 case WebCore::ContextMenuItemTagPaste: 62 return QWKPage::Paste; 63 case WebCore::ContextMenuItemTagSelectAll: 64 return QWKPage::SelectAll; 49 65 default: 50 66 break;
Note: See TracChangeset
for help on using the changeset viewer.