-
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.
Add menu item and keyCommand support to Web Extension commands.
https://webkit.org/b/265772 rdar://problem/119111895 Reviewed by Brian Weinstein. Adds a menuItem and keyCommand property to _WKWebExtensionCommand for macOS and iOS. Also adds performCommandForEvent: and commandForEvent: to _WKWebExtensionContext for macOS. Adds a private _shortcut to _WKWebExtensionCommand for use by Safari. * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionCommand.h: * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionCommand.mm: (-[_WKWebExtensionCommand menuItem]): Added. (-[_WKWebExtensionCommand keyCommand]): Added. (-[_WKWebExtensionCommand _shortcut]): Added. (-[_WKWebExtensionCommand _matchesEvent:]): Added. * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionCommandPrivate.h: * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.h: * Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm: (-[_WKWebExtensionContext performCommandForEvent:]): Added. (-[_WKWebExtensionContext commandForEvent:]): Added. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCommandCocoa.mm: (+[_WKWebExtensionKeyCommand commandWithTitle:image:input:modifierFlags:handler:]): Added. (-[_WKWebExtensionKeyCommand copyWithZone:]): (-[_WKWebExtensionKeyCommand _resolvedTargetFromFirstTarget:]): (-[_WKWebExtensionKeyCommand _performWebExtensionKeyCommand:]): (WebKit::WebExtensionCommand::platformMenuItem const): Added. (WebKit::WebExtensionCommand::keyCommand const): Added. (WebKit::WebExtensionCommand::matchesEvent const): Added. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm: (WebKit::WebExtensionContext::performCommand): Added. (WebKit::WebExtensionContext::command): Added. (WebKit::WebExtensionContext::performMenuItem): Added. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMenuItemCocoa.mm: (-[_WKWebExtensionMenuItem initWithTitle:handler:]): (-[_WKWebExtensionMenuItem copyWithZone:]): Added. (-[_WKWebExtensionMenuItem _performAction:]): * Source/WebKit/UIProcess/Extensions/WebExtensionCommand.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Source/WebKit/UIProcess/Extensions/WebExtensionMenuItem.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPICommands.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/271532@main
- Loading branch information
Showing
12 changed files
with
537 additions
and
32 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
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
Oops, something went wrong.