[webkit-changes] [WebKit/WebKit] eaff76: Add a hasUnreadBadgeText property to _WKWebExtensi...

Timothy Hatcher noreply at github.com
Wed Jan 24 18:38:31 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: eaff760b4a9ea37d5bbf33fd6d8f775b4c845135
      https://github.com/WebKit/WebKit/commit/eaff760b4a9ea37d5bbf33fd6d8f775b4c845135
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-01-24 (Wed, 24 Jan 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionAction.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionAction.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionAction.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm

  Log Message:
  -----------
  Add a hasUnreadBadgeText property to _WKWebExtensionAction.
https://webkit.org/b/268014
rdar://problem/121536115

Reviewed by Brian Weinstein.

This property is automatically set to `YES` when `badgeText` changes and is not empty.
If `badgeText` becomes empty or the popup associated with the action is presented, this
property is automatically set to `NO`. Additionally, it should be set to `NO` by the app
when the badge has been presented to the user. This property is useful for higher-level
notification badges when extensions might be hidden behind an action sheet.

* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionAction.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionAction.mm:
(-[_WKWebExtensionAction hasUnreadBadgeText]): Added.
(-[_WKWebExtensionAction setHasUnreadBadgeText:]): Added.
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm:
(WebKit::WebExtensionAction::readyToPresentPopup):
(WebKit::WebExtensionAction::setBadgeText):
(WebKit::WebExtensionAction::hasUnreadBadgeText const): Added.
(WebKit::WebExtensionAction::setHasUnreadBadgeText): Added.
(WebKit::WebExtensionAction::incrementBlockedResourceCount):
* Source/WebKit/UIProcess/Extensions/WebExtensionAction.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm:
(TestWebKitAPI::TEST): Added new tests.

Canonical link: https://commits.webkit.org/273458@main




More information about the webkit-changes mailing list