зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1834576 - Update googleJavaFormat to version 1.17.0. r=geckoview-reviewers,calu
Depends on D178820 Differential Revision: https://phabricator.services.mozilla.com/D178821
This commit is contained in:
Родитель
0a9582c550
Коммит
7d276a8c4b
|
@ -360,7 +360,7 @@ subprojects {
|
|||
include '**/*.java'
|
||||
exclude '**/thirdparty/**'
|
||||
}
|
||||
googleJavaFormat('1.15.0')
|
||||
googleJavaFormat('1.17.0')
|
||||
}
|
||||
kotlin {
|
||||
target project.fileTree(project.projectDir) {
|
||||
|
|
|
@ -49,6 +49,7 @@ public class AndroidGamepadManager {
|
|||
}
|
||||
|
||||
private static final int FIRST_DPAD_BUTTON = 12;
|
||||
|
||||
// A list of axis number, gamepad button mappings for negative, positive.
|
||||
// Button mappings are added to FIRST_DPAD_BUTTON.
|
||||
private static enum DpadAxis {
|
||||
|
|
|
@ -536,10 +536,13 @@ public class GeckoAppShell {
|
|||
|
||||
/** Wake-lock for the CPU. */
|
||||
static final String WAKE_LOCK_CPU = "cpu";
|
||||
|
||||
/** Wake-lock for the screen. */
|
||||
static final String WAKE_LOCK_SCREEN = "screen";
|
||||
|
||||
/** Wake-lock for the audio-playing, eqaul to LOCK_CPU. */
|
||||
static final String WAKE_LOCK_AUDIO_PLAYING = "audio-playing";
|
||||
|
||||
/** Wake-lock for the video-playing, eqaul to LOCK_SCREEN.. */
|
||||
static final String WAKE_LOCK_VIDEO_PLAYING = "video-playing";
|
||||
|
||||
|
@ -547,8 +550,10 @@ public class GeckoAppShell {
|
|||
|
||||
/** No one holds the wake-lock. */
|
||||
static final int WAKE_LOCK_STATE_UNLOCKED = 0;
|
||||
|
||||
/** The wake-lock is held by a foreground window. */
|
||||
static final int WAKE_LOCK_STATE_LOCKED_FOREGROUND = 1;
|
||||
|
||||
/** The wake-lock is held by a background window. */
|
||||
static final int WAKE_LOCK_STATE_LOCKED_BACKGROUND = 2;
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ public class GeckoJavaSampler {
|
|||
* https://searchfox.org/mozilla-central/rev/d4ebb53e719b913afdbcf7c00e162f0e96574701/mozglue/baseprofiler/public/BaseProfilerUtils.h#194
|
||||
*/
|
||||
private static final long REPLACEMENT_MAIN_THREAD_ID = 1;
|
||||
|
||||
/**
|
||||
* The thread name to use for the main thread instead of its true thread name. The name is "main",
|
||||
* which is ambiguous with the JS main thread, so we rename it to match the C++ replacement. We
|
||||
|
@ -177,20 +178,25 @@ public class GeckoJavaSampler {
|
|||
|
||||
/** Name of the marker */
|
||||
private final String mMarkerName;
|
||||
|
||||
/** Either start time for the duration markers or time for a point-in-time markers. */
|
||||
private final double mTime;
|
||||
|
||||
/**
|
||||
* A fallback field of {@link #mTime} but it only exists when {@link #getProfilerTime()} is
|
||||
* failed. It is non-zero if Android time is used.
|
||||
*/
|
||||
private final long mJavaTime;
|
||||
|
||||
/** End time for the duration markers. It's zero for point-in-time markers. */
|
||||
private final double mEndTime;
|
||||
|
||||
/**
|
||||
* A fallback field of {@link #mEndTime} but it only exists when {@link #getProfilerTime()} is
|
||||
* failed. It is non-zero if Android time is used.
|
||||
*/
|
||||
private final long mEndJavaTime;
|
||||
|
||||
/** A nullable additional information field for the marker. */
|
||||
private @Nullable final String mText;
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ public interface AsyncCodec {
|
|||
public abstract void stop();
|
||||
|
||||
public abstract void flush();
|
||||
|
||||
// Must be called after flush().
|
||||
public abstract void resumeReceivingInputs();
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
|
|||
PLAY_STATE_PAUSED,
|
||||
PLAY_STATE_PLAYING
|
||||
}
|
||||
|
||||
// Default value is PLAY_STATE_PREPARING and it will be set to PLAY_STATE_PLAYING
|
||||
// once HTMLMediaElement calls PlayInternal().
|
||||
// Accessed only in GeckoHlsPlayerThread.
|
||||
|
@ -737,6 +738,7 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
|
|||
mPlayer.prepare(mMediaSource);
|
||||
mIsPlayerInitDone = true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// API for GeckoHLSResourceWrapper
|
||||
// =======================================================================
|
||||
|
@ -765,6 +767,7 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
|
|||
public boolean isLiveStream() {
|
||||
return !mIsTimelineStatic;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// API for GeckoHLSDemuxerWrapper
|
||||
// =======================================================================
|
||||
|
|
|
@ -19,6 +19,7 @@ public interface GeckoMediaDrm {
|
|||
void onSessionError(byte[] sessionId, String message);
|
||||
|
||||
void onSessionBatchedKeyChanged(byte[] sessionId, SessionKeyInfo[] keyInfos);
|
||||
|
||||
// All failure cases should go through this function.
|
||||
void onRejectPromise(int promiseId, String message);
|
||||
}
|
||||
|
|
|
@ -894,6 +894,7 @@ public class Autofill {
|
|||
*/
|
||||
@UiThread
|
||||
default void onSessionStart(@NonNull final GeckoSession session) {}
|
||||
|
||||
/**
|
||||
* An autofill session has been committed. Triggered by form submission or navigation.
|
||||
*
|
||||
|
@ -906,6 +907,7 @@ public class Autofill {
|
|||
@NonNull final GeckoSession session,
|
||||
@NonNull final Node node,
|
||||
@NonNull final NodeData data) {}
|
||||
|
||||
/**
|
||||
* An autofill session has been canceled. Triggered by page unload.
|
||||
*
|
||||
|
@ -913,6 +915,7 @@ public class Autofill {
|
|||
*/
|
||||
@UiThread
|
||||
default void onSessionCancel(@NonNull final GeckoSession session) {}
|
||||
|
||||
/**
|
||||
* A node within the autofill session has been added.
|
||||
*
|
||||
|
@ -925,6 +928,7 @@ public class Autofill {
|
|||
@NonNull final GeckoSession session,
|
||||
@NonNull final Node node,
|
||||
@NonNull final NodeData data) {}
|
||||
|
||||
/**
|
||||
* A node within the autofill session has been removed.
|
||||
*
|
||||
|
@ -937,6 +941,7 @@ public class Autofill {
|
|||
@NonNull final GeckoSession session,
|
||||
@NonNull final Node node,
|
||||
@NonNull final NodeData data) {}
|
||||
|
||||
/**
|
||||
* A node within the autofill session has been updated.
|
||||
*
|
||||
|
@ -949,6 +954,7 @@ public class Autofill {
|
|||
@NonNull final GeckoSession session,
|
||||
@NonNull final Node node,
|
||||
@NonNull final NodeData data) {}
|
||||
|
||||
/**
|
||||
* A node within the autofill session has gained focus.
|
||||
*
|
||||
|
@ -961,6 +967,7 @@ public class Autofill {
|
|||
@NonNull final GeckoSession session,
|
||||
@NonNull final Node focused,
|
||||
@NonNull final NodeData data) {}
|
||||
|
||||
/**
|
||||
* A node within the autofill session has lost focus.
|
||||
*
|
||||
|
|
|
@ -245,6 +245,7 @@ public class GeckoDisplay {
|
|||
mSession.onSafeAreaInsetsChanged(top, right, bottom, left);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximum height of the dynamic toolbar(s).
|
||||
*
|
||||
|
|
|
@ -130,6 +130,7 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
|
|||
getSettings().mDebugPause = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the to report the full bit depth of the device.
|
||||
*
|
||||
|
@ -1025,8 +1026,10 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
|
|||
|
||||
/** A light theme for web content is preferred. */
|
||||
public static final int COLOR_SCHEME_LIGHT = 0;
|
||||
|
||||
/** A dark theme for web content is preferred. */
|
||||
public static final int COLOR_SCHEME_DARK = 1;
|
||||
|
||||
/** The preferred color scheme will be based on system settings. */
|
||||
public static final int COLOR_SCHEME_SYSTEM = -1;
|
||||
|
||||
|
@ -1189,8 +1192,10 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
|
|||
|
||||
/** Allow all insecure connections */
|
||||
public static final int ALLOW_ALL = 0;
|
||||
|
||||
/** Allow insecure connections in normal browsing, but only HTTPS in private browsing. */
|
||||
public static final int HTTPS_ONLY_PRIVATE = 1;
|
||||
|
||||
/** Only allow HTTPS connections. */
|
||||
public static final int HTTPS_ONLY = 2;
|
||||
|
||||
|
|
|
@ -243,6 +243,7 @@ public class GeckoSession {
|
|||
private SessionMagnifier mMagnifier;
|
||||
|
||||
private String mId;
|
||||
|
||||
/* package */ String getId() {
|
||||
return mId;
|
||||
}
|
||||
|
@ -1842,6 +1843,7 @@ public class GeckoSession {
|
|||
* CORS-safelisted request header </a>.
|
||||
*/
|
||||
public static final int HEADER_FILTER_CORS_SAFELISTED = 1;
|
||||
|
||||
/**
|
||||
* Allows most headers.
|
||||
*
|
||||
|
@ -2330,10 +2332,13 @@ public class GeckoSession {
|
|||
|
||||
/** Go backwards when finding the next match. */
|
||||
public static final int FINDER_FIND_BACKWARDS = 1;
|
||||
|
||||
/** Perform case-sensitive match; default is to perform a case-insensitive match. */
|
||||
public static final int FINDER_FIND_MATCH_CASE = 1 << 1;
|
||||
|
||||
/** Must match entire words; default is to allow matching partial words. */
|
||||
public static final int FINDER_FIND_WHOLE_WORD = 1 << 2;
|
||||
|
||||
/** Limit matches to links on the page. */
|
||||
public static final int FINDER_FIND_LINKS_ONLY = 1 << 3;
|
||||
|
||||
|
@ -2349,8 +2354,10 @@ public class GeckoSession {
|
|||
|
||||
/** Highlight all find-in-page matches. */
|
||||
public static final int FINDER_DISPLAY_HIGHLIGHT_ALL = 1;
|
||||
|
||||
/** Dim the rest of the page when showing a find-in-page match. */
|
||||
public static final int FINDER_DISPLAY_DIM_PAGE = 1 << 1;
|
||||
|
||||
/** Draw outlines around matching links. */
|
||||
public static final int FINDER_DISPLAY_DRAW_LINK_OUTLINE = 1 << 2;
|
||||
|
||||
|
@ -2359,21 +2366,28 @@ public class GeckoSession {
|
|||
public static class FinderResult {
|
||||
/** Whether a match was found. */
|
||||
public final boolean found;
|
||||
|
||||
/** Whether the search wrapped around the top or bottom of the page. */
|
||||
public final boolean wrapped;
|
||||
|
||||
/** Ordinal number of the current match starting from 1, or 0 if no match. */
|
||||
public final int current;
|
||||
|
||||
/** Total number of matches found so far, or -1 if unknown. */
|
||||
public final int total;
|
||||
|
||||
/** Search string. */
|
||||
@NonNull public final String searchString;
|
||||
|
||||
/**
|
||||
* Flags used for the search; either 0 or a combination of {@link #FINDER_FIND_BACKWARDS
|
||||
* FINDER_FIND_*} flags.
|
||||
*/
|
||||
@FinderFindFlags public final int flags;
|
||||
|
||||
/** URI of the link, if the current match is a link, or null otherwise. */
|
||||
@Nullable public final String linkUri;
|
||||
|
||||
/** Bounds of the current match in client coordinates, or null if unknown. */
|
||||
@Nullable public final RectF clientRect;
|
||||
|
||||
|
@ -3199,12 +3213,16 @@ public class GeckoSession {
|
|||
public static final int CONTENT_UNKNOWN = 0;
|
||||
public static final int CONTENT_BLOCKED = 1;
|
||||
public static final int CONTENT_LOADED = 2;
|
||||
|
||||
/** Indicates whether or not the site is secure. */
|
||||
public final boolean isSecure;
|
||||
|
||||
/** Indicates whether or not the site is a security exception. */
|
||||
public final boolean isException;
|
||||
|
||||
/** Contains the origin of the certificate. */
|
||||
public final @Nullable String origin;
|
||||
|
||||
/** Contains the host associated with the certificate. */
|
||||
public final @NonNull String host;
|
||||
|
||||
|
@ -3217,11 +3235,13 @@ public class GeckoSession {
|
|||
* domain validation only, while SECURITY_MODE_VERIFIED indicates extended validation.
|
||||
*/
|
||||
public final @SecurityMode int securityMode;
|
||||
|
||||
/**
|
||||
* Indicates the presence of passive mixed content; possible values are CONTENT_UNKNOWN,
|
||||
* CONTENT_BLOCKED, and CONTENT_LOADED.
|
||||
*/
|
||||
public final @ContentType int mixedModePassive;
|
||||
|
||||
/**
|
||||
* Indicates the presence of active mixed content; possible values are CONTENT_UNKNOWN,
|
||||
* CONTENT_BLOCKED, and CONTENT_LOADED.
|
||||
|
@ -3681,34 +3701,45 @@ public class GeckoSession {
|
|||
public interface SelectionActionDelegate {
|
||||
/** The selection is collapsed at a single position. */
|
||||
final int FLAG_IS_COLLAPSED = 1 << 0;
|
||||
|
||||
/**
|
||||
* The selection is inside editable content such as an input element or contentEditable node.
|
||||
*/
|
||||
final int FLAG_IS_EDITABLE = 1 << 1;
|
||||
|
||||
/** The selection is inside a password field. */
|
||||
final int FLAG_IS_PASSWORD = 1 << 2;
|
||||
|
||||
/** Hide selection actions and cause {@link #onHideAction} to be called. */
|
||||
final String ACTION_HIDE = "org.mozilla.geckoview.HIDE";
|
||||
|
||||
/** Copy onto the clipboard then delete the selected content. Selection must be editable. */
|
||||
final String ACTION_CUT = "org.mozilla.geckoview.CUT";
|
||||
|
||||
/** Copy the selected content onto the clipboard. */
|
||||
final String ACTION_COPY = "org.mozilla.geckoview.COPY";
|
||||
|
||||
/** Delete the selected content. Selection must be editable. */
|
||||
final String ACTION_DELETE = "org.mozilla.geckoview.DELETE";
|
||||
|
||||
/** Replace the selected content with the clipboard content. Selection must be editable. */
|
||||
final String ACTION_PASTE = "org.mozilla.geckoview.PASTE";
|
||||
|
||||
/**
|
||||
* Replace the selected content with the clipboard content as plain text. Selection must be
|
||||
* editable.
|
||||
*/
|
||||
final String ACTION_PASTE_AS_PLAIN_TEXT = "org.mozilla.geckoview.PASTE_AS_PLAIN_TEXT";
|
||||
|
||||
/** Select the entire content of the document or editor. */
|
||||
final String ACTION_SELECT_ALL = "org.mozilla.geckoview.SELECT_ALL";
|
||||
|
||||
/** Clear the current selection. Selection must not be editable. */
|
||||
final String ACTION_UNSELECT = "org.mozilla.geckoview.UNSELECT";
|
||||
|
||||
/** Collapse the current selection to its start position. Selection must be editable. */
|
||||
final String ACTION_COLLAPSE_TO_START = "org.mozilla.geckoview.COLLAPSE_TO_START";
|
||||
|
||||
/** Collapse the current selection to its end position. Selection must be editable. */
|
||||
final String ACTION_COLLAPSE_TO_END = "org.mozilla.geckoview.COLLAPSE_TO_END";
|
||||
|
||||
|
@ -3921,17 +3952,20 @@ public class GeckoSession {
|
|||
|
||||
/** Actions are no longer available due to the user clearing the selection. */
|
||||
final int HIDE_REASON_NO_SELECTION = 0;
|
||||
|
||||
/**
|
||||
* Actions are no longer available due to the user moving the selection out of view. Previous
|
||||
* actions are still available after a callback with this reason.
|
||||
*/
|
||||
final int HIDE_REASON_INVISIBLE_SELECTION = 1;
|
||||
|
||||
/**
|
||||
* Actions are no longer available due to the user actively changing the selection. {@link
|
||||
* #onShowActionRequest} may be called again once the user has set a selection, if the new
|
||||
* selection has available actions.
|
||||
*/
|
||||
final int HIDE_REASON_ACTIVE_SELECTION = 2;
|
||||
|
||||
/**
|
||||
* Actions are no longer available due to the user actively scrolling the page. {@link
|
||||
* #onShowActionRequest} may be called again once the user has stopped scrolling the page, if
|
||||
|
@ -3968,6 +4002,7 @@ public class GeckoSession {
|
|||
* PERMISSION_CLIPBOARD_*}.
|
||||
*/
|
||||
public final @ClipboardPermissionType int type;
|
||||
|
||||
/**
|
||||
* The last mouse or touch location in screen coordinates when the permission is requested.
|
||||
*/
|
||||
|
@ -4335,6 +4370,7 @@ public class GeckoSession {
|
|||
|
||||
/** The title of this prompt; may be null. */
|
||||
public final @Nullable String title;
|
||||
|
||||
/* package */ String id;
|
||||
|
||||
private BasePrompt(
|
||||
|
@ -4593,12 +4629,16 @@ public class GeckoSession {
|
|||
public static class Flags {
|
||||
/** The auth prompt is for a network host. */
|
||||
public static final int HOST = 1 << 0;
|
||||
|
||||
/** The auth prompt is for a proxy. */
|
||||
public static final int PROXY = 1 << 1;
|
||||
|
||||
/** The auth prompt should only request a password. */
|
||||
public static final int ONLY_PASSWORD = 1 << 3;
|
||||
|
||||
/** The auth prompt is the result of a previous failed login. */
|
||||
public static final int PREVIOUS_FAILED = 1 << 4;
|
||||
|
||||
/** The auth prompt is for a cross-origin sub-resource. */
|
||||
public static final int CROSS_ORIGIN_SUB_RESOURCE = 1 << 5;
|
||||
|
||||
|
@ -4613,8 +4653,10 @@ public class GeckoSession {
|
|||
public static class Level {
|
||||
/** The auth request is unencrypted or the encryption status is unknown. */
|
||||
public static final int NONE = 0;
|
||||
|
||||
/** The auth request only encrypts password but not data. */
|
||||
public static final int PW_ENCRYPTED = 1;
|
||||
|
||||
/** The auth request encrypts both password and data. */
|
||||
public static final int SECURE = 2;
|
||||
|
||||
|
@ -6247,8 +6289,10 @@ public class GeckoSession {
|
|||
public interface TextInputDelegate {
|
||||
/** Restarting input due to an input field gaining focus. */
|
||||
int RESTART_REASON_FOCUS = 0;
|
||||
|
||||
/** Restarting input due to an input field losing focus. */
|
||||
int RESTART_REASON_BLUR = 1;
|
||||
|
||||
/**
|
||||
* Restarting input due to the content of the input field changing. For example, the input field
|
||||
* type may have changed, or the current composition may have been committed outside of the
|
||||
|
@ -6793,14 +6837,19 @@ public class GeckoSession {
|
|||
|
||||
/** The URL was visited a top-level window. */
|
||||
final int VISIT_TOP_LEVEL = 1 << 0;
|
||||
|
||||
/** The URL is the target of a temporary redirect. */
|
||||
final int VISIT_REDIRECT_TEMPORARY = 1 << 1;
|
||||
|
||||
/** The URL is the target of a permanent redirect. */
|
||||
final int VISIT_REDIRECT_PERMANENT = 1 << 2;
|
||||
|
||||
/** The URL is temporarily redirected to another URL. */
|
||||
final int VISIT_REDIRECT_SOURCE = 1 << 3;
|
||||
|
||||
/** The URL is permanently redirected to another URL. */
|
||||
final int VISIT_REDIRECT_SOURCE_PERMANENT = 1 << 4;
|
||||
|
||||
/** The URL failed to load due to a client or server error. */
|
||||
final int VISIT_UNRECOVERABLE_ERROR = 1 << 5;
|
||||
|
||||
|
@ -7006,6 +7055,7 @@ public class GeckoSession {
|
|||
* @param session to print
|
||||
*/
|
||||
default void onPrint(@NonNull final GeckoSession session) {}
|
||||
|
||||
/**
|
||||
* Print any provided PDF InputStream.
|
||||
*
|
||||
|
@ -7050,12 +7100,16 @@ public class GeckoSession {
|
|||
public static class GeckoPrintException extends Exception {
|
||||
/** The print service was not available. */
|
||||
public static final int ERROR_PRINT_SETTINGS_SERVICE_NOT_AVAILABLE = -1;
|
||||
|
||||
/** The print service was not created due to an initialization error. */
|
||||
public static final int ERROR_UNABLE_TO_CREATE_PRINT_SETTINGS = -2;
|
||||
|
||||
/** An error happened while trying to find the canonical browing context */
|
||||
public static final int ERROR_UNABLE_TO_RETRIEVE_CANONICAL_BROWSING_CONTEXT = -3;
|
||||
|
||||
/** An error happened while trying to find the activity context delegate */
|
||||
public static final int ERROR_NO_ACTIVITY_CONTEXT_DELEGATE = -4;
|
||||
|
||||
/** An error happened while trying to find the activity context */
|
||||
public static final int ERROR_NO_ACTIVITY_CONTEXT = -5;
|
||||
|
||||
|
|
|
@ -206,10 +206,13 @@ public final class GeckoSessionSettings implements Parcelable {
|
|||
// This needs to match GeckoViewSettings.jsm
|
||||
/** "browser" value of the display member in Web App Manifests */
|
||||
public static final int DISPLAY_MODE_BROWSER = 0;
|
||||
|
||||
/** "minimal-ui" value of the display member in Web App Manifests */
|
||||
public static final int DISPLAY_MODE_MINIMAL_UI = 1;
|
||||
|
||||
/** "standalone" value of the display member in Web App Manifests */
|
||||
public static final int DISPLAY_MODE_STANDALONE = 2;
|
||||
|
||||
/** "fullscreen" value of the display member in Web App Manifests */
|
||||
public static final int DISPLAY_MODE_FULLSCREEN = 3;
|
||||
|
||||
|
@ -225,8 +228,10 @@ public final class GeckoSessionSettings implements Parcelable {
|
|||
// This needs to match GeckoViewSettingsChild.js and GeckoViewSettings.jsm
|
||||
/** The user agent mode is mobile device */
|
||||
public static final int USER_AGENT_MODE_MOBILE = 0;
|
||||
|
||||
/** The user agent mobe is desktop device */
|
||||
public static final int USER_AGENT_MODE_DESKTOP = 1;
|
||||
|
||||
/** The user agent mode is VR device */
|
||||
public static final int USER_AGENT_MODE_VR = 2;
|
||||
|
||||
|
@ -270,6 +275,7 @@ public final class GeckoSessionSettings implements Parcelable {
|
|||
*/
|
||||
private static final Key<String> CHROME_URI =
|
||||
new Key<String>("chromeUri", /* initOnly */ true, /* values */ null);
|
||||
|
||||
/** Key to set the window screen ID, or 0 to use default ID. Read-only once session is open. */
|
||||
private static final Key<Integer> SCREEN_ID =
|
||||
new Key<Integer>("screenId", /* initOnly */ true, /* values */ null);
|
||||
|
@ -277,6 +283,7 @@ public final class GeckoSessionSettings implements Parcelable {
|
|||
/** Key to enable and disable tracking protection. */
|
||||
private static final Key<Boolean> USE_TRACKING_PROTECTION =
|
||||
new Key<Boolean>("useTrackingProtection");
|
||||
|
||||
/** Key to enable and disable private mode browsing. Read-only once session is open. */
|
||||
private static final Key<Boolean> USE_PRIVATE_MODE =
|
||||
new Key<Boolean>("usePrivateMode", /* initOnly */ true, /* values */ null);
|
||||
|
@ -318,6 +325,7 @@ public final class GeckoSessionSettings implements Parcelable {
|
|||
/** Key to specify if JavaScript should be allowed on this session. */
|
||||
private static final Key<Boolean> ALLOW_JAVASCRIPT =
|
||||
new Key<Boolean>("allowJavascript", /* initOnly */ false, /* values */ null);
|
||||
|
||||
/** Key to specify if entire accessible tree should be exposed with no caching. */
|
||||
private static final Key<Boolean> FULL_ACCESSIBILITY_TREE =
|
||||
new Key<Boolean>("fullAccessibilityTree", /* initOnly */ false, /* values */ null);
|
||||
|
|
|
@ -328,6 +328,7 @@ public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfacePro
|
|||
* <p>This option offers the best performance at the price of not being able to animate GeckoView.
|
||||
*/
|
||||
public static final int BACKEND_SURFACE_VIEW = 1;
|
||||
|
||||
/**
|
||||
* This GeckoView instance will be backed by a {@link TextureView}.
|
||||
*
|
||||
|
|
|
@ -47,6 +47,7 @@ public class PanZoomController {
|
|||
|
||||
/** Specifies smooth scrolling which animates content to the desired scroll position. */
|
||||
public static final int SCROLL_BEHAVIOR_SMOOTH = 0;
|
||||
|
||||
/** Specifies auto scrolling which jumps content to the desired scroll position. */
|
||||
public static final int SCROLL_BEHAVIOR_AUTO = 1;
|
||||
|
||||
|
@ -94,6 +95,7 @@ public class PanZoomController {
|
|||
SCROLLABLE_FLAG_LEFT
|
||||
})
|
||||
public @interface ScrollableDirections {}
|
||||
|
||||
/**
|
||||
* Represents which directions can be scrolled in the scroll container where an input event was
|
||||
* handled. This value is only useful in the case of {@link
|
||||
|
@ -101,6 +103,7 @@ public class PanZoomController {
|
|||
*/
|
||||
/* The container cannot be scrolled. */
|
||||
@WrapForJNI public static final int SCROLLABLE_FLAG_NONE = 0;
|
||||
|
||||
/* The container cannot be scrolled to top */
|
||||
@WrapForJNI public static final int SCROLLABLE_FLAG_TOP = 1 << 0;
|
||||
/* The container cannot be scrolled to right */
|
||||
|
@ -115,6 +118,7 @@ public class PanZoomController {
|
|||
flag = true,
|
||||
value = {OVERSCROLL_FLAG_NONE, OVERSCROLL_FLAG_HORIZONTAL, OVERSCROLL_FLAG_VERTICAL})
|
||||
public @interface OverscrollDirections {}
|
||||
|
||||
/**
|
||||
* Represents which directions can be over-scrolled in the scroll container where an input event
|
||||
* was handled. This value is only useful in the case of {@link
|
||||
|
@ -122,6 +126,7 @@ public class PanZoomController {
|
|||
*/
|
||||
/* the container cannot be over-scrolled. */
|
||||
@WrapForJNI public static final int OVERSCROLL_FLAG_NONE = 0;
|
||||
|
||||
/* the container can be over-scrolled horizontally. */
|
||||
@WrapForJNI public static final int OVERSCROLL_FLAG_HORIZONTAL = 1 << 0;
|
||||
/* the container can be over-scrolled vertically. */
|
||||
|
@ -159,6 +164,7 @@ public class PanZoomController {
|
|||
public @InputResult int handledResult() {
|
||||
return mHandledResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an OR-ed value of {@link #SCROLLABLE_FLAG_NONE SCROLLABLE_FLAG_*} indicating which
|
||||
* directions can be scrollable.
|
||||
|
@ -167,6 +173,7 @@ public class PanZoomController {
|
|||
public @ScrollableDirections int scrollableDirections() {
|
||||
return mScrollableDirections;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an OR-ed value of {@link #OVERSCROLL_FLAG_NONE OVERSCROLL_FLAG_*} indicating which
|
||||
* directions can be over-scrollable.
|
||||
|
|
|
@ -21,6 +21,7 @@ public class ScreenLength {
|
|||
|
||||
/** Pixel units. */
|
||||
public static final int PIXEL = 0;
|
||||
|
||||
/**
|
||||
* Units are in visual viewport width. If the visual viewport is 100 pixels wide, then a value of
|
||||
* 2.0 would represent a length of 200 pixels.
|
||||
|
@ -29,6 +30,7 @@ public class ScreenLength {
|
|||
* Viewport</a>
|
||||
*/
|
||||
public static final int VISUAL_VIEWPORT_WIDTH = 1;
|
||||
|
||||
/**
|
||||
* Units are in visual viewport height. If the visual viewport is 100 pixels high, then a value of
|
||||
* 2.0 would represent a length of 200 pixels.
|
||||
|
@ -37,11 +39,13 @@ public class ScreenLength {
|
|||
* Viewport</a>
|
||||
*/
|
||||
public static final int VISUAL_VIEWPORT_HEIGHT = 2;
|
||||
|
||||
/**
|
||||
* Units represent the entire scrollable documents width. If the document is 1000 pixels wide then
|
||||
* a value of 1.0 would represent 1000 pixels.
|
||||
*/
|
||||
public static final int DOCUMENT_WIDTH = 3;
|
||||
|
||||
/**
|
||||
* Units represent the entire scrollable documents height. If the document is 1000 pixels tall
|
||||
* then a value of 1.0 would represent 1000 pixels.
|
||||
|
|
|
@ -41,8 +41,10 @@ public class WebExtension {
|
|||
* Will point to folder <code>/assets/web_extensions/my_webextension/</code> in the APK.
|
||||
*/
|
||||
public final @NonNull String location;
|
||||
|
||||
/** Unique identifier for this WebExtension */
|
||||
public final @NonNull String id;
|
||||
|
||||
/** {@link Flags} for this WebExtension. */
|
||||
public final @WebExtensionFlags long flags;
|
||||
|
||||
|
@ -107,6 +109,7 @@ public class WebExtension {
|
|||
* Default flags for this WebExtension.
|
||||
*/
|
||||
public static final long NONE = 0;
|
||||
|
||||
/**
|
||||
* Set this flag if you want to enable content scripts messaging. To listen to such messages you
|
||||
* can use {@link SessionController#setMessageDelegate}.
|
||||
|
@ -219,6 +222,7 @@ public class WebExtension {
|
|||
* remove data given in milliseconds since the UNIX epoch.
|
||||
*/
|
||||
public final int sinceUnixTimestamp;
|
||||
|
||||
/**
|
||||
* Data types that can be toggled in the browser's "Clear Data" UI. One or more flags from
|
||||
* {@link Type}.
|
||||
|
@ -619,14 +623,19 @@ public class WebExtension {
|
|||
* should stop being highlighted. If <code>false</code>, does nothing.
|
||||
*/
|
||||
@Nullable public final Boolean active;
|
||||
|
||||
/** Whether the tab should be discarded automatically by the app when resources are low. */
|
||||
@Nullable public final Boolean autoDiscardable;
|
||||
|
||||
/** If <code>true</code> and the tab is not highlighted, it should become active by default. */
|
||||
@Nullable public final Boolean highlighted;
|
||||
|
||||
/** Whether the tab should be muted. */
|
||||
@Nullable public final Boolean muted;
|
||||
|
||||
/** Whether the tab should be pinned. */
|
||||
@Nullable public final Boolean pinned;
|
||||
|
||||
/**
|
||||
* The url that the tab will be navigated to. This url is provided just for informational
|
||||
* purposes, there is no need to load the URL manually. The corresponding {@link GeckoSession}
|
||||
|
@ -668,23 +677,29 @@ public class WebExtension {
|
|||
* should stop being highlighted. If <code>false</code>, does nothing.
|
||||
*/
|
||||
@Nullable public final Boolean active;
|
||||
|
||||
/**
|
||||
* The CookieStoreId used for the tab. This option is only available if the extension has the
|
||||
* "cookies" permission.
|
||||
*/
|
||||
@Nullable public final String cookieStoreId;
|
||||
|
||||
/**
|
||||
* Whether the tab is created and made visible in the tab bar without any content loaded into
|
||||
* memory, a state known as discarded. The tab’s content should be loaded when the tab is
|
||||
* activated.
|
||||
*/
|
||||
@Nullable public final Boolean discarded;
|
||||
|
||||
/** The position the tab should take in the window. */
|
||||
@Nullable public final Integer index;
|
||||
|
||||
/** If true, open this tab in Reader Mode. */
|
||||
@Nullable public final Boolean openInReaderMode;
|
||||
|
||||
/** Whether the tab should be pinned. */
|
||||
@Nullable public final Boolean pinned;
|
||||
|
||||
/**
|
||||
* The url that the tab will be navigated to. This url is provided just for informational
|
||||
* purposes, there is no need to load the URL manually. The corresponding {@link GeckoSession}
|
||||
|
@ -1095,7 +1110,9 @@ public class WebExtension {
|
|||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({ENV_TYPE_UNKNOWN, ENV_TYPE_EXTENSION, ENV_TYPE_CONTENT_SCRIPT})
|
||||
public @interface EnvType {}
|
||||
|
||||
/* package */ static final int ENV_TYPE_UNKNOWN = 0;
|
||||
|
||||
/** This sender originated inside a privileged extension context like a background script. */
|
||||
public static final int ENV_TYPE_EXTENSION = 1;
|
||||
|
||||
|
@ -1197,6 +1214,7 @@ public class WebExtension {
|
|||
* browserAction/getTitle</a>
|
||||
*/
|
||||
public final @Nullable String title;
|
||||
|
||||
/**
|
||||
* Icon for this Action.
|
||||
*
|
||||
|
@ -1207,6 +1225,7 @@ public class WebExtension {
|
|||
* browserAction/setIcon</a>
|
||||
*/
|
||||
public final @Nullable Image icon;
|
||||
|
||||
/**
|
||||
* Whether this action is enabled and should be visible.
|
||||
*
|
||||
|
@ -1221,6 +1240,7 @@ public class WebExtension {
|
|||
* browserAction/enabled</a>
|
||||
*/
|
||||
public final @Nullable Boolean enabled;
|
||||
|
||||
/**
|
||||
* Badge text for this action.
|
||||
*
|
||||
|
@ -1229,6 +1249,7 @@ public class WebExtension {
|
|||
* browserAction/getBadgeText</a>
|
||||
*/
|
||||
public final @Nullable String badgeText;
|
||||
|
||||
/**
|
||||
* Background color for the badge for this Action.
|
||||
*
|
||||
|
@ -1240,6 +1261,7 @@ public class WebExtension {
|
|||
* browserAction/getBadgeBackgroundColor</a>
|
||||
*/
|
||||
public final @Nullable Integer badgeBackgroundColor;
|
||||
|
||||
/**
|
||||
* Text color for the badge for this Action.
|
||||
*
|
||||
|
@ -1457,6 +1479,7 @@ public class WebExtension {
|
|||
final @NonNull WebExtension extension,
|
||||
final @Nullable GeckoSession session,
|
||||
final @NonNull Action action) {}
|
||||
|
||||
/**
|
||||
* Called whenever a page action is defined or updated.
|
||||
*
|
||||
|
@ -1517,24 +1540,34 @@ public class WebExtension {
|
|||
public static class ErrorCodes {
|
||||
/** The download failed due to network problems. */
|
||||
public static final int ERROR_NETWORK_FAILURE = -1;
|
||||
|
||||
/** The downloaded file did not match the provided hash. */
|
||||
public static final int ERROR_INCORRECT_HASH = -2;
|
||||
|
||||
/** The downloaded file seems to be corrupted in some way. */
|
||||
public static final int ERROR_CORRUPT_FILE = -3;
|
||||
|
||||
/** An error occurred trying to write to the filesystem. */
|
||||
public static final int ERROR_FILE_ACCESS = -4;
|
||||
|
||||
/** The extension must be signed and isn't. */
|
||||
public static final int ERROR_SIGNEDSTATE_REQUIRED = -5;
|
||||
|
||||
/** The downloaded extension had a different type than expected. */
|
||||
public static final int ERROR_UNEXPECTED_ADDON_TYPE = -6;
|
||||
|
||||
/** The downloaded extension had a different version than expected */
|
||||
public static final int ERROR_UNEXPECTED_ADDON_VERSION = -9;
|
||||
|
||||
/** The extension did not have the expected ID. */
|
||||
public static final int ERROR_INCORRECT_ID = -7;
|
||||
|
||||
/** The extension did not have the expected ID. */
|
||||
public static final int ERROR_INVALID_DOMAIN = -8;
|
||||
|
||||
/** The extension install was canceled. */
|
||||
public static final int ERROR_USER_CANCELED = -100;
|
||||
|
||||
/** The extension install was postponed until restart. */
|
||||
public static final int ERROR_POSTPONED = -101;
|
||||
|
||||
|
@ -1637,14 +1670,19 @@ public class WebExtension {
|
|||
* certificate.
|
||||
*/
|
||||
public static final int UNKNOWN = -1;
|
||||
|
||||
/** This extension is unsigned. */
|
||||
public static final int MISSING = 0;
|
||||
|
||||
/** This extension has been preliminarily reviewed. */
|
||||
public static final int PRELIMINARY = 1;
|
||||
|
||||
/** This extension has been fully reviewed. */
|
||||
public static final int SIGNED = 2;
|
||||
|
||||
/** This extension is a system add-on. */
|
||||
public static final int SYSTEM = 3;
|
||||
|
||||
/** This extension is signed with a "Mozilla Extensions" certificate. */
|
||||
public static final int PRIVILEGED = 4;
|
||||
|
||||
|
@ -1671,17 +1709,22 @@ public class WebExtension {
|
|||
// Keep in sync with nsIBlocklistService.idl
|
||||
/** This extension does not appear in the blocklist. */
|
||||
public static final int NOT_BLOCKED = 0;
|
||||
|
||||
/**
|
||||
* This extension is in the blocklist but the problem is not severe enough to warant forcibly
|
||||
* blocking.
|
||||
*/
|
||||
public static final int SOFTBLOCKED = 1;
|
||||
|
||||
/** This extension should be blocked and never used. */
|
||||
public static final int BLOCKED = 2;
|
||||
|
||||
/** This extension is considered outdated, and there is a known update available. */
|
||||
public static final int OUTDATED = 3;
|
||||
|
||||
/** This extension is vulnerable and there is an update. */
|
||||
public static final int VULNERABLE_UPDATE_AVAILABLE = 4;
|
||||
|
||||
/** This extension is vulnerable and there is no update. */
|
||||
public static final int VULNERABLE_NO_UPDATE = 5;
|
||||
}
|
||||
|
@ -1728,6 +1771,7 @@ public class WebExtension {
|
|||
* prompts.
|
||||
*/
|
||||
public final @NonNull Image icon;
|
||||
|
||||
/**
|
||||
* API permissions requested or granted to this extension.
|
||||
*
|
||||
|
@ -1736,6 +1780,7 @@ public class WebExtension {
|
|||
* API permissions </a>.
|
||||
*/
|
||||
public final @NonNull String[] permissions;
|
||||
|
||||
/**
|
||||
* Host permissions requested or granted to this extension.
|
||||
*
|
||||
|
@ -1744,6 +1789,7 @@ public class WebExtension {
|
|||
* Host permissions </a>.
|
||||
*/
|
||||
public final @NonNull String[] origins;
|
||||
|
||||
/**
|
||||
* Branding name for this extension.
|
||||
*
|
||||
|
@ -1752,6 +1798,7 @@ public class WebExtension {
|
|||
* manifest.json/name </a>
|
||||
*/
|
||||
public final @Nullable String name;
|
||||
|
||||
/**
|
||||
* Branding description for this extension. This string will be localized using the current
|
||||
* GeckoView language setting.
|
||||
|
@ -1761,6 +1808,7 @@ public class WebExtension {
|
|||
* manifest.json/description </a>
|
||||
*/
|
||||
public final @Nullable String description;
|
||||
|
||||
/**
|
||||
* Version string for this extension.
|
||||
*
|
||||
|
@ -1769,6 +1817,7 @@ public class WebExtension {
|
|||
* manifest.json/version </a>
|
||||
*/
|
||||
public final @NonNull String version;
|
||||
|
||||
/**
|
||||
* Creator name as provided in the manifest.
|
||||
*
|
||||
|
@ -1777,6 +1826,7 @@ public class WebExtension {
|
|||
* manifest.json/developer </a>
|
||||
*/
|
||||
public final @Nullable String creatorName;
|
||||
|
||||
/**
|
||||
* Creator url as provided in the manifest.
|
||||
*
|
||||
|
@ -1785,6 +1835,7 @@ public class WebExtension {
|
|||
* manifest.json/developer </a>
|
||||
*/
|
||||
public final @Nullable String creatorUrl;
|
||||
|
||||
/**
|
||||
* Homepage url as provided in the manifest.
|
||||
*
|
||||
|
@ -1793,6 +1844,7 @@ public class WebExtension {
|
|||
* manifest.json/homepage_url </a>
|
||||
*/
|
||||
public final @Nullable String homepageUrl;
|
||||
|
||||
/**
|
||||
* Options page as provided in the manifest.
|
||||
*
|
||||
|
@ -1801,6 +1853,7 @@ public class WebExtension {
|
|||
* manifest.json/options_ui </a>
|
||||
*/
|
||||
public final @Nullable String optionsPageUrl;
|
||||
|
||||
/**
|
||||
* Whether the options page should be open in a Tab or not.
|
||||
*
|
||||
|
@ -1809,6 +1862,7 @@ public class WebExtension {
|
|||
* manifest.json/options_ui#Syntax </a>
|
||||
*/
|
||||
public final boolean openOptionsPageInTab;
|
||||
|
||||
/**
|
||||
* Whether or not this is a recommended extension.
|
||||
*
|
||||
|
@ -1816,6 +1870,7 @@ public class WebExtension {
|
|||
* Extensions program </a>
|
||||
*/
|
||||
public final boolean isRecommended;
|
||||
|
||||
/**
|
||||
* Blocklist status for this extension.
|
||||
*
|
||||
|
@ -1823,6 +1878,7 @@ public class WebExtension {
|
|||
* Add-ons that cause stability or security issues are put on a blocklist </a>.
|
||||
*/
|
||||
public final @BlocklistState int blocklistState;
|
||||
|
||||
/**
|
||||
* Signed status for this extension.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче