Package org.mozilla.geckoview
Class GeckoSession.PermissionDelegate.ContentPermission
Object
org.mozilla.geckoview.GeckoSession.PermissionDelegate.ContentPermission
- Enclosing interface:
- GeckoSession.PermissionDelegate
Represents a content permission -- including the type of permission, the present value of the
permission, the URL the permission pertains to, and other information.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
The context ID associated with the permission if any.final int
The type of this permission; one ofPERMISSION_*
.final boolean
A boolean indicating whether this content permission is associated with private browsing.final String
The third party origin associated with the request; currently only used for storage access permission.final String
The URI associated with this content permission.final int
The value of the permission; one ofVALUE_
.static final int
The corresponding permission is currently set to allow.static final int
The corresponding permission is currently set to deny.static final int
The corresponding permission is currently set to default/prompt behavior. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromJson
(JSONObject perm) Converts a JSONObject to a ContentPermission -- should only be used on the output oftoJson()
.toJson()
Converts a ContentPermission to a JSONObject that can be converted back to a ContentPermission byfromJson(JSONObject)
.
-
Field Details
-
VALUE_PROMPT
public static final int VALUE_PROMPTThe corresponding permission is currently set to default/prompt behavior.- See Also:
-
VALUE_DENY
public static final int VALUE_DENYThe corresponding permission is currently set to deny.- See Also:
-
VALUE_ALLOW
public static final int VALUE_ALLOWThe corresponding permission is currently set to allow.- See Also:
-
uri
The URI associated with this content permission. -
thirdPartyOrigin
The third party origin associated with the request; currently only used for storage access permission. -
privateMode
public final boolean privateModeA boolean indicating whether this content permission is associated with private browsing. -
permission
public final int permissionThe type of this permission; one ofPERMISSION_*
. -
value
public final int valueThe value of the permission; one ofVALUE_
. -
contextId
The context ID associated with the permission if any.
-
-
Constructor Details
-
ContentPermission
protected ContentPermission()
-
-
Method Details
-
fromJson
@AnyThread @Nullable public static GeckoSession.PermissionDelegate.ContentPermission fromJson(@NonNull JSONObject perm) Converts a JSONObject to a ContentPermission -- should only be used on the output oftoJson()
.- Parameters:
perm
- A JSONObject representing a ContentPermission, output bytoJson()
.- Returns:
- The corresponding ContentPermission.
-
toJson
Converts a ContentPermission to a JSONObject that can be converted back to a ContentPermission byfromJson(JSONObject)
.- Returns:
- A JSONObject representing this ContentPermission. Modifying any of the fields may result in undefined behavior when converted back to a ContentPermission and used.
- Throws:
JSONException
- if the conversion fails for any reason.
-