Bug 1533057 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Here's a proposed API. Initially I was thinking we'd have a `WebNotifierController` or similar class, but it's probably fine to just put it on the `GeckoRuntime` directly. It does seem like this could get out of hand at some point, though.

```
class GeckoRuntime {
    void setWebNotificationDelegate(WebNotificationDelegate delegate);
}

interface WebNotificationDelegate {
   void onShowNotification(WebNotification notification);
   void onCloseNotification(WebNotification notification);
}

class WebNotification {
    public String title;
    public String text;
    /* other data members as required */

    public void click();
    public void dismiss();
}

```
Here's a proposed API. Initially I was thinking we'd have a `WebNotifierController` or similar class, but it's probably fine to just put the delegate on the `GeckoRuntime` directly. It does seem like this could get out of hand at some point, though.

```
class GeckoRuntime {
    void setWebNotificationDelegate(WebNotificationDelegate delegate);
}

interface WebNotificationDelegate {
   void onShowNotification(WebNotification notification);
   void onCloseNotification(WebNotification notification);
}

class WebNotification {
    public String title;
    public String text;
    /* other data members as required */

    public void click();
    public void dismiss();
}

```

Back to Bug 1533057 Comment 5