Bug 1611451 - Add some missing javadoc to WebNotification r=geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D64473

--HG--
extra : moz-landing-system : lando
This commit is contained in:
James Willcox 2020-02-27 00:28:30 +00:00
parent 24ee45a807
commit 58e61e1089

View File

@ -8,6 +8,11 @@ import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.util.ThreadUtils;
/**
* This class represents a single <a href="https://developer.mozilla.org/en-US/docs/Web/API/Notification">Web Notification</a>.
* These can be received by connecting a {@link WebNotificationDelegate} to
* {@link GeckoRuntime} via {@link GeckoRuntime#setWebNotificationDelegate(WebNotificationDelegate)}.
*/
public class WebNotification {
/**
@ -84,6 +89,11 @@ public class WebNotification {
this.requireInteraction = requireInteraction;
}
/**
* This should be called when the user taps or clicks a notification. Note that this
* does not automatically dismiss the notification as far as Web Content is concerned.
* For that, see {@link #dismiss()}.
*/
@UiThread
public void click() {
ThreadUtils.assertOnUiThread();
@ -91,6 +101,11 @@ public class WebNotification {
}
/**
* This should be called when the app stops showing the notification. This is
* important, as there may be a limit to the number of active notifications each site
* can display.
*/
@UiThread
public void dismiss() {
ThreadUtils.assertOnUiThread();