-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UnifiedPDF] Context menu should have selection-activated items (copy…
… link, lookup, search-the-web) https://bugs.webkit.org/show_bug.cgi?id=269330 rdar://122918090 Reviewed by Tim Horton. We track text selections as of 274032@main, making it possible to perform actions on said selections. This patch introduces the context menu items that are modulated by the current selection context. Namely, we add "Copy Link", "Dictionary Lookup", and "Search the Web". The last of these items has a concrete action courtesy of 274583@main, and the other two will be implemented in upcoming commits. In doing so, we slightly refactor how we construct the context menu by breaking it up into sections corresponding to selections, scale adjustment, and display mode. * Source/WebCore/platform/LocalizedStrings.cpp: (WebCore::contextMenuItemPDFOpenWithPreview): (WebCore::contextMenuItemPDFCopy): Deleted. Remove the redundant definition since contextMenuItemTagCopy() returns the same data. * Source/WebCore/platform/LocalizedStrings.h: WEBCORE_EXPORT some more methods since they're being called from WebKit. * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h: * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm: (WebKit::UnifiedPDFPlugin::handleContextMenuEvent): (WebKit::UnifiedPDFPlugin::toContextMenuItemTag const): (WebKit::UnifiedPDFPlugin::createContextMenu const): (WebKit::UnifiedPDFPlugin::isDisplayModeContextMenuItemTag const): (WebKit::UnifiedPDFPlugin::titleForContextMenuItemTag const): (WebKit::UnifiedPDFPlugin::contextMenuItem const): (WebKit::UnifiedPDFPlugin::separatorContextMenuItem const): (WebKit::UnifiedPDFPlugin::selectionContextMenuItems const): (WebKit::UnifiedPDFPlugin::displayModeContextMenuItems const): (WebKit::UnifiedPDFPlugin::scaleContextMenuItems const): (WebKit::UnifiedPDFPlugin::performContextMenuAction): Canonical link: https://commits.webkit.org/274611@main
- Loading branch information
Showing
4 changed files
with
153 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters