Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: aa35126f4291babb0cac50a4a3683dd5cfbc33b0
https://github.com/WebKit/WebKit/commit/aa35126f4291babb0cac50a4a3683dd5cfbc33b0
Author: Ari Young <[email protected]>
Date: 2024-08-28 (Wed, 28 Aug 2024)
Changed paths:
M Source/WebKit/Modules/OSX_Private.modulemap
M Source/WebKit/Modules/iOS_Private.modulemap
M Source/WebKit/Shared/Cocoa/APIObject.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtension.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionContext.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionContextPrivate.h
M
Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionControllerDelegatePrivate.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionPrivate.h
A Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebar.h
A Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebar.mm
A Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebarInternal.h
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionSidebarCocoa.mm
M Source/WebKit/UIProcess/Extensions/WebExtension.h
M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
M Source/WebKit/UIProcess/Extensions/WebExtensionSidebar.h
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
Log Message:
-----------
Initial implementation of WebExtensionSidebar external API
https://webkit.org/b/277575
rdar://133073385
Reviewed by Timothy Hatcher.
This patch introduces an initial external API for the
WebExtensionSidebar object.
* Source/WebKit/Modules/OSX_Private.modulemap: Add
_WKWebExtensionSidebar module
* Source/WebKit/Modules/iOS_Private.modulemap: Add
_WKWebExtensionSidebar module
* Source/WebKit/Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Add case for Type::WebExtensionSidebar which
allocates a new _WKWebExtensionSidebar object
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionContext.mm:
(-[WKWebExtensionContext sidebarForTab:]): Added method implementation
to retrieve the sidebar for the given tab from the appropriate
WebExtensionContext
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionContextPrivate.h: Add
prototype for [WKWebExtensionContext sidebarForTab:]
* Source/WebKit/UIProcess/API/Cocoa/WKWebExtensionControllerDelegatePrivate.h:
Add _webExtensionController presentSidebar to
WKWebExtensionControllerDelegatePrivate protocol.
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebar.h: Added.
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebar.mm: Added.
(-[_WKWebExtensionSidebar webExtensionContext]): External getter for a
sidebar's context
(-[_WKWebExtensionSidebar title]): External getter for a sidebar's title
(-[_WKWebExtensionSidebar iconForSize:]): External getter for a
sidebar's icon
(-[_WKWebExtensionSidebar isEnabled]): External getter for a sidebar's
enablement state
(-[_WKWebExtensionSidebar webView]): External getter for a sidebar's web
view
(-[_WKWebExtensionSidebar willOpenSidebar]): Method to indicate the
sidebar will be opened
(-[_WKWebExtensionSidebar willCloseSidebar]): Method to indicate the
sidebar will be closed
(-[_WKWebExtensionSidebar associatedTab]): External getter for a
sidebar's tab
(-[_WKWebExtensionSidebar _apiObject]): Internal getter for the
sidebar's implementation object as a API::Object
(-[_WKWebExtensionSidebar _webExtensionSidebar]): Internal getter for
the sidebar's implementation object
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionSidebarInternal.h:
Added
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionCocoa.mm:
(WebKit::WebExtension::hasSidebar): Utility method to check if the
extension uses either sidebar API
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionSidebarCocoa.mm:
(toOptionalRef): Utility method to convert a RefPtr<T> to a
std::optional<Ref<T>>
(-[_WKWebExtensionSidebarWebViewDelegate initWithWebExtensionSidebar:]):
Initializer
(-[_WKWebExtensionSidebarWebViewDelegate
webView:decidePolicyForNavigationAction:decisionHandler:]):
Delegate method implementation which handles deciding the navigation
policy for navigation actions within a sidebar's WKWebView
(WebKit::WebExtensionSidebar::setTitle): Notify delegate of title change
when necessary
(WebKit::WebExtensionSidebar::setSidebarPath): Notify delegate of
webView change when necessary
(WebKit::WebExtensionSidebar::willOpenSidebar): Assert that this sidebar
(or parent) has a web view
(WebKit::WebExtensionSidebar::willCloseSidebar): If this sidebar is a
tab-specific sidebar, and if this sidebar has its own web view, set the
web view to nil
(WebKit::WebExtensionSidebar::reloadWebView): Helper method to load the
current sidebar path in the sidebar's web view, if present
(WebKit::WebExtensionSidebar::webView): Use parent web view if no path
is set, properly configure web view before returning
(WebKit::WebExtensionSidebar::webViewWasUpdated): Helper method to
notify delegate to re-query this sidebar's web view
* Source/WebKit/UIProcess/Extensions/WebExtension.h: Add prototype for
hasSidebar
* Source/WebKit/UIProcess/Extensions/WebExtensionSidebar.h: Add wrapper
method, sidebar API wrapper prototypes, add declarations for
willOpenSidebar and willCloseSidebar
(WebKit::WebExtensionSidebar::wrapper const): Added
* Source/WebKit/WebKit.xcodeproj/project.pbxproj: Add new files to
project
Canonical link: https://commits.webkit.org/282878@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes