-
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.
[visionOS] Add menu button to control scene dimming in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=260164 rdar://110675100 Reviewed by Wenson Hsieh. In <video> fullscreen, "Auto Dimming" will be offered as an option alongside the rest of the overflow controls menu. In element fullscreen, a new menu is added to the top left to hold the new action. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Enable fullscreen scene dimming by default. * Source/WebCore/en.lproj/Localizable.strings: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h: * Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView fullScreenWindowSceneDimmingAction]): Expose the action as a method on `WKWebView` so that the logic may be shared between <video> and element fullscreen. Use a `UIDeferredMenuElement` so that the action is initialized each time its menu is presented, and the selected state is accurately reflected. Use `UIMenuOptionsDisplayInline` in order to display a separator. * Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h: * Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showMediaControlsContextMenu:items:completionHandler:]): Augment media controls context menu logic to add support for actions that are completely handled on the UI process side. * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView additionalMediaControlsContextMenuItemsForActionSheetAssistant:]): * Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.h: * Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Add `_WKExtrinsicButtonDelegate` in order to know if/when a button is presenting a menu. If a menu is visible, the auto-hide logic needs to be prevented. (-[_WKExtrinsicButton contextMenuInteraction:willDisplayMenuForConfiguration:animator:]): (-[_WKExtrinsicButton contextMenuInteraction:willEndForConfiguration:animator:]): (-[WKFullScreenViewController initWithWebView:]): (-[WKFullScreenViewController hideUI]): (-[WKFullScreenViewController videoControlsManagerDidChange]): (-[WKFullScreenViewController loadView]): (-[WKFullScreenViewController _createButtonWithExtrinsicContentSize:]): (-[WKFullScreenViewController _wkExtrinsicButtonWillDisplayMenu:]): Cancel auto-hide when a menu is presented. (-[WKFullScreenViewController _wkExtrinsicButtonWillDismissMenu:]): Auto-hide UI when the menu is dismissed, and playback is active. (-[WKFullScreenViewController setSceneDimmed:]): Deleted. (-[WKFullScreenViewController _toggleDimmingAction:]): Deleted. * Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: * Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController prefersSceneDimming]): (-[WKFullScreenWindowController _performSpatialFullScreenTransition:completionHandler:]): Update logic to ensure dimming state is restored when exiting fullscreen, if the preference is toggled while in fullscreen. (-[WKFullScreenWindowController toggleSceneDimming]): (-[WKFullScreenWindowController _prefersSceneDimming]): Deleted. (-[WKFullScreenWindowController toggleDimming]): Deleted. Canonical link: https://commits.webkit.org/266892@main
- Loading branch information
Showing
11 changed files
with
127 additions
and
54 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
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