pub unsafe trait WebPolicyDecisionListener: NSObjectProtocol {
// Provided methods
unsafe fn use(&self)
where Self: Sized + Message { ... }
unsafe fn download(&self)
where Self: Sized + Message { ... }
unsafe fn ignore(&self)
where Self: Sized + Message { ... }
}
WebPolicyDelegate
only.Expand description
This protocol is used to call back with the results of a policy decision. This provides the ability to make these decisions asyncrhonously, which means the decision can be made by prompting with a sheet, for example.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn use(&self)
👎Deprecated
unsafe fn use(&self)
Use the resource
If there remain more policy decisions to be made, then the next policy delegate method gets to decide. This will be either the next navigation policy delegate if there is a redirect, or the content policy delegate. If there are no more policy decisions to be made, the resource will be displayed inline if possible. If there is no view available to display the resource inline, then unableToImplementPolicyWithError:frame: will be called with an appropriate error.
If a new window is going to be created for this navigation as a result of frame targeting, then it will be created once you call this method.
Sourceunsafe fn download(&self)
👎Deprecated
unsafe fn download(&self)
Download the resource instead of displaying it.
This method is more than just a convenience because it allows an in-progress navigation to be converted to a download based on content type, without having to stop and restart the load.
Sourceunsafe fn ignore(&self)
👎Deprecated
unsafe fn ignore(&self)
Do nothing (but the client may choose to handle the request itself)
A policy of ignore prevents WebKit from doing anything further with the load, however, the client is still free to handle the request in some other way, such as opening a new window, opening a new window behind the current one, opening the URL in an external app, revealing the location in Finder if a file URL, etc.