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
Nested ClassesModifier and TypeClassDescriptionstatic @interfacePermission value type definitions for permission states. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe context ID associated with the permission if any.final intThe type of this permission; one ofPERMISSION_*.final booleanA boolean indicating whether this content permission is associated with private browsing.final StringThe third party origin associated with the request; currently only used for storage access permission.final StringThe URI associated with this content permission.final intThe value of the permission; one ofVALUE_.static final intThe corresponding permission is currently set to allow.static final intThe corresponding permission is currently set to deny.static final intThe corresponding permission is currently set to default/prompt behavior. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for ContentPermission. -
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()Default constructor for ContentPermission. Initializes all fields to their default values.
-
-
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.
-