Repository: servo/servo
File: components/shared/embedder/lib.rs (Rust)

Code before:
}

#[derive(Deserialize, IntoStaticStr, Serialize)]
pub enum EmbedderMsg {
    /// A status message to be displayed by the browser chrome.
    Status(WebViewId, Option<String>),
    /// Alerts the embedder that the current page has changed its title.
    ChangePageTitle(WebViewId, Option<String>),
    /// Move the window to a point
    MoveTo(WebViewId, DeviceIntPoint),
    /// Resize the window to size
    ResizeTo(WebViewId, DeviceIntSize),
    /// Show the user a [simple dialog](https://html.spec.whatwg.org/multipage/#simple-dialogs) (`alert()`, `confirm()`,
    /// or `prompt()`). Since their messages are controlled by web content, they should be presented to the user in a
    /// way that makes them impossible to mistake for browser UI.
    ShowSimpleDialog(WebViewId, SimpleDialog),
    /// Request authentication for a load or navigation from the embedder.
    RequestAuthentication(
        WebViewId,
        ServoUrl,
        bool, /* for proxy */
        GenericSender<Option<AuthenticationResponse>>,
    ),
    /// Whether or not to allow a pipeline to load a url.
    AllowNavigationRequest(WebViewId, PipelineId, ServoUrl),
    /// Request to (un)register protocol handler by webpage.
    AllowProtocolHandlerRequest(
        WebViewId,
        ProtocolHandlerUpdateRegistration,
        GenericSender<AllowOrDeny>,
    ),
    /// Whether or not to allow script to open a new tab/browser
    AllowOpeningWebView(
        WebViewId,
        GenericSender<Option<(WebViewId, ViewportDetails)>>,
    ),
    /// A webview was destroyed.
    WebViewClosed(WebViewId),
    /// A webview potentially gained focus for keyboard events.
    /// If the boolean value is false, the webiew could not be focused.
    WebViewFocused(WebViewId, bool),
    /// All webviews lost focus for keyboard events.
    WebViewBlurred,
    /// Wether or not to unload a document
    AllowUnload(WebViewId, GenericSender<AllowOrDeny>),
    /// Inform embedder to clear the clipboard
    ClearClipboard(WebViewId),
    /// Gets system clipboard contents
    GetClipboardText(WebViewId, IpcSender<Result<String, String>>),
    /// Sets system clipboard contents
    SetClipboardText(WebViewId, String),

Review comment (suggestion):
Ultra nit:

```suggestion
    /// Request to (un)register protocol handler by page content.
```

Code after:
}

#[derive(Deserialize, IntoStaticStr, Serialize)]
pub enum EmbedderMsg {
    /// A status message to be displayed by the browser chrome.
    Status(WebViewId, Option<String>),
    /// Alerts the embedder that the current page has changed its title.
    ChangePageTitle(WebViewId, Option<String>),
    /// Move the window to a point
    MoveTo(WebViewId, DeviceIntPoint),
    /// Resize the window to size
    ResizeTo(WebViewId, DeviceIntSize),
    /// Show the user a [simple dialog](https://html.spec.whatwg.org/multipage/#simple-dialogs) (`alert()`, `confirm()`,
    /// or `prompt()`). Since their messages are controlled by web content, they should be presented to the user in a
    /// way that makes them impossible to mistake for browser UI.
    ShowSimpleDialog(WebViewId, SimpleDialog),
    /// Request authentication for a load or navigation from the embedder.
    RequestAuthentication(
        WebViewId,
        ServoUrl,
        bool, /* for proxy */
        GenericSender<Option<AuthenticationResponse>>,
    ),
    /// Whether or not to allow a pipeline to load a url.
    AllowNavigationRequest(WebViewId, PipelineId, ServoUrl),
    /// Request to (un)register protocol handler by page content.
    AllowProtocolHandlerRequest(
        WebViewId,
        ProtocolHandlerUpdateRegistration,
        GenericSender<AllowOrDeny>,
    ),
    /// Whether or not to allow script to open a new tab/browser
    AllowOpeningWebView(
        WebViewId,
        GenericSender<Option<(WebViewId, ViewportDetails)>>,
    ),
    /// A webview was destroyed.
    WebViewClosed(WebViewId),
    /// A webview potentially gained focus for keyboard events.
    /// If the boolean value is false, the webiew could not be focused.
    WebViewFocused(WebViewId, bool),
    /// All webviews lost focus for keyboard events.
    WebViewBlurred,
    /// Wether or not to unload a document
    AllowUnload(WebViewId, GenericSender<AllowOrDeny>),
    /// Inform embedder to clear the clipboard
    ClearClipboard(WebViewId),
    /// Gets system clipboard contents
    GetClipboardText(WebViewId, IpcSender<Result<String, String>>),
    /// Sets system clipboard contents
    SetClipboardText(WebViewId, String),