diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index f566388..c549f79 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -17,7 +17,7 @@ jobs:
steps:
- uses: subosito/flutter-action@v2
with:
- channel: 'master'
+ channel: 'stable'
- uses: actions/checkout@v4
- run: dart --version
- run: |
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 967765c..e569613 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.3.0
+
+- Regenerate the bindings based on Chrome v122
+- Update JS binding for Dart 3.3
+- Require Dart SDK >= 3.3
+
## 0.2.0
- Regenerate the bindings based on Chrome v116
diff --git a/extension_examples/dart/pubspec.lock b/extension_examples/dart/pubspec.lock
index 61afb01..1b741b7 100644
--- a/extension_examples/dart/pubspec.lock
+++ b/extension_examples/dart/pubspec.lock
@@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
- sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49"
+ sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
- version: "65.0.0"
+ version: "67.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
- sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07
+ sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
- version: "6.3.0"
+ version: "6.4.1"
args:
dependency: transitive
description:
@@ -47,7 +47,7 @@ packages:
path: "../.."
relative: true
source: path
- version: "0.2.0"
+ version: "0.3.0"
collection:
dependency: transitive
description:
@@ -140,10 +140,10 @@ packages:
dependency: transitive
description:
name: js
- sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
+ sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
- version: "0.6.7"
+ version: "0.7.1"
lints:
dependency: "direct dev"
description:
@@ -172,18 +172,18 @@ packages:
dependency: transitive
description:
name: meta
- sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
+ sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
- version: "1.11.0"
+ version: "1.12.0"
mime:
dependency: transitive
description:
name: mime
- sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e
+ sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
url: "https://pub.dev"
source: hosted
- version: "1.0.4"
+ version: "1.0.5"
node_preamble:
dependency: transitive
description:
@@ -340,10 +340,10 @@ packages:
dependency: "direct dev"
description:
name: test
- sha256: "3d028996109ad5c253674c7f347822fb994a087614d6f353e6039704b4661ff2"
+ sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073"
url: "https://pub.dev"
source: hosted
- version: "1.25.0"
+ version: "1.25.2"
test_api:
dependency: transitive
description:
@@ -417,4 +417,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
- dart: ">=3.3.0-0 <4.0.0"
+ dart: ">=3.3.0 <4.0.0"
diff --git a/extension_examples/flutter/pubspec.lock b/extension_examples/flutter/pubspec.lock
index f01b006..283fcc1 100644
--- a/extension_examples/flutter/pubspec.lock
+++ b/extension_examples/flutter/pubspec.lock
@@ -31,7 +31,7 @@ packages:
path: "../.."
relative: true
source: path
- version: "0.2.0"
+ version: "0.3.0"
clock:
dependency: transitive
description:
@@ -86,26 +86,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
- sha256: f8cdf1383f5b4672a2693d875f1f239af6bd7e4a8925a17ef7219226db932624
+ sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
- version: "10.0.1"
+ version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
- sha256: a2055640bf5bc903475e4bbdb34e04f8bf698542bee41edec47d337a5939e1ae
+ sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
- version: "2.0.3"
+ version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
- sha256: e62042d479c4c139dd774125ed4dfbde646b8f07ac228e3c1b57a3d91d6d9df4
+ sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
- version: "2.0.2"
+ version: "2.0.1"
lints:
dependency: "direct dev"
description:
@@ -216,5 +216,4 @@ packages:
source: hosted
version: "13.0.0"
sdks:
- dart: ">=3.3.0-0 <4.0.0"
- flutter: ">=3.18.0-18.0.pre.54"
+ dart: ">=3.3.0 <4.0.0"
diff --git a/idl/chrome/accessibility_private.json b/idl/chrome/accessibility_private.json
index ea22e21..e11b674 100644
--- a/idl/chrome/accessibility_private.json
+++ b/idl/chrome/accessibility_private.json
@@ -6,7 +6,7 @@
{
"namespace": "accessibilityPrivate",
"compiler_options": {
- "implemented_in": "chrome/browser/accessibility/accessibility_extension_api_chromeos.h"
+ "implemented_in": "chrome/browser/accessibility/accessibility_extension_api_ash.h"
},
"description": "none",
"platforms": ["chromeos"],
@@ -186,6 +186,12 @@
"description": "Whether to stack focus rings above or below accessibility bubble panels. Note: focus rings will be stacked above most other UI in either case",
"enum": ["aboveAccessibilityBubbles", "belowAccessibilityBubbles"]
},
+ {
+ "id": "AssistiveTechnologyType",
+ "type": "string",
+ "description": "The assistive technology type of this extension.",
+ "enum": ["chromeVox", "selectToSpeak", "switchAccess", "autoClick", "magnifier", "dictation"]
+ },
{
"id": "FocusRingInfo",
"type": "object",
@@ -234,7 +240,7 @@
{
"id": "AccessibilityFeature",
"type": "string",
- "enum": [ "googleTtsLanguagePacks", "dictationContextChecking", "chromevoxTabsDeprecation", "chromevoxSettingsMigration"],
+ "enum": [ "googleTtsLanguagePacks", "dictationContextChecking", "faceGaze", "googleTtsHighQualityVoices"],
"description": "Subset of accessibility features."
},
{
@@ -286,6 +292,14 @@
}
}
},
+ {
+ "id": "ToastType",
+ "type": "string",
+ "enum": [
+ "dictationNoFocusedTextField",
+ "dictationMicMuted"
+ ]
+ },
{
"id": "DlcType",
"type": "string",
@@ -315,6 +329,7 @@
"ttsNlNl",
"ttsPlPl",
"ttsPtBr",
+ "ttsPtPt",
"ttsSiLk",
"ttsSkSk",
"ttsSvSe",
@@ -326,6 +341,15 @@
],
"description": "Types of accessibility-specific DLCs."
},
+ {
+ "id": "TtsVariant",
+ "type": "string",
+ "enum": [
+ "lite",
+ "standard"
+ ],
+ "description": "Variants of TTS voices."
+ },
{
"id": "PumpkinData",
"type": "object",
@@ -383,6 +407,20 @@
"description": "The contents of the file as a Uint8Array."
}
}
+ },
+ {
+ "id": "FaceGazeAssets",
+ "type": "object",
+ "properties": {
+ "model": {
+ "type": "binary",
+ "description": "The contents of the FaceLandmarker model as a Uint8Array."
+ },
+ "wasm": {
+ "type": "binary",
+ "description": "The contents of the vision_wasm_internal.wasm file as a Uint8Array."
+ }
+ }
}
],
"properties": {
@@ -445,6 +483,22 @@
]
}
},
+ {
+ "name": "installFaceGazeAssets",
+ "type": "function",
+ "description": "Called to request an install of the FaceGaze assets DLC, which contains files (e.g. the FaceLandmarker model) required for FaceGaze to work.",
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "description": "Runs when the DLC download finishes.",
+ "parameters": [
+ {
+ "name": "assets",
+ "$ref": "FaceGazeAssets"
+ }
+ ]
+ }
+ },
{
"name": "setNativeAccessibilityEnabled",
"type": "function",
@@ -467,6 +521,11 @@
"type": "array",
"items": { "$ref": "FocusRingInfo" },
"description": "Array of focus rings to draw."
+ },
+ {
+ "name": "atType",
+ "$ref": "AssistiveTechnologyType",
+ "description": "Associates these focus rings with this feature type."
}
]
},
@@ -488,6 +547,18 @@
}
]
},
+ {
+ "name": "setSelectToSpeakFocus",
+ "type": "function",
+ "description": "Informs the system where Select to Speak's reading focus is in screen coordinates. Causes chrome.accessibilityPrivate.onSelectToSpeakFocusChanged to be fired within the AccessibilityCommon component extension.",
+ "parameters": [
+ {
+ "name": "bounds",
+ "$ref": "ScreenRect",
+ "description": "Bounds of currently spoken word (if available) or node (if the spoken node is not a text node)."
+ }
+ ]
+ },
{
"name": "setKeyboardListener",
"type": "function",
@@ -512,7 +583,7 @@
"parameters": [
{
"type": "boolean",
- "name": "enabled",
+ "name": "darken",
"description": "True to darken screen; false to undarken screen."
}
]
@@ -623,6 +694,18 @@
}
]
},
+ {
+ "name": "setCursorPosition",
+ "type": "function",
+ "description": "Sets the cursor position on the screen in absolute screen coordinates.",
+ "parameters": [
+ {
+ "name": "point",
+ "$ref": "ScreenPoint",
+ "description": "The screen point at which to put the cursor."
+ }
+ ]
+ },
{
"name": "sendSyntheticMouseEvent",
"type": "function",
@@ -646,6 +729,17 @@
}
]
},
+ {
+ "name": "clipboardCopyInActiveLacrosGoogleDoc",
+ "type": "function",
+ "description": "Called by the Select-to-Speak extension to request a clipboard copy in the active Lacros Google Docs tab for the copy-paste fallback.",
+ "parameters": [ {
+ "name": "url",
+ "type": "string",
+ "description": "URL of the Google Docs tab."
+ }
+ ]
+ },
{
"name": "handleScrollableBoundsForPointFound",
"type": "function",
@@ -784,6 +878,12 @@
"name": "description",
"type": "string",
"description": "The description to show within the confirmation dialog."
+ },
+ {
+ "name": "cancelName",
+ "type": "string",
+ "description": "The human-readable name of the cancel button.",
+ "optional": true
}
],
"returns_async": {
@@ -861,6 +961,52 @@
]
}
},
+ {
+ "name": "getTtsDlcContents",
+ "type": "function",
+ "description": "Returns the contents of a TTS DLC.",
+ "parameters": [
+ {
+ "name": "dlc",
+ "$ref": "DlcType",
+ "description": "The DLC of interest."
+ },
+ {
+ "name": "variant",
+ "$ref": "TtsVariant",
+ "description": "The TTS voice variant."
+ }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "description": "A callback that is run when the contents are returned.",
+ "parameters": [
+ {
+ "name": "contents",
+ "type": "binary",
+ "description": "The contents of the DLC as a Uint8Array."
+ }
+ ]
+ }
+ },
+ {
+ "name": "getDisplayBounds",
+ "type": "function",
+ "description": "Returns the bounds of the displays in density-independent pixels in screen coordinates.",
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "description": "A callback that is run when the result is returned.",
+ "parameters": [
+ {
+ "type": "array",
+ "items": { "$ref": "ScreenRect" },
+ "name": "rects",
+ "description": "Array of rects represeting the display bounds in screen coordinates for all displays."
+ }
+ ]
+ }
+ },
{
"name": "isLacrosPrimary",
"type": "function",
@@ -877,6 +1023,16 @@
}
]
}
+ },
+ {
+ "name": "showToast",
+ "type": "function",
+ "description": "Displays an accessibility-related toast.",
+ "parameters": [{
+ "name": "type",
+ "$ref": "ToastType",
+ "description": "The type of toast to show."
+ }]
}
],
"events": [
@@ -916,6 +1072,24 @@
"description": "Fired when the user is no longer holding down two fingers (including releasing one, holding down three, or moving them).",
"parameters": []
},
+ {
+ "name": "onSelectToSpeakContextMenuClicked",
+ "type": "function",
+ "description": "Fired when the Select to Speak context menu is clicked from outside the context of the Select to Speak extension.",
+ "parameters": []
+ },
+ {
+ "name": "onSelectToSpeakFocusChanged",
+ "type": "function",
+ "description": "Fired when the Select to Speak reading focus changes.",
+ "parameters": [
+ {
+ "name": "bounds",
+ "$ref": "ScreenRect",
+ "description": "Select to Speak's focus bounds in global screen coordinates."
+ }
+ ]
+ },
{
"name": "onSelectToSpeakStateChangeRequested",
"type": "function",
diff --git a/idl/chrome/accessibility_service_private.idl b/idl/chrome/accessibility_service_private.idl
new file mode 100644
index 0000000..71adf7b
--- /dev/null
+++ b/idl/chrome/accessibility_service_private.idl
@@ -0,0 +1,30 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// API which provides support for ChromeOS Accessibility features in the
+// browser.
+
+[platforms=("chromeos", "lacros"),
+ implemented_in="chrome/browser/chromeos/extensions/accessibility_service_private.h"]
+
+namespace accessibilityServicePrivate {
+ callback VoidCallback = void();
+
+ interface Functions {
+ // Called when Select to Speak in ChromeOS should speak the current
+ // text selection; fired when the context menu option was clicked in
+ // a selection context.
+ [supportsPromises] static void speakSelectedText(
+ optional VoidCallback callback);
+ };
+
+ interface Events {
+ // Called when Select to Speak in ChromeOS wants a clipboard copy
+ // event to be performed on the active and focused tab with the
+ // given URL. This is fired when Select to Speak is trying to speak
+ // with search+s but cannot find a selection and the focused node
+ // is in a Google Docs page.
+ static void clipboardCopyInActiveGoogleDoc(DOMString url);
+ };
+};
\ No newline at end of file
diff --git a/idl/chrome/action.json b/idl/chrome/action.json
index 43e07d9..d488e65 100644
--- a/idl/chrome/action.json
+++ b/idl/chrome/action.json
@@ -194,7 +194,7 @@
}, {
"name": "getBadgeText",
"type": "function",
- "description": "Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned. If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.",
+ "description": "Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned. If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.",
"parameters": [{
"name": "details",
"$ref": "TabDetails"
diff --git a/idl/chrome/activity_log_private.json b/idl/chrome/activity_log_private.json
index 46b94e9..c3516c9 100644
--- a/idl/chrome/activity_log_private.json
+++ b/idl/chrome/activity_log_private.json
@@ -6,9 +6,6 @@
{
"namespace": "activityLogPrivate",
"description": "none",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "ExtensionActivityType",
diff --git a/idl/chrome/autofill_private.idl b/idl/chrome/autofill_private.idl
index 423bf24..5420682 100644
--- a/idl/chrome/autofill_private.idl
+++ b/idl/chrome/autofill_private.idl
@@ -4,7 +4,6 @@
// Use the chrome.autofillPrivate API to add, remove, or update
// autofill data from the settings UI.
-[modernised_enums]
namespace autofillPrivate {
// Subset of properties from the user account (signin component, AccountInfo).
dictionary AccountInfo {
@@ -13,18 +12,105 @@ namespace autofillPrivate {
boolean isEligibleForAddressAccountStorage;
};
- // Fields used as part of an address.
- enum AddressField {
- HONORIFIC, // Honorific fields are not expected from getAddressComponents.
- FULL_NAME,
+ // A copy of FieldType from
+ // chrome/common/extensions/api/autofill_private.idl
+ enum FieldType {
+ NO_SERVER_DATA,
+ UNKNOWN_TYPE,
+ EMPTY_TYPE,
+ NAME_FIRST,
+ NAME_MIDDLE,
+ NAME_LAST,
+ NAME_MIDDLE_INITIAL,
+ NAME_FULL,
+ NAME_SUFFIX,
+ EMAIL_ADDRESS,
+ PHONE_HOME_NUMBER,
+ PHONE_HOME_CITY_CODE,
+ PHONE_HOME_COUNTRY_CODE,
+ PHONE_HOME_CITY_AND_NUMBER,
+ PHONE_HOME_WHOLE_NUMBER,
+ ADDRESS_HOME_LINE1,
+ ADDRESS_HOME_LINE2,
+ ADDRESS_HOME_APT_NUM,
+ ADDRESS_HOME_CITY,
+ ADDRESS_HOME_STATE,
+ ADDRESS_HOME_ZIP,
+ ADDRESS_HOME_COUNTRY,
+ CREDIT_CARD_NAME_FULL,
+ CREDIT_CARD_NUMBER,
+ CREDIT_CARD_EXP_MONTH,
+ CREDIT_CARD_EXP_2_DIGIT_YEAR,
+ CREDIT_CARD_EXP_4_DIGIT_YEAR,
+ CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR,
+ CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR,
+ CREDIT_CARD_TYPE,
+ CREDIT_CARD_VERIFICATION_CODE,
COMPANY_NAME,
- ADDRESS_LINES,
- ADDRESS_LEVEL_1,
- ADDRESS_LEVEL_2,
- ADDRESS_LEVEL_3,
- POSTAL_CODE,
- SORTING_CODE,
- COUNTRY_CODE
+ FIELD_WITH_DEFAULT_VALUE,
+ MERCHANT_EMAIL_SIGNUP,
+ MERCHANT_PROMO_CODE,
+ PASSWORD,
+ ACCOUNT_CREATION_PASSWORD,
+ ADDRESS_HOME_STREET_ADDRESS,
+ ADDRESS_HOME_SORTING_CODE,
+ ADDRESS_HOME_DEPENDENT_LOCALITY,
+ ADDRESS_HOME_LINE3,
+ NOT_ACCOUNT_CREATION_PASSWORD,
+ USERNAME,
+ USERNAME_AND_EMAIL_ADDRESS,
+ NEW_PASSWORD,
+ PROBABLY_NEW_PASSWORD,
+ NOT_NEW_PASSWORD,
+ CREDIT_CARD_NAME_FIRST,
+ CREDIT_CARD_NAME_LAST,
+ PHONE_HOME_EXTENSION,
+ CONFIRMATION_PASSWORD,
+ AMBIGUOUS_TYPE,
+ SEARCH_TERM,
+ PRICE,
+ NOT_PASSWORD,
+ SINGLE_USERNAME,
+ NOT_USERNAME,
+ UPI_VPA,
+ ADDRESS_HOME_STREET_NAME,
+ ADDRESS_HOME_HOUSE_NUMBER,
+ ADDRESS_HOME_SUBPREMISE,
+ ADDRESS_HOME_OTHER_SUBUNIT,
+ NAME_LAST_FIRST,
+ NAME_LAST_CONJUNCTION,
+ NAME_LAST_SECOND,
+ NAME_HONORIFIC_PREFIX,
+ ADDRESS_HOME_ADDRESS,
+ ADDRESS_HOME_ADDRESS_WITH_NAME,
+ ADDRESS_HOME_FLOOR,
+ NAME_FULL_WITH_HONORIFIC_PREFIX,
+ BIRTHDATE_DAY,
+ BIRTHDATE_MONTH,
+ BIRTHDATE_4_DIGIT_YEAR,
+ PHONE_HOME_CITY_CODE_WITH_TRUNK_PREFIX,
+ PHONE_HOME_CITY_AND_NUMBER_WITHOUT_TRUNK_PREFIX,
+ PHONE_HOME_NUMBER_PREFIX,
+ PHONE_HOME_NUMBER_SUFFIX,
+ IBAN_VALUE,
+ CREDIT_CARD_STANDALONE_VERIFICATION_CODE,
+ NUMERIC_QUANTITY,
+ ONE_TIME_CODE,
+ DELIVERY_INSTRUCTIONS,
+ ADDRESS_HOME_OVERFLOW,
+ ADDRESS_HOME_LANDMARK,
+ ADDRESS_HOME_OVERFLOW_AND_LANDMARK,
+ ADDRESS_HOME_ADMIN_LEVEL2,
+ ADDRESS_HOME_STREET_LOCATION,
+ ADDRESS_HOME_BETWEEN_STREETS,
+ ADDRESS_HOME_BETWEEN_STREETS_OR_LANDMARK,
+ ADDRESS_HOME_BETWEEN_STREETS_1,
+ ADDRESS_HOME_BETWEEN_STREETS_2,
+ SINGLE_USERNAME_FORGOT_PASSWORD,
+ ADDRESS_HOME_APT,
+ ADDRESS_HOME_APT_TYPE,
+ SINGLE_USERNAME_WITH_INTERMEDIATE_VALUES,
+ MAX_VALID_FIELD_TYPE
};
// The address source origin. Describes where the address is stored.
@@ -73,57 +159,22 @@ namespace autofillPrivate {
boolean? isVirtualCardEnrolled;
};
+ // Represents single entry of the autofill profile, containing field type and
+ // the corresponding field value.
+ dictionary AddressField {
+ FieldType type;
+ DOMString value;
+ };
+
// An address entry which can be saved in the autofill section of the
// settings UI.
dictionary AddressEntry {
// Globally unique identifier for this entry.
DOMString? guid;
- DOMString[]? fullNames;
-
- // A honorific title added to the name. E.g. "Mr.", "Dr.", "Her Royal
- // Majesty".
- DOMString? honorific;
-
- DOMString? companyName;
-
- // Street address (multiple lines, newlines preserved).
- DOMString? addressLines;
-
- // The broadest administrative level in the address, i.e. the province
- // within which the locality is found; for example, in the US, this would be
- // the state; in Switzerland it would be the canton; in the UK, the post
- // town.
- DOMString? addressLevel1;
-
- // The second administrative level, in addresses with two or more
- // administrative levels; in the countries with two administrative levels,
- // this would typically be the city, town, village, or other locality within
- // which the relevant street address is found.
- DOMString? addressLevel2;
-
- // The third administrative level, in addresses with three or more
- // administrative levels.
- DOMString? addressLevel3;
-
- // Postal code, post code, ZIP code, CEDEX code (if CEDEX, append "CEDEX",
- // and the arrondissement, if relevant, to the address-level2 field).
- DOMString? postalCode;
-
- // A sorting code is similar to a postal code. However, whereas a postal
- // code normally refers to a single geographical location, a sorting code
- // often does not. Instead, a sorting code is assigned to an organization,
- // which might be geographically distributed. The most prominent example of
- // a sorting code system is CEDEX in France.
- DOMString? sortingCode;
-
- // A two-character string representing the address' country. See
- // autofill_country.cc for a list of valid codes.
- DOMString? countryCode;
-
- DOMString[]? phoneNumbers;
-
- DOMString[]? emailAddresses;
+ // Fields have to be stored in the array with every field style stored only
+ // once.
+ AddressField[] fields;
DOMString? languageCode;
@@ -143,7 +194,7 @@ namespace autofillPrivate {
// different components to their addresses.
dictionary AddressComponent {
// The field type.
- AddressField field;
+ FieldType field;
// The name of the field.
DOMString fieldName;
@@ -185,6 +236,9 @@ namespace autofillPrivate {
// Globally unique identifier for this entry.
DOMString? guid;
+ // The card's instrument ID from the GPay server, if applicable.
+ DOMString? instrumentId;
+
// Name of the person who owns the credit card.
DOMString? name;
@@ -206,6 +260,9 @@ namespace autofillPrivate {
// Credit card's image source.
DOMString? imageSrc;
+ // Credit card's masked cvc.
+ DOMString? cvc;
+
AutofillMetadata? metadata;
};
@@ -224,31 +281,15 @@ namespace autofillPrivate {
AutofillMetadata? metadata;
};
- // Parameters to be passed to validatePhoneNumbers().
- dictionary ValidatePhoneParams {
- // The phone numbers to validate.
- DOMString[] phoneNumbers;
-
- // The index into |phoneNumbers| at which the newly-added/edited phone
- // number resides.
- long indexOfNewNumber;
-
- // A two-character string representing the address' country. See
- // autofill_country.cc for a list of valid codes.
- DOMString countryCode;
- };
-
callback GetAccountInfoCallback = void(optional AccountInfo accountInfo);
callback GetCountryListCallback = void(CountryEntry[] countries);
callback GetAddressComponentsCallback = void(AddressComponents components);
callback GetAddressListCallback = void(AddressEntry[] entries);
- callback ValidatePhoneNumbersCallback =
- void(DOMString[] validatedPhoneNumbers);
callback GetCreditCardListCallback = void(CreditCardEntry[] entries);
callback GetIbanListCallback = void(IbanEntry[] entries);
- callback GetUpiIdListCallback = void(DOMString[] entries);
callback IsValidIbanCallback = void(boolean isValid);
- callback CheckForUserAuthCallback = void(boolean isUserAuthSuccessful);
+ callback GetCreditCardCallback = void(optional CreditCardEntry card);
+ callback CheckForDeviceAuthCallback = void(boolean isDeviceAuthAvailable);
interface Functions {
// Gets currently signed-in user profile info, no value is returned if
@@ -295,15 +336,6 @@ namespace autofillPrivate {
// |guid|: ID of the entry to remove.
static void removeEntry(DOMString guid);
- // Validates a newly-added phone number and invokes the callback with a list
- // of validated numbers. Note that if the newly-added number was invalid, it
- // will not be returned in the list of valid numbers.
- // |params|: The parameters to this function.
- // |callback|: Callback which will be called with validated phone numbers.
- [supportsPromises] static void validatePhoneNumbers(
- ValidatePhoneParams params,
- ValidatePhoneNumbersCallback callback);
-
// Gets the list of credit cards.
// |callback|: Callback which will be called with the list of credit cards.
[supportsPromises] static void getCreditCardList(
@@ -335,10 +367,6 @@ namespace autofillPrivate {
// Enables or disables FIDO Authentication for credit card unmasking.
static void setCreditCardFIDOAuthEnabledState(boolean enabled);
- // Gets the list of UPI IDs (a.k.a. Virtual Payment Addresses).
- // |callback|: Callback which will be called with the list of UPI IDs.
- [supportsPromises] static void getUpiIdList(GetUpiIdListCallback callback);
-
// Enrolls a credit card into virtual cards.
// |cardId|: The server side id of the credit card to be enrolled. Note it
// refers to the legacy server id of credit cards, not the instrument ids.
@@ -354,10 +382,21 @@ namespace autofillPrivate {
// will then flip the mandatory auth toggle.
static void authenticateUserAndFlipMandatoryAuthToggle();
- // Authenticates the user via device authentication and it would return
- // the result of user auth. If the auth was successful, we will show
- // the edit card dialog for the Local card.
- [supportsPromises] static void authenticateUserToEditLocalCard(CheckForUserAuthCallback callback);
+ // Returns the local card based on the `guid` provided. The user could
+ // also be challenged with a reauth if that is enabled. For a successful
+ // auth, the local card is returned otherwise return a null object.
+ [supportsPromises] static void getLocalCard(
+ DOMString guid, GetCreditCardCallback callback);
+
+ // Returns true if there is authentication available on this device
+ // (biometric or screen lock), false otherwise.
+ [supportsPromises] static void checkIfDeviceAuthAvailable(
+ CheckForDeviceAuthCallback callback);
+
+ // Bulk delete all the CVCs (server and local) from the local webdata
+ // database. For server CVCs, this will also clear them from the Chrome
+ // sync server and thus other devices.
+ static void bulkDeleteAllCvcs();
};
interface Events {
diff --git a/idl/chrome/autotest_private.idl b/idl/chrome/autotest_private.idl
index a3c876a..a97b99a 100644
--- a/idl/chrome/autotest_private.idl
+++ b/idl/chrome/autotest_private.idl
@@ -5,7 +5,6 @@
// API for integration testing. To be used on test images with a test component
// extension.
[platforms=("chromeos"),
- modernised_enums,
implemented_in="chrome/browser/ash/extensions/autotest_private/autotest_private_api.h"]
namespace autotestPrivate {
@@ -71,6 +70,16 @@ namespace autotestPrivate {
UninstalledByMigration
};
+ // A mapping of arc::mojom::WakefulnessMode
+ enum WakefulnessMode {
+ Unknown,
+ Asleep,
+ Awake,
+ Dreaming,
+ Dozing
+ };
+ callback WakefulnessModeCallback = void (WakefulnessMode mode);
+
// A subset of Window State types in ash::WindowStateType. We may add more
// into the set in the future.
enum WindowStateType {
@@ -80,6 +89,8 @@ namespace autotestPrivate {
Fullscreen,
PrimarySnapped,
SecondarySnapped,
+ Pinned,
+ TrustedPinned,
PIP,
Floated
};
@@ -278,7 +289,8 @@ namespace autotestPrivate {
Mounting,
Unavailable,
Stopped,
- CreatingLogFile,
+ PreparingForLaunch,
+ WaitingOwnerFetch,
PreLaunched,
Starting,
Running,
@@ -288,8 +300,6 @@ namespace autotestPrivate {
// A mapping of crosapi::browser_util::LacrosMode
enum LacrosMode {
Disabled,
- SideBySide,
- Primary,
Only
};
@@ -303,7 +313,11 @@ namespace autotestPrivate {
DOMString lacrosPath;
// Specifies the mode Lacros is currently running.
// For a full list of supported mode, see LacrosMode enum definition.
+ // DEPRECATED: please use isEnabled.
+ // TODO(crbug.com/1494005): Remove this field after tests are fixed.
LacrosMode mode;
+ // True iff Lacros is enabled for the current user session's primary user.
+ boolean isEnabled;
};
callback GetLacrosInfoCallback = void (LacrosInfo info);
@@ -362,7 +376,9 @@ namespace autotestPrivate {
dictionary ArcAppTracingInfo {
boolean success;
double fps;
+ double perceivedFps;
double commitDeviation;
+ double presentDeviation;
double renderQuality;
};
@@ -428,14 +444,6 @@ namespace autotestPrivate {
callback GetAllInstalledAppsCallback = void (App[] apps);
- dictionary CryptohomeRecoveryDataDict {
- DOMString reauthProofToken;
- DOMString refreshToken;
- };
-
- callback GetCryptohomeRecoveryDataCallback = void (
- CryptohomeRecoveryDataDict dict);
-
dictionary ShelfItem {
DOMString appId;
DOMString launchId;
@@ -769,7 +777,7 @@ namespace autotestPrivate {
// Event name
DOMString name;
// Number of frames actually shown for this animation.
- long microsecnods_since_unix_epoch;
+ double microsecnods_since_unix_epoch;
};
// Callback invoked to report the collection ui::LoginEventRecorder data
@@ -819,6 +827,27 @@ namespace autotestPrivate {
callback IsFeatureEnabledCallback = void(boolean enabled);
+ // Response data for getCurrentInputMethodDescriptor.
+ // Add more fields from ash/input_method/InputMethodDescriptor as needed.
+ dictionary GetCurrentInputMethodDescriptorData {
+ DOMString keyboardLayout;
+ };
+
+ // Response callback for current input method keyboard layout.
+ callback GetCurrentInputMethodDescriptorCallback = void
+ (GetCurrentInputMethodDescriptorData data);
+
+ // Response callback to report if a field trial exists and has been activated.
+ callback IsFieldTrialActiveCallback = void(boolean active);
+
+ // Request data containing the mock responses from
+ // overrideOrcaResponseForTesting.
+ dictionary OrcaResponseArray {
+ DOMString[] responses;
+ };
+
+ callback OverrideOrcaResponseForTestingCallback = void(boolean success);
+
interface Functions {
// Must be called to allow autotestPrivateAPI events to be fired.
static void initializeEvents();
@@ -942,10 +971,6 @@ namespace autotestPrivate {
DOMString packageName,
GetArcPackageCallback callback);
- // Gets the data needed for Cryptohome Recovery.
- [supportsPromises] static void getCryptohomeRecoveryData(
- GetCryptohomeRecoveryDataCallback callback);
-
// Waits for system web apps to complete the installation.
[supportsPromises] static void waitForSystemWebAppsInstall(
VoidCallback callback);
@@ -1084,12 +1109,6 @@ namespace autotestPrivate {
DOMString display_id,
TakeScreenshotCallback callback);
- // Makes a basic request to ML Service, triggering 1. ML Service
- // daemon startup, and 2. the initial D-Bus -> Mojo IPC bootstrap.
- // |callback|: Called when the operation has completed.
- [supportsPromises] static void bootstrapMachineLearningService(
- VoidCallback callback);
-
// Triggers an on-demand update of smart dim component and checks whether
// it's successfully loaded by smart dim ml_agent.
// |callback|: Called when the operation has completed.
@@ -1146,6 +1165,10 @@ namespace autotestPrivate {
any value,
VoidCallback callback);
+ // Clears value for the specified user pref in the pref tree.
+ [supportsPromises] static void clearAllowedPref(DOMString pref_name,
+ VoidCallback callback);
+
// DEPRECATED: use SetAllowedPref instead, see crbug/1262034
// Set value for the specified user pref in the pref tree.
[supportsPromises] static void setWhitelistedPref(DOMString pref_name,
@@ -1581,6 +1604,37 @@ namespace autotestPrivate {
// a Chrome uprev into ChromeOS changed the default feature state.
[supportsPromises] static void isFeatureEnabled(
DOMString feature_name, IsFeatureEnabledCallback callback);
+
+ // Returns keyboard layout used for current input method.
+ [supportsPromises] static void getCurrentInputMethodDescriptor(
+ GetCurrentInputMethodDescriptorCallback callback);
+
+ // Overrides the response from Orca Provider and returns the boolean value
+ // that indicates if the overriding is successful or not.
+ [supportsPromises] static void overrideOrcaResponseForTesting(
+ OrcaResponseArray array,
+ OverrideOrcaResponseForTestingCallback callback);
+
+ // ARC set interactive enable/disable state.
+ // |enabled|: Enable ARC interactive.
+ // |callback|: Called when the operation sent to ARC by mojo.
+ [supportsPromises] static void setArcInteractiveState(
+ boolean enabled, VoidCallback callback);
+
+ // Returns whether a field trial exists and has been activated.
+ [supportsPromises] static void isFieldTrialActive(
+ DOMString trial_name,
+ DOMString group_name,
+ IsFieldTrialActiveCallback callback);
+
+ // ARC get wakefulness mode.
+ [supportsPromises] static void getArcWakefulnessMode(
+ WakefulnessModeCallback callback);
+
+ // Sets the default device language.
+ // A restart is required for this change to take effect.
+ // |value|: the locale of the language.
+ static void setDeviceLanguage(DOMString locale, VoidCallback callback);
};
interface Events {
diff --git a/idl/chrome/bookmarks.json b/idl/chrome/bookmarks.json
index e523d06..4f23125 100644
--- a/idl/chrome/bookmarks.json
+++ b/idl/chrome/bookmarks.json
@@ -6,9 +6,6 @@
{
"namespace": "bookmarks",
"description": "Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page.",
- "compiler_options": {
- "modernised_enums": true
- },
"properties": {
"MAX_WRITE_OPERATIONS_PER_HOUR": {
"value": 1000000,
diff --git a/idl/chrome/braille_display_private.idl b/idl/chrome/braille_display_private.idl
index 171c33d..d686809 100644
--- a/idl/chrome/braille_display_private.idl
+++ b/idl/chrome/braille_display_private.idl
@@ -3,7 +3,6 @@
// found in the LICENSE file.
// Braille display access private API.
-[modernised_enums]
namespace brailleDisplayPrivate {
// Braille display keyboard command.
enum KeyCommand {
diff --git a/idl/chrome/browser_action.json b/idl/chrome/browser_action.json
index 7181559..939d48a 100644
--- a/idl/chrome/browser_action.json
+++ b/idl/chrome/browser_action.json
@@ -5,7 +5,7 @@
[
{
"namespace": "browserAction",
- "description": "Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can have a tooltip, a badge, and a popup.",
+ "description": "Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can have a tooltip, a badge, and a popup.",
"compiler_options": {
"implemented_in": "chrome/browser/extensions/api/extension_action/extension_action_api.h"
},
diff --git a/idl/chrome/certificate_provider.idl b/idl/chrome/certificate_provider.idl
index d4972fa..cf51548 100644
--- a/idl/chrome/certificate_provider.idl
+++ b/idl/chrome/certificate_provider.idl
@@ -8,28 +8,32 @@ namespace certificateProvider {
// Types of supported cryptographic signature algorithms.
enum Algorithm {
- // RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1 hashing. The
- // extension must not prepend a DigestInfo prefix but only add PKCS#1
- // padding. This algorithm is deprecated and will never be requested by
- // Chrome as of version 109.
+ // Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1
+ // hashing. The extension must not prepend a DigestInfo prefix but only
+ // add PKCS#1 padding. This algorithm is deprecated and will never be requested
+ // by Chrome as of version 109.
RSASSA_PKCS1_v1_5_MD5_SHA1,
- // RSASSA PKCS#1 v1.5 signature algorithm with the SHA-1 hash function.
+ // Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ // with the SHA-1 hash function.
RSASSA_PKCS1_v1_5_SHA1,
- // RSASSA PKCS#1 v1.5 signature algorithm with the SHA-256 hashing function.
+ // Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ // with the SHA-256 hashing function.
RSASSA_PKCS1_v1_5_SHA256,
- // RSASSA PKCS#1 v1.5 signature algorithm with the SHA-384 hashing function.
+ // Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ // with the SHA-384 hashing function.
RSASSA_PKCS1_v1_5_SHA384,
- // RSASSA PKCS#1 v1.5 signature algorithm with the SHA-512 hashing function.
+ // Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ // with the SHA-512 hashing function.
RSASSA_PKCS1_v1_5_SHA512,
- // Since Chrome 89. RSASSA PSS signature algorithm with the SHA-256 hashing
+ // Specifies the RSASSA PSS signature algorithm with the SHA-256 hashing
// function, MGF1 mask generation function and the salt of the same size as
// the hash.
RSASSA_PSS_SHA256,
- // Since Chrome 89. RSASSA PSS signature algorithm with the SHA-384 hashing
+ // Specifies the RSASSA PSS signature algorithm with the SHA-384 hashing
// function, MGF1 mask generation function and the salt of the same size as
// the hash.
RSASSA_PSS_SHA384,
- // Since Chrome 89. RSASSA PSS signature algorithm with the SHA-512 hashing
+ // Specifies the RSASSA PSS signature algorithm with the SHA-512 hashing
// function, MGF1 mask generation function and the salt of the same size as
// the hash.
RSASSA_PSS_SHA512
@@ -37,8 +41,8 @@ namespace certificateProvider {
// Types of errors that the extension can report.
enum Error {
- // General error that cannot be represented by other more specific error
- // codes.
+ // General error that cannot be represented by other more specific
+ // error codes.
GENERAL_ERROR
};
@@ -94,25 +98,36 @@ namespace certificateProvider {
// Deprecated. Replaced by $(ref:Algorithm).
enum Hash {
+ // Specifies the MD5 and SHA1 hashing algorithms.
MD5_SHA1,
+ // Specifies the SHA1 hashing algorithm.
SHA1,
+ // Specifies the SHA256 hashing algorithm.
SHA256,
+ // Specifies the SHA384 hashing algorithm.
SHA384,
+ // Specifies the SHA512 hashing algorithm.
SHA512
};
// The type of code being requested by the extension with requestPin function.
enum PinRequestType {
+ // Specifies the requested code is a PIN.
PIN,
+ // Specifies the requested code is a PUK.
PUK
};
// The types of errors that can be presented to the user through the
// requestPin function.
enum PinRequestErrorType {
+ // Specifies the PIN is invalid.
INVALID_PIN,
+ // Specifies the PUK is invalid.
INVALID_PUK,
+ // Specifies the maximum attempt number has been exceeded.
MAX_ATTEMPTS_EXCEEDED,
+ // Specifies that the error cannot be represented by the above types.
UNKNOWN_ERROR
};
diff --git a/idl/chrome/commands.json b/idl/chrome/commands.json
index f3b512a..b13b3bb 100644
--- a/idl/chrome/commands.json
+++ b/idl/chrome/commands.json
@@ -51,7 +51,7 @@
{
"name": "getAll",
"type": "function",
- "description": "Returns all the registered extension commands for this extension and their shortcut (if active).",
+ "description": "Returns all the registered extension commands for this extension and their shortcut (if active). Before Chrome 110, this command did not return _execute_action.",
"parameters": [],
"returns_async": {
"name": "callback",
diff --git a/idl/chrome/content_settings.json b/idl/chrome/content_settings.json
index d0a438e..fac35d0 100644
--- a/idl/chrome/content_settings.json
+++ b/idl/chrome/content_settings.json
@@ -8,8 +8,7 @@
"namespace": "contentSettings",
"description": "Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.",
"compiler_options": {
- "generate_type_functions": true,
- "modernised_enums": true
+ "generate_type_functions": true
},
"types": [
{
@@ -177,6 +176,11 @@
"type": "string",
"enum": ["allow", "block"]
},
+ {
+ "id": "ClipboardContentSetting",
+ "type": "string",
+ "enum": ["allow", "block", "ask"]
+ },
{
"id": "CookiesContentSetting",
"type": "string",
@@ -332,6 +336,14 @@
{"$ref":"MicrophoneContentSetting"}
]
},
+ "clipboard": {
+ "$ref": "ContentSetting",
+ "description": "Whether to allow sites to access the clipboard via advanced capabilities of the Async Clipboard API. \"Advanced\" capabilities include anything besides writing built-in formats after a user gesture, i.e. the ability to read, the ability to write custom formats, and the ability to write without a user gesture. One of allow: Allow sites to use advanced clipboard capabilities, block: Don't allow sites to use advanced clipboard capabilties, ask: Ask when a site wants to use advanced clipboard capabilities. Default is ask. The primary URL is the URL of the document which requested clipboard access. The secondary URL is not used.",
+ "value": [
+ "clipboard",
+ {"$ref":"ClipboardContentSetting"}
+ ]
+ },
"camera": {
"$ref": "ContentSetting",
"description": "Whether to allow sites to access the camera. One of allow: Allow sites to access the camera, block: Don't allow sites to access the camera, ask: Ask when a site wants to access the camera. Default is ask. The primary URL is the URL of the document which requested camera access. The secondary URL is not used. NOTE: The 'allow' setting is not valid if both patterns are ''.",
diff --git a/idl/chrome/context_menus.json b/idl/chrome/context_menus.json
index 939bc90..6d6584d 100644
--- a/idl/chrome/context_menus.json
+++ b/idl/chrome/context_menus.json
@@ -151,7 +151,7 @@
"onclick": {
"type": "function",
"optional": true,
- "description": "A function that is called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).",
+ "description": "A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, they should register a listener for $(ref:contextMenus.onClicked).",
"parameters": [
{
"name": "info",
@@ -177,7 +177,7 @@
"type": "array",
"items": {"type": "string"},
"optional": true,
- "description": "Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see Match Patterns."
+ "description": "Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see Match Patterns."
},
"targetUrlPatterns": {
"type": "array",
diff --git a/idl/chrome/cookies.json b/idl/chrome/cookies.json
index 44302c2..05d29c4 100644
--- a/idl/chrome/cookies.json
+++ b/idl/chrome/cookies.json
@@ -6,9 +6,6 @@
{
"namespace": "cookies",
"description": "Use the chrome.cookies API to query and modify cookies, and to be notified when they change.",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "SameSiteStatus",
@@ -16,6 +13,14 @@
"enum": ["no_restriction", "lax", "strict", "unspecified"],
"description": "A cookie's 'SameSite' state (https://tools.ietf.org/html/draft-west-first-party-cookies). 'no_restriction' corresponds to a cookie set with 'SameSite=None', 'lax' to 'SameSite=Lax', and 'strict' to 'SameSite=Strict'. 'unspecified' corresponds to a cookie set without the SameSite attribute."
},
+ {
+ "id": "CookiePartitionKey",
+ "type": "object",
+ "description": "Represents a partitioned cookie's partition key.",
+ "properties": {
+ "topLevelSite": {"type": "string", "optional": true, "description": "The top-level site the partitioned cookie is available in."}
+ }
+ },
{
"id": "Cookie",
"type": "object",
@@ -31,7 +36,8 @@
"sameSite": {"$ref": "SameSiteStatus", "description": "The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests)."},
"session": {"type": "boolean", "description": "True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date."},
"expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies."},
- "storeId": {"type": "string", "description": "The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."}
+ "storeId": {"type": "string", "description": "The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."},
+ "partitionKey": {"$ref": "CookiePartitionKey", "optional": true, "description": "The partition key for reading or modifying cookies with the Partitioned attribute."}
}
},
{
@@ -56,7 +62,8 @@
"properties": {
"url": {"type": "string", "description": "The URL with which the cookie to access is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
"name": {"type": "string", "description": "The name of the cookie to access."},
- "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."}
+ "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."},
+ "partitionKey": {"$ref": "CookiePartitionKey", "optional": true, "description": "The partition key for reading or modifying cookies with the Partitioned attribute."}
}
}
],
@@ -83,7 +90,7 @@
{
"name": "getAll",
"type": "function",
- "description": "Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.",
+ "description": "Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first. This method only retrieves cookies for domains that the extension has host permissions to.",
"parameters": [
{
"type": "object",
@@ -96,7 +103,8 @@
"path": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose path exactly matches this string."},
"secure": {"type": "boolean", "optional": true, "description": "Filters the cookies by their Secure property."},
"session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."},
- "storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."}
+ "storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."},
+ "partitionKey": {"$ref": "CookiePartitionKey", "optional": true, "description": "The partition key for reading or modifying cookies with the Partitioned attribute."}
}
}
],
@@ -128,7 +136,8 @@
"httpOnly": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as HttpOnly. Defaults to false."},
"sameSite": {"$ref": "SameSiteStatus", "optional": true, "description": "The cookie's same-site status. Defaults to \"unspecified\", i.e., if omitted, the cookie is set without specifying a SameSite attribute."},
"expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."},
- "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."}
+ "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."},
+ "partitionKey": {"$ref": "CookiePartitionKey", "optional": true, "description": "The partition key for reading or modifying cookies with the Partitioned attribute."}
}
}
],
@@ -166,7 +175,8 @@
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
"name": {"type": "string", "description": "The name of the cookie that's been removed."},
- "storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."}
+ "storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."},
+ "partitionKey": {"$ref": "CookiePartitionKey", "optional": true, "description": "The partition key for reading or modifying cookies with the Partitioned attribute."}
}
}
]
diff --git a/idl/chrome/dashboard_private.json b/idl/chrome/dashboard_private.json
index 9b75b92..3e6000a 100644
--- a/idl/chrome/dashboard_private.json
+++ b/idl/chrome/dashboard_private.json
@@ -6,9 +6,6 @@
{
"namespace":"dashboardPrivate",
"description": "none",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "Result",
diff --git a/idl/chrome/debugger.json b/idl/chrome/debugger.json
index 7b99b9f..70cb05a 100644
--- a/idl/chrome/debugger.json
+++ b/idl/chrome/debugger.json
@@ -6,9 +6,6 @@
{
"namespace": "debugger",
"description": "The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks.",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "Debuggee",
diff --git a/idl/chrome/declarative_content.json b/idl/chrome/declarative_content.json
index ec474fd..fc35c7a 100644
--- a/idl/chrome/declarative_content.json
+++ b/idl/chrome/declarative_content.json
@@ -72,7 +72,7 @@
},
"isBookmarked": {
"type": "boolean",
- "description": "Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission.",
+ "description": "Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission.",
"optional": true
},
"instanceType": {
@@ -83,7 +83,7 @@
},
{
"id": "ShowPageAction",
- "description": "Declarative event action that shows the extension's $(ref:pageAction page action) while the corresponding conditions are met. This action can be used without host permissions, but the extension must have a page action. If the extension has the activeTab permission, clicking the page action grants access to the active tab.",
+ "description": "A declarative event action that sets the extension's $(ref:pageAction page action) to an enabled state while the corresponding conditions are met. This action can be used without host permissions, but the extension must have a page action. If the extension has the activeTab permission, clicking the page action grants access to the active tab.
On pages where the conditions are not met the extension's toolbar action will be grey-scale, and clicking it will open the context menu, instead of triggering the action.
",
"deprecated": "Please use $(ref:declarativeContent.ShowAction).",
"type": "object",
"properties": {
@@ -95,7 +95,7 @@
},
{
"id": "ShowAction",
- "description": "Declarative event action that shows the extension's toolbar action ($(ref:pageAction page action) or $(ref:browserAction browser action)) while the corresponding conditions are met. This action can be used without host permissions. If the extension has the activeTab permission, clicking the page action grants access to the active tab.",
+ "description": "A declarative event action that sets the extension's toolbar $(ref:action action) to an enabled state while the corresponding conditions are met. This action can be used without host permissions. If the extension has the activeTab permission, clicking the page action grants access to the active tab.
On pages where the conditions are not met the extension's toolbar action will be grey-scale, and clicking it will open the context menu, instead of triggering the action.
",
"type": "object",
"properties": {
"instanceType": {
@@ -106,7 +106,7 @@
},
{
"id": "SetIcon",
- "description": "Declarative event action that sets the n-dip square icon for the extension's $(ref:pageAction page action) or $(ref:browserAction browser action) while the corresponding conditions are met. This action can be used without host permissions, but the extension must have a page or browser action.
Exactly one of imageData or path must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in imageData is an ImageData object; for example, from a canvas element, while the image representation in path is the path to an image file relative to the extension's manifest. If scale screen pixels fit into a device-independent pixel, the scale * n icon is used. If that scale is missing, another image is resized to the required size.
",
+ "description": "Declarative event action that sets the n-dip square icon for the extension's $(ref:pageAction page action) or $(ref:browserAction browser action) while the corresponding conditions are met. This action can be used without host permissions, but the extension must have a page or browser action.
Exactly one of imageData or path must be specified. Both are dictionaries mapping a number of pixels to an image representation. The image representation in imageData is an ImageData object; for example, from a canvas element, while the image representation in path is the path to an image file relative to the extension's manifest. If scale screen pixels fit into a device-independent pixel, the scale * n icon is used. If that scale is missing, another image is resized to the required size.
",
"type": "object",
"properties": {
"instanceType": {
diff --git a/idl/chrome/developer_private.idl b/idl/chrome/developer_private.idl
index 190a47c..81f65a0 100644
--- a/idl/chrome/developer_private.idl
+++ b/idl/chrome/developer_private.idl
@@ -65,7 +65,6 @@ namespace developerPrivate {
BACKGROUND_CONTENTS,
COMPONENT,
EXTENSION_BACKGROUND_PAGE,
- EXTENSION_DIALOG,
EXTENSION_GUEST,
EXTENSION_POPUP,
EXTENSION_SERVICE_WORKER_BACKGROUND,
@@ -225,6 +224,10 @@ namespace developerPrivate {
// Only populated for extensions that can be affected by the runtime host
// permissions feature.
RuntimeHostPermissions? runtimeHostPermissions;
+
+ // True if the extension can access site data through host permissions or
+ // API permissions such as activeTab.
+ boolean canAccessSiteData;
};
dictionary ExtensionInfo {
@@ -265,6 +268,8 @@ namespace developerPrivate {
DOMString webStoreUrl;
boolean showSafeBrowsingAllowlistWarning;
boolean showAccessRequestsInToolbar;
+ boolean acknowledgeSafetyCheckWarning;
+ boolean? pinnedToToolbar;
};
dictionary ProfileInfo {
@@ -325,6 +330,7 @@ namespace developerPrivate {
HostAccess? hostAccess;
boolean? showAccessRequestsInToolbar;
boolean? acknowledgeSafetyCheckWarning;
+ boolean? pinnedToToolbar;
};
dictionary ProfileConfigurationUpdate {
@@ -434,11 +440,14 @@ namespace developerPrivate {
// - ON_CLICK: The extension requested access to the site but its access is
// withheld.
// - ON_SPECIFIC_SITES: the extension is permitted to run on at least one
- // site specified by the queried site but has its access withheld on at
- // least one site in its host permissions.
- // - ON_ALL_SITES: same as above except the extension has no withheld access
- // to its specified sites.
+ // site specified by the queried site but it does not request access to
+ // all sites or it has its access withheld on at least one site in its
+ // host permissions.
+ // - ON_ALL_SITES: the extension is permitted to run on all sites.
HostAccess siteAccess;
+ // Whether the matching extension requests access to all sites in its
+ // host permissions.
+ boolean canRequestAllSites;
};
dictionary ExtensionSiteAccessUpdate {
@@ -487,7 +496,9 @@ namespace developerPrivate {
COMMAND_REMOVED,
PERMISSIONS_CHANGED,
SERVICE_WORKER_STARTED,
- SERVICE_WORKER_STOPPED
+ SERVICE_WORKER_STOPPED,
+ CONFIGURATION_CHANGED,
+ PINNED_ACTIONS_CHANGED
};
dictionary PackDirectoryResponse {
@@ -830,6 +841,15 @@ namespace developerPrivate {
ExtensionSiteAccessUpdate[] updates,
optional VoidCallback callback);
+ // Removes multiple installed extensions.
+ [supportsPromises] static void removeMultipleExtensions(
+ DOMString[] extensionIds,
+ optional VoidCallback callback);
+
+ // Dismisses the menu notification for the extensions module in Safety Hub
+ // if one is active.
+ static void dismissSafetyHubExtensionsMenuNotification();
+
[nocompile, deprecated="Use openDevTools"]
static void inspect(InspectOptions options,
optional VoidCallback callback);
diff --git a/idl/chrome/document_scan.idl b/idl/chrome/document_scan.idl
index 4e25936..26c64e5 100644
--- a/idl/chrome/document_scan.idl
+++ b/idl/chrome/document_scan.idl
@@ -24,11 +24,477 @@ namespace documentScan {
DOMString mimeType;
};
+ // OperationResult is an enum that indicates the result of each operation
+ // performed by the backend. It contains the same causes as SANE_Status plus
+ // additional statuses that come from the IPC layers and image conversion
+ // stages.
+ [nodoc] enum OperationResult {
+ // An unknown or generic failure occurred.
+ UNKNOWN,
+
+ // Operation succeeded.
+ SUCCESS,
+
+ // The operation is not supported.
+ UNSUPPORTED,
+
+ // The operation was cancelled.
+ CANCELLED,
+
+ // The device is busy.
+ DEVICE_BUSY,
+
+ // Data or argument is invalid.
+ INVALID,
+
+ // Value is the wrong type for the underlying option.
+ WRONG_TYPE,
+
+ // No more data is available.
+ EOF,
+
+ // The document feeder is jammed.
+ ADF_JAMMED,
+
+ // The document feeder is empty.
+ ADF_EMPTY,
+
+ // The flatbed cover is open.
+ COVER_OPEN,
+
+ // An error occurred while communicating with the device.
+ IO_ERROR,
+
+ // The device requires authentication.
+ ACCESS_DENIED,
+
+ // Not enough memory was available to complete the operation.
+ NO_MEMORY,
+
+ // The device was not reachable.
+ UNREACHABLE,
+
+ // The device was disconnected.
+ MISSING,
+
+ // An internal error occurred.
+ INTERNAL_ERROR
+ };
+
+ // How the scanner is connected to the computer.
+ [nodoc] enum ConnectionType {
+ UNSPECIFIED,
+ USB,
+ NETWORK
+ };
+
+ // ScannerInfo contains general information about a scanner device. It is
+ // intended for filtering and constructing user-facing information, not for
+ // configuring a scan.
+ [nodoc] dictionary ScannerInfo {
+ // For connecting with openScanner.
+ DOMString scannerId;
+
+ // Printable name for displaying in the UI.
+ DOMString name;
+
+ // Scanner manufacturer.
+ DOMString manufacturer;
+
+ // Scanner model if available, or a generic description.
+ DOMString model;
+
+ // For matching against other ScannerInfo entries that point
+ // to the same physical device.
+ DOMString deviceUuid;
+
+ // How the scanner is connected to the computer.
+ ConnectionType connectionType;
+
+ // If true, the scanner connection's transport cannot be intercepted by a
+ // passive listener, such as TLS or USB.
+ boolean secure;
+
+ // MIME types that can be requested for returned scans.
+ DOMString[] imageFormats;
+ };
+
+ // The type of an option. This is the same set of types as SANE_Value_Type.
+ [nodoc] enum OptionType {
+ // Unknown option type. value will be unset.
+ UNKNOWN,
+
+ // true/false only. value will be a boolean.
+ BOOL,
+
+ // Signed 32-bit integer. value will be long or long[],
+ // depending on whether the option takes more than one value.
+ INT,
+
+ // Double in the range -32768-32767.9999 with a resolution of 1/65535.
+ // value will be double or double[] depending on whether the
+ // option takes more than one value.
+ FIXED,
+
+ // A sequence of any bytes except NUL ('\0'). value will be a
+ // DOMString.
+ STRING,
+
+ // Hardware button or toggle. No value.
+ BUTTON,
+
+ // Grouping option. No value. This is included for compatibility, but
+ // will not normally be returned in ScannerOption values. Use
+ // getOptionGroups() to retrieve the list of groups with their
+ // member options.
+ GROUP
+ };
+
+ // The unit of measurement for an option. This is the same set of units as
+ // SANE_Unit.
+ [nodoc] enum OptionUnit {
+ // Value is a unitless number, e.g. threshold.
+ UNITLESS,
+
+ // Value is a number of pixels, e.g., scan dimensions.
+ PIXEL,
+
+ // Value is the number of bits, e.g., color depth.
+ BIT,
+
+ // Value is measured in millimeters, e.g., scan dimensions.
+ MM,
+
+ // Value is measured in dots per inch, e.g., resolution.
+ DPI,
+
+ // Value is a percent, e.g., brightness.
+ PERCENT,
+
+ // Value is measured in microseconds, e.g., exposure time.
+ MICROSECOND
+ };
+
+ // The type of constraint represented by an OptionConstraint.
+ [nodoc] enum ConstraintType {
+ // Constraint represents a range of OptionType.INT values.
+ // min, max, and quant will be
+ // long, and list will be unset.
+ INT_RANGE,
+
+ // Constraint represents a range of OptionType.FIXED values.
+ // min, max, and quant will be
+ // double, and list will be unset.
+ FIXED_RANGE,
+
+ // Constraint represents a specific list of OptionType.INT
+ // values. list will contain long values, and
+ // the other fields will be unset.
+ INT_LIST,
+
+ // Constraint represents a specific list of OptionType.FIXED
+ // values. list will contain double values, and
+ // the other fields will be unset.
+ FIXED_LIST,
+
+ // Constraint represents a specific list of OptionType.STRING
+ // values. list will contain DOMString values,
+ // and the other fields will be unset.
+ STRING_LIST
+ };
+
+ // OptionConstraint represents the same set of value constraints
+ // as SANE_Constraint_Type, with the exception that an unconstrained value is
+ // represented by a lack of constraint rather than a special
+ // SANE_CONSTRAINT_NONE value.
+ [nodoc] dictionary OptionConstraint {
+ ConstraintType type;
+ (long or double)? min;
+ (long or double)? max;
+ (long or double)? quant;
+ (double[] or long[] or DOMString[])? list;
+ };
+
+ // How an option can be changed.
+ [nodoc] enum Configurability {
+ // Option is read-only and cannot be changed.
+ NOT_CONFIGURABLE,
+
+ // Option can be set in software.
+ SOFTWARE_CONFIGURABLE,
+
+ // Option can be set by the user toggling/pushing a hardware button.
+ HARDWARE_CONFIGURABLE
+ };
+
+ // A self-describing configurable scanner option and current value, in the
+ // same style as SANE's SANE_Option_Descriptor and sane_control_option().
+ [nodoc] dictionary ScannerOption {
+ // Option name using lowercase a-z, numbers, and dashes.
+ DOMString name;
+
+ // Printable one-line title.
+ DOMString title;
+
+ // Longer description of the option.
+ DOMString description;
+
+ // The type that value will contain and that is needed for
+ // setting this option.
+ OptionType type;
+
+ // Unit of measurement for this option.
+ OptionUnit unit;
+
+ // Current value of the option if relevant. Note the type passed here must
+ // match the type specified in type.
+ (boolean or double or double[] or long or long[] or DOMString)? value;
+
+ // Constraint on possible values.
+ OptionConstraint? constraint;
+
+ // Can be detected from software.
+ boolean isDetectable;
+
+ // Whether/how the option can be changed.
+ Configurability configurability;
+
+ // Can be automatically set by the backend.
+ boolean isAutoSettable;
+
+ // Emulated by the backend if true.
+ boolean isEmulated;
+
+ // Option is active and can be set/retrieved. If false, the
+ // value field will not be set.
+ boolean isActive;
+
+ // UI should not display this option by default.
+ boolean isAdvanced;
+
+ // Option is used for internal configuration and should never be displayed
+ // in the UI.
+ boolean isInternal;
+ };
+
+ // A set of criteria passed to getScannerList(). Only devices
+ // that match all of the criteria will be returned.
+ [nodoc] dictionary DeviceFilter {
+ // Only return scanners that are directly attached to the computer.
+ boolean? local;
+
+ // Only return scanners that use a secure transport, such as USB or TLS.
+ boolean? secure;
+ };
+
+ // OptionGroup is a group containing a list of option names. The groups and
+ // their contents are determined by the backend and do not have any defined
+ // semantics or consistent membership. This structure is primarily intended
+ // for UI layout assistance; it does not affect the individual option
+ // behaviors.
+ [nodoc] dictionary OptionGroup {
+ // Printable title, e.g. "Geometry options".
+ DOMString title;
+
+ // Names of contained options, in backend-provided order.
+ DOMString[] members;
+ };
+
+ // The response from getScannerList().
+ [nodoc] dictionary GetScannerListResponse {
+ // The backend's enumeration result. Note that partial results could be
+ // returned even if this indicates an error.
+ OperationResult result;
+
+ // A possibly-empty list of scanners that match the provided
+ // DeviceFilter.
+ ScannerInfo[] scanners;
+ };
+
+ // The response from openScanner().
+ [nodoc] dictionary OpenScannerResponse {
+ // Same scanner ID passed to openScanner().
+ DOMString scannerId;
+
+ // Backend result of opening the scanner.
+ OperationResult result;
+
+ // If result is OperationResult.SUCCESS, a handle
+ // to the scanner that can be used for further operations.
+ DOMString? scannerHandle;
+
+ // If result is OperationResult.SUCCESS, a
+ // key-value mapping from option names to ScannerOption.
+ object? options;
+ };
+
+ // The response from getOptionGroups().
+ [nodoc] dictionary GetOptionGroupsResponse {
+ // Same scanner handle passed to getOptionGroups().
+ DOMString scannerHandle;
+
+ // The backend's result of getting the option groups.
+ OperationResult result;
+
+ // If result is OperationResult.SUCCESS, a list of
+ // option groups in the order supplied by the backend.
+ OptionGroup[]? groups;
+ };
+
+ // The response from closeScanner().
+ [nodoc] dictionary CloseScannerResponse {
+ // Same scanner handle passed to closeScanner().
+ DOMString scannerHandle;
+
+ // Backend result of closing the scanner. Even if this value is not
+ // OperationResult.SUCCESS, the handle will be invalid and
+ // should not be used for any further operations.
+ OperationResult result;
+ };
+
+ // A subset of ScannerOption that contains enough information to
+ // set an option to a new value.
+ [nodoc] dictionary OptionSetting {
+ // Name of the option to set.
+ DOMString name;
+
+ // Type of the option. The requested type must match the real type of the
+ // underlying option.
+ OptionType type;
+
+ // Value to set. Leave unset to request automatic setting for options that
+ // have autoSettable enabled. The type supplied for
+ // value must match type.
+ (boolean or double or double[] or long or long[] or DOMString)? value;
+ };
+
+ // The result of setting an individual option. Each individual option
+ // supplied to setOptions() produces a separate result on the
+ // backend due to things like rounding and constraints.
+ [nodoc] dictionary SetOptionResult {
+ // Name of the option that was set.
+ DOMString name;
+
+ // Backend result of setting the option.
+ OperationResult result;
+ };
+
+ // The response from a call to setOptions().
+ [nodoc] dictionary SetOptionsResponse {
+ // The same scanner handle passed to setOptions().
+ DOMString scannerHandle;
+
+ // One result per passed-in OptionSetting.
+ SetOptionResult[] results;
+
+ // Updated key-value mapping from option names to
+ // ScannerOption containing the new configuration after
+ // attempting to set all supplied options. This has the same structure as
+ // the options field in OpenScannerResponse.
+ //
+ // This field will be set even if some options were not set successfully,
+ // but will be unset if retrieving the updated configuration fails (e.g.,
+ // if the scanner is disconnected in the middle).
+ object? options;
+ };
+
+ // Used to specify options for startScan().
+ [nodoc] dictionary StartScanOptions {
+ // MIME type to return scanned data in.
+ DOMString format;
+ };
+
+ // The response from startScan().
+ [nodoc] dictionary StartScanResponse {
+ // The same scanner handle that was passed to startScan().
+ DOMString scannerHandle;
+
+ // The backend's start scan result.
+ OperationResult result;
+
+ // If result is OperationResult.SUCCESS, a handle
+ // that can be used to read scan data or cancel the job.
+ DOMString? job;
+ };
+
+ // The response from cancelScan().
+ [nodoc] dictionary CancelScanResponse {
+ // The same job handle that was passed to cancelScan().
+ DOMString job;
+
+ // The backend's cancel scan result.
+ OperationResult result;
+ };
+
+ // The response from readScanData().
+ [nodoc] dictionary ReadScanDataResponse {
+ // Same job handle passed to readScanData().
+ DOMString job;
+
+ // The backend result of reading data. If this is
+ // OperationResult.SUCCESS, data will contain the
+ // next (possibly zero-length) chunk of image data that was ready for
+ // reading. If this is OperationResult.EOF, data
+ // will contain the final chunk of image data.
+ OperationResult result;
+
+ // If result is OperationResult.SUCCESS, the next chunk of
+ // scanned image data.
+ ArrayBuffer? data;
+
+ // If result is OperationResult.SUCCESS, an estimate of how
+ // much of the total scan data has been delivered so far, in the range
+ // 0-100.
+ long? estimatedCompletion;
+ };
+
// Callback from the scan method.
// |result| The results from the scan, if successful.
// Otherwise will return null and set runtime.lastError.
callback ScanCallback = void (ScanResults result);
+ // Callback from the getScannerList method.
+ // |response| The response from enumeration, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback GetScannerListCallback = void (GetScannerListResponse response);
+
+ // Callback from the openScanner method.
+ // |response| The response from opening the scanner, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback OpenScannerCallback = void (OpenScannerResponse response);
+
+ // Callback from the getOptionGroups method.
+ // |response| The response from getting the option groups, if the call was
+ // valid. Otherwise will return null and set runtime.lastError.
+ [nodoc] callback GetOptionGroupsCallback =
+ void (GetOptionGroupsResponse response);
+
+ // Callback from the closeScanner method.
+ // |response| The response from closing the scanner, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback CloseScannerCallback = void (CloseScannerResponse response);
+
+ // Callback from the setOptions method.
+ // |response| The response from setting the options, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback SetOptionsCallback = void (SetOptionsResponse response);
+
+ // Callback from the startScan method.
+ // |response| The response from starting the scan, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback StartScanCallback = void (StartScanResponse response);
+
+ // Callback from the cancelScan method.
+ // |response| The response from canceling the scan, if the call was valid.
+ // Otherwise will return null and set runtime.lastError.
+ [nodoc] callback CancelScanCallback = void (CancelScanResponse response);
+
+ // Callback from the readScanData method.
+ // |response| The response from reading the next chunk of scanned image data,
+ // if the call was valid. Otherwise will return null and set
+ // runtime.lastError.
+ [nodoc] callback ReadScanDataCallback = void (ReadScanDataResponse response);
+
interface Functions {
// Performs a document scan. On success, the PNG data will be
// sent to the callback.
@@ -36,5 +502,93 @@ namespace documentScan {
// |callback| : Called with the result and data from the scan.
[supportsPromises] static void scan(ScanOptions options,
ScanCallback callback);
+
+ // Gets the list of available scanners. On success, the list will be
+ // sent to the callback.
+ // |filter| : DeviceFilter indicating which types of scanners
+ // should be returned.
+ // |callback| : Called with the result and list of scanners.
+ [nodoc, supportsPromises] static void getScannerList(
+ DeviceFilter filter, GetScannerListCallback callback);
+
+ // Opens a scanner for exclusive access. On success, the response containing
+ // a scanner handle and configuration will be sent to the callback.
+ // |scannerId| : Scanner id previously returned from getScannerList
+ // indicating which scanner should be opened.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void openScanner(
+ DOMString scannerId, OpenScannerCallback callback);
+
+ // Gets the group names and member options from a scanner handle previously
+ // opened by openScanner.
+ // |scannerHandle| : Open scanner handle previously returned from
+ // openScanner.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void getOptionGroups(
+ DOMString scannerHandle, GetOptionGroupsCallback callback);
+
+ // Closes a previously opened scanner handle. A response indicating the
+ // outcome will be sent to the callback. Even if the response is not a
+ // success, the supplied handle will become invalid and should not be used
+ // for further operations.
+ // |scannerHandle| : Open scanner handle previously returned from
+ // openScanner.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void closeScanner(
+ DOMString scannerHandle, CloseScannerCallback callback);
+
+ // Sends the list of new option values in options as a bundle
+ // to be set on scannerHandle. Each option will be set by the
+ // backend the order specified. Returns a backend response indicating the
+ // result of each option setting and a new set of final option values after
+ // all options have been updated.
+ // |scannerHandle| : Open scanner handle previously returned from
+ // openScanner.
+ // |options| : A list of OptionSettings that will be applied to
+ // scannerHandle.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void setOptions(
+ DOMString scannerHandle, OptionSetting[] options,
+ SetOptionsCallback callback);
+
+ // Starts a scan using a previously opened scanner handle. A response
+ // indicating the outcome will be sent to the callback. If successful, the
+ // response will include a job handle that can be used in subsequent calls
+ // to read scan data or cancel a scan.
+ // |scannerHandle| : Open scanner handle previously returned from
+ // openScanner.
+ // |options| : StartScanOptions indicating what options are to
+ // be used for the scan. StartScanOptions.format must match
+ // one of the entries returned in the scanner's ScannerInfo.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void startScan(
+ DOMString scannerHandle, StartScanOptions options,
+ StartScanCallback callback);
+
+ // Cancels a scan that was previously started using startScan.
+ // The response is sent to the callback.
+ // |job| : An active scan job previously returned from
+ // startScan.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void cancelScan(
+ DOMString job, CancelScanCallback callback);
+
+ // Reads the next chunk of available image data from an active job handle.
+ // A response indicating the outcome will be sent to the callback.
+ //
+ // It is valid for a response to have result
+ // OperationResult.SUCCESS with a zero-length
+ // data member. This means the scanner is still working but
+ // does not yet have additional data ready. The caller should wait a short
+ // time and try again.
+ //
+ // When the scan job completes, the response will have the result
+ // OperationResult.EOF. This response may contain a final
+ // non-zero data member.
+ // |job| : Active job handle previously returned from
+ // startScan.
+ // |callback| : Called with the result.
+ [nodoc, supportsPromises] static void readScanData(
+ DOMString job, ReadScanDataCallback callback);
};
};
\ No newline at end of file
diff --git a/idl/chrome/downloads.idl b/idl/chrome/downloads.idl
index de492fb..14b9547 100644
--- a/idl/chrome/downloads.idl
+++ b/idl/chrome/downloads.idl
@@ -132,6 +132,7 @@ namespace downloads {
accepted,
allowlistedByPolicy,
asyncScanning,
+ asyncLocalPasswordScanning,
passwordProtected,
blockedTooLarge,
sensitiveContentWarning,
@@ -140,7 +141,8 @@ namespace downloads {
deepScannedFailed,
deepScannedSafe,
deepScannedOpenedDangerous,
- promptForScaning,
+ promptForScanning,
+ promptForLocalPasswordScanning,
accountCompromise
};
@@ -512,11 +514,12 @@ namespace downloads {
optional GetFileIconOptions options,
GetFileIconCallback callback);
- // Open the downloaded file now if the $(ref:DownloadItem) is complete;
- // otherwise returns an error through $(ref:runtime.lastError). Requires the
- // "downloads.open" permission in addition to the
- // "downloads" permission. An $(ref:onChanged) event will fire
- // when the item is opened for the first time.
+ // Opens the downloaded file now if the $(ref:DownloadItem) is complete;
+ // otherwise returns an error through $(ref:runtime.lastError). This method
+ // requires the "downloads.open" permission in addition to the
+ // "downloads" permission. An $(ref:onChanged) event fires
+ // when the item is opened for the first time. This method can only be called
+ // in response to a user gesture.
// |downloadId|: The identifier for the downloaded file.
static void open(long downloadId);
@@ -558,6 +561,7 @@ namespace downloads {
// one other extension has disabled it will return an error through
// $(ref:runtime.lastError). Requires the "downloads.shelf"
// permission in addition to the "downloads" permission.
+ [deprecated="Use $(ref:setUiOptions) instead."]
static void setShelfEnabled(boolean enabled);
// Change the download UI of every window associated with the current
diff --git a/idl/chrome/enterprise_kiosk_input.idl b/idl/chrome/enterprise_kiosk_input.idl
new file mode 100644
index 0000000..e471dcc
--- /dev/null
+++ b/idl/chrome/enterprise_kiosk_input.idl
@@ -0,0 +1,36 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Use the chrome.enterprise.kioskInput API to change input
+// settings for Kiosk sessions.
+// Note: This API is only available extensions and Chrome apps installed
+// by enterprise policy in ChromeOS Kiosk sessions.
+[platforms = ("chromeos"),
+ implemented_in = "chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.h"]
+namespace enterprise.kioskInput {
+ dictionary SetCurrentInputMethodOptions {
+ // The input method ID to set as current input method. This input
+ // method has to be enabled by enterprise policies. Supported IDs
+ // are located in https://crsrc.org/c/chrome/browser/resources/chromeos/input_method.
+ DOMString inputMethodId;
+ };
+
+ callback SetCurrentInputMethodCallback = void();
+
+ interface Functions {
+ // Sets the current input method. This function only changes
+ // the current input method to an enabled input method.
+ // Input methods can be enabled by enterprise polices.
+ // If the input method ID is invalid, or not enabled,
+ // $(ref:runtime.lastError) will be set with a failure reason.
+ // |options|: Object containing the fields defined in
+ // $(ref:SetCurrentInputMethodOptions).
+ // |callback|: Called when the input method is changed or if
+ // there is an error.
+ [supportsPromises] static void setCurrentInputMethod(
+ SetCurrentInputMethodOptions options,
+ SetCurrentInputMethodCallback callback);
+};
+
+};
\ No newline at end of file
diff --git a/idl/chrome/file_manager_private.idl b/idl/chrome/file_manager_private.idl
index 232ae8b..51bd6e7 100644
--- a/idl/chrome/file_manager_private.idl
+++ b/idl/chrome/file_manager_private.idl
@@ -54,6 +54,9 @@ enum VolumeType { drive, downloads, removable, archive, provided, mtp,
// Device type. Available if this is removable volume.
enum DeviceType { usb, sd, optical, mobile, unknown };
+// List of device connection statuses.
+enum DeviceConnectionState {OFFLINE, ONLINE};
+
// List of connection types of drive.
enum DriveConnectionStateType {OFFLINE, METERED, ONLINE};
@@ -97,7 +100,7 @@ enum FormatFileSystemType { vfat, exfat, ntfs };
enum TransferState { in_progress, queued, completed, failed };
// The response when starting installing a Linux package.
-enum InstallLinuxPackageResponse {
+enum InstallLinuxPackageStatus {
started,
failed,
install_already_active
@@ -304,7 +307,7 @@ enum SharesheetLaunchSource {
unknown
};
-enum IOTaskState {
+enum IoTaskState {
queued,
scanning,
in_progress,
@@ -315,7 +318,7 @@ enum IOTaskState {
cancelled
};
-enum IOTaskType {
+enum IoTaskType {
copy,
delete,
empty_trash,
@@ -407,9 +410,9 @@ enum BulkPinStage {
success,
// Final error stages.
+ not_enough_space,
cannot_get_free_space,
cannot_list_files,
- not_enough_space,
cannot_enable_docs_offline
};
@@ -582,6 +585,16 @@ dictionary MountPointSizeStats {
double remainingSize;
};
+dictionary SearchDriveResponse {
+ // Search results.
+ [instanceOf=Entry] object[] entries;
+
+ // ID of the feed that contains next chunk of the search result.
+ // Should be sent to the next searchDrive request to perform
+ // incremental search.
+ DOMString nextFeed;
+};
+
// Free and total space available in Drive relative to both the user and their
// organization, if they belong to one.
dictionary DriveQuotaMetadata {
@@ -613,6 +626,18 @@ dictionary ProfileInfo {
boolean isCurrentProfile;
};
+// The return data for getProfiles() API.
+dictionary ProfilesResponse {
+ // List of profile information.
+ ProfileInfo[] profiles;
+
+ // ID of the profile that runs the application instance.
+ DOMString currentProfileId;
+
+ // ID of the profile that shows the application window.
+ DOMString displayedProfileId;
+};
+
// Represents an icon in multiple dimensions. All are optional.
dictionary IconSet {
DOMString? icon16x16Url;
@@ -815,7 +840,7 @@ dictionary GetVolumeRootOptions {
dictionary Preferences {
boolean driveEnabled;
- boolean cellularDisabled;
+ boolean driveSyncEnabledOnMeteredNetwork;
boolean searchSuggestEnabled;
boolean use24hourClock;
DOMString timezone;
@@ -825,11 +850,12 @@ dictionary Preferences {
boolean trashEnabled;
double officeFileMovedOneDrive;
double officeFileMovedGoogleDrive;
+ boolean driveFsBulkPinningAvailable;
boolean driveFsBulkPinningEnabled;
};
dictionary PreferencesChange {
- boolean? cellularDisabled;
+ boolean? driveSyncEnabledOnMeteredNetwork;
boolean? arcEnabled;
boolean? arcRemovableMediaAccessEnabled;
DOMString[]? folderShortcuts;
@@ -899,13 +925,6 @@ dictionary DriveConnectionState {
// Reasons of offline.
DriveOfflineReason? reason;
-
- // Whether the device has a cellular network access or not. i.e. the |type|
- // can be 'metered' or not.
- boolean hasCellularNetworkAccess;
-
- // Whether or not hosted files can be pinned.
- boolean canPinHostedFiles;
};
// Device event dispatched to listeners of onDeviceChaged. See also
@@ -980,6 +999,14 @@ dictionary CrostiniEvent {
[instanceOf=Entry] object[] entries;
};
+dictionary CrostiniSharedPathResponse {
+ // Entries shared with crostini container.
+ [instanceOf=Entry] object[] entries;
+
+ // true the first time this is called for the session.
+ boolean firstForSession;
+};
+
// Represents an Android app (activity).
dictionary AndroidApp {
// Name of the app to be shown to the user (e.g. Photos).
@@ -1074,6 +1101,19 @@ dictionary IOTaskParams {
boolean? showNotification;
};
+// Holds information about data protection policy errors, see file_manager::io_task::PolicyError.
+dictionary PolicyError {
+ // Type of the error.
+ PolicyErrorType type;
+ // The number of files blocked by the policy.
+ long policyFileCount;
+ // The name of the first blocked file. Used for notifications.
+ DOMString fileName;
+ // Normally the review button is only shown when `policyFileCount` is >1, this option allows to force
+ // the display of the review button irrespective of other conditions.
+ boolean alwaysShowReview;
+};
+
// IO task state::PAUSED name conflict parameters, see file_manager::io_task::ConflictPauseParams.
dictionary ConflictPauseParams {
// The conflict file name.
@@ -1091,7 +1131,15 @@ dictionary ConflictPauseParams {
// IO task state::PAUSED policy parameters, see file_manager::io_task::PolicyPauseParams.
dictionary PolicyPauseParams {
+ // One of DLP or Enterprise Connectors.
PolicyErrorType type;
+ // The number of files under warning restriction.
+ long policyFileCount;
+ // The name of the first file under warning restriction. Used for notifications.
+ DOMString fileName;
+ // Normally the review button is only shown when `policyFileCount` is >1, this option allows to force
+ // the display of the review button irrespective of other conditions.
+ boolean alwaysShowReview;
};
// IO task state::PAUSED parameters, see file_manager::io_task::PauseParams.
@@ -1129,14 +1177,14 @@ dictionary ResumeParams {
dictionary ProgressStatus {
// Type of the task sending the progress.
- IOTaskType type;
+ IoTaskType type;
// Current state of the task sending the progress.
- IOTaskState state;
+ IoTaskState state;
// Type of policy error that occurred, if any.
// Used only if Data Leak Prevention or Enterprise Connectors policies apply.
- PolicyErrorType? policyError;
+ PolicyError? policyError;
// Name of the first source entry.
DOMString sourceName;
@@ -1183,6 +1231,10 @@ dictionary ProgressStatus {
// The files affected by the IOTask. Currently only returned for TrashIOTask.
[instanceOf=Entry] object[]? outputs;
+ // List of files skipped during the operation because we couldn't decrypt
+ // them.
+ DOMString[] skippedEncryptedFiles;
+
// Volume id of the destination for operations that transfer files to a
// directory (e.g. copy or move).
DOMString destinationVolumeId;
@@ -1246,7 +1298,7 @@ dictionary ParsedTrashInfoFile {
};
// The current progress of the bulk pinning manager. This is a subset of the
-// Progress struct in chromeos/ash/components/drivefs/drivefs_pin_manager.h
+// Progress struct in chromeos/ash/components/drivefs/drivefs_pinning_manager.h
dictionary BulkPinProgress {
// The stage the bulk pin manager is in.
BulkPinStage stage;
@@ -1268,8 +1320,18 @@ dictionary BulkPinProgress {
// Total number of files to pin.
long filesToPin;
+ // Show the total number of files enumerated during the Listing files stage.
+ long listedFiles;
+
// Estimated time remaining to pin all the `bytesToPin`.
double remainingSeconds;
+
+ // Should the bulk-pinning manager actually pin files, or should it stop after
+ // checking the space requirements?
+ boolean shouldPin;
+
+ // Has the bulk-pinning manager ever emptied its set of tracked items?
+ boolean emptiedQueue;
};
// Callback that does not take arguments.
@@ -1353,8 +1415,7 @@ callback GetPreferencesCallback = void(Preferences result);
// |nextFeed| ID of the feed that contains next chunk of the search result.
// Should be sent to the next searchDrive request to perform
// incremental search.
-callback SearchDriveCallback =
- void([instanceOf=Entry] object[] entries, DOMString nextFeed);
+callback SearchDriveCallback = void(SearchDriveResponse response);
callback SearchDriveMetadataCallback =
void(DriveMetadataSearchResult[] results);
@@ -1366,17 +1427,14 @@ callback SearchFilesCallback = void([instanceOf=Entry] object[] entries);
// contain at most one path per hash.
callback SearchFilesByHashesCallback = void(object paths);
+callback GetDeviceConnectionStateCallback = void(DeviceConnectionState result);
+
callback GetDriveConnectionStateCallback = void(DriveConnectionState result);
// |result| true if the length is in the valid range, false otherwise.
callback ValidatePathNameLengthCallback = void(boolean result);
-// |profiles| List of profile information.
-// |runningProfile| ID of the profile that runs the application instance.
-// |showingProfile| ID of the profile that shows the application window.
-callback GetProfilesCallback = void(ProfileInfo[] profiles,
- DOMString runningProfile,
- DOMString displayProfile);
+callback GetProfilesCallback = void(ProfilesResponse response);
// |entries| External entries.
callback ResolveEntriesCallback =
@@ -1401,23 +1459,14 @@ callback GetRecentFilesCallback = void([instanceOf=Entry] object[] entries);
callback GetVolumeRootCallback =
void([instanceOf=DirectoryEntry] object rootDir);
-// |entries| Entries shared with crostini container.
-// |firstForSession| true the first time this is called for the session.
callback GetCrostiniSharedPathsCallback =
- void([instanceOf=Entry] object[] entries, boolean firstForSession);
+ void(CrostiniSharedPathResponse response);
// |linux_package_info| Package info for the queried package.
callback GetLinuxPackageInfoCallback =
void(LinuxPackageInfo linux_package_info);
-// |status| Result of starting the install
-// |failure_reason| Reason for failure for a 'failed' status
-callback InstallLinuxPackageCallback = void(
- InstallLinuxPackageResponse response, DOMString failure_reason);
-
-// |thumbnailDataUrl| A data URL for the thumbnail; |thumbnailDataUrl| is empty
-// if no thumbnail was available.
-callback GetThumbnailCallback = void(DOMString thumbnailDataUrl);
+callback InstallLinuxPackageCallback = void(InstallLinuxPackageStatus status);
// |apps| List of Android picker apps.
callback GetAndroidPickerAppsCallback = void(AndroidApp[] apps);
@@ -1440,7 +1489,7 @@ interface Functions {
// |descriptor| The unique identifier of task to execute.
// |entries| Array of entries
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void executeTask(FileTaskDescriptor descriptor,
[instanceOf=Entry] object[] entries,
ExecuteTaskCallback callback);
@@ -1452,7 +1501,7 @@ interface Functions {
// |entries| Array of selected entries to extract path extensions from.
// |mimeTypes| Array of selected file MIME types.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void setDefaultTask(FileTaskDescriptor descriptor,
[instanceOf=Entry] object[] entries,
DOMString[] mimeTypes,
@@ -1463,7 +1512,7 @@ interface Functions {
// |dlpSourceUrls| Array of source URLs corresponding to the entries, used to
// check Data Leak Prevention (DLP) restrictions
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getFileTasks([instanceOf=Entry] object[] entries,
DOMString[] dlpSourceUrls,
GetFileTasksCallback callback);
@@ -1471,14 +1520,14 @@ interface Functions {
// Gets the MIME type of an entry.
// |entry| The entry to be checked.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getMimeType([instanceOf=Entry] object entry,
GetMimeTypeCallback callback);
// Gets the content sniffed MIME type of a file.
// |fileEntry| The file entry to be checked.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getContentMimeType([instanceOf=FileEntry] object fileEntry,
GetContentMimeTypeCallback callback);
@@ -1488,7 +1537,7 @@ interface Functions {
// |includeImages| False returns metadata tags only. True returns
// metadata tags and metadata (thumbnail) images.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getContentMetadata([instanceOf=FileEntry] object fileEntry,
DOMString mimeType,
boolean includeImages,
@@ -1496,19 +1545,20 @@ interface Functions {
// Gets localized strings and initialization data.
// |callback|
+ [supportsPromises]
static void getStrings(GetStringsCallback callback);
// Adds file watch.
// |entry| Entry to watch
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void addFileWatch([instanceOf=Entry] object entry,
AddFileWatchCallback callback);
// Removes file watch.
// |entry| Watched entry
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void removeFileWatch([instanceOf=Entry] object entry,
RemoveFileWatchCallback callback);
@@ -1521,12 +1571,14 @@ interface Functions {
// invalid or not backed by the external file system.
// |entryUrls| Urls for the entries to be accessed.
// |callback|
+ [supportsPromises]
static void grantAccess(DOMString[] entryUrls, SimpleCallback callback);
// Selects multiple files.
// |selectedPaths| Array of selected paths
// |shouldReturnLocalPath| true if paths need to be resolved to local paths.
// |callback|
+ [supportsPromises]
static void selectFiles(DOMString[] selectedPaths,
boolean shouldReturnLocalPath,
SimpleCallback callback);
@@ -1537,6 +1589,7 @@ interface Functions {
// |forOpening| true if paths are selected for opening. false if for saving.
// |shouldReturnLocalPath| true if paths need to be resolved to local paths.
// |callback|
+ [supportsPromises]
static void selectFile(DOMString selectedPath,
long index,
boolean forOpening,
@@ -1549,7 +1602,7 @@ interface Functions {
// |callback| Completion callback. May return less than requested properties
// if some are not available. In the same time, it can return properties
// which were not requested (if it's cheap to compute them).
- [nocompile]
+ [nocompile, supportsPromises]
static void getEntryProperties(
[instanceOf=Entry] object[] entries,
EntryPropertyName[] names,
@@ -1560,7 +1613,7 @@ interface Functions {
// |pin| Pass true to pin the file.
// |callback| Completion callback. $(ref:runtime.lastError) will be set if
// there was an error.
- [nocompile]
+ [nocompile, supportsPromises]
static void pinDriveFile([instanceOf=Entry] object entry,
boolean pin,
SimpleCallback callback);
@@ -1569,7 +1622,7 @@ interface Functions {
// entries in the external file system mounted to Chrome OS file manager
// backend. If resolving entry fails, the entry will be just ignored and the
// corresponding entry does not appear in the result.
- [nocompile]
+ [nocompile, supportsPromises]
static void resolveIsolatedEntries(
[instanceOf=Entry] object[] entries,
ResolveEntriesCallback callback);
@@ -1578,20 +1631,24 @@ interface Functions {
// |fileUrl| Mount point source.
// |password| Optional password to decrypt the archive.
// |callback| Callback called with the source path of the mount.
+ [supportsPromises]
static void addMount(DOMString fileUrl, optional DOMString password,
AddMountCallback callback);
// Cancels an archive mounting operation.
// |fileUrl| Mount point source. Should be same as the one passed to addMount.
// |callback|
+ [supportsPromises]
static void cancelMounting(DOMString fileUrl, SimpleCallback callback);
// Unmounts a mounted resource.
// |volumeId| An ID of the volume.
+ [supportsPromises]
static void removeMount(DOMString volumeId, SimpleCallback callback);
// Get the list of mounted volumes.
// |callback|
+ [supportsPromises]
static void getVolumeMetadataList(GetVolumeMetadataListCallback callback);
// Returns the list of files not allowed to be transfered.
@@ -1599,7 +1656,7 @@ interface Functions {
// |destinationEntry| Entry for the destination (parent) directory.
// |isMove| True if the operation is move, false otherwise.
// |callback| Result callback.
- [nocompile]
+ [nocompile, supportsPromises]
static void getDisallowedTransfers(
[instanceOf=Entry] object[] entries,
[instanceOf=DirectoryEntry] object destinationEntry,
@@ -1610,7 +1667,7 @@ interface Functions {
// about the entries.
// |entries| List of the source entries to be checked.
// |callback| Result callback.
- [nocompile]
+ [nocompile, supportsPromises]
static void getDlpMetadata(
[instanceOf=Entry] object[] entries,
GetDlpMetadataCallback callback);
@@ -1618,6 +1675,7 @@ interface Functions {
// Retrieves Data Leak Prevention (DLP) restriction details.
// |sourceUrl| Source URL of the Entry for which the details should be shown.
// |callback| Result callback.
+ [supportsPromises]
static void getDlpRestrictionDetails(
DOMString sourceUrl,
GetDlpRestrictionDetailsCallback callback);
@@ -1626,17 +1684,20 @@ interface Functions {
// is blocked by Data Leak Prevention (DLP) policy.
// |sourceUrl| Source URL of the Entry that should be checked.
// |callback| Result callback.
+ [supportsPromises]
static void getDlpBlockedComponents(
DOMString sourceUrl,
GetDlpBlockedComponentsCallback callback);
// Retrieves the caller that created the dialog (Save As/File Picker).
// |callback| Result callback.
+ [supportsPromises]
static void getDialogCaller(GetDialogCallerCallback callback);
// Retrieves total and remaining size of a mount point.
// |volumeId| ID of the volume to be checked.
// |callback|
+ [supportsPromises]
static void getSizeStats(DOMString volumeId, GetSizeStatsCallback callback);
@@ -1644,7 +1705,7 @@ interface Functions {
// |entry| If entry is within a Shared Drive, then the applicable shared
// drive quota is returned, else the overall Drive quota is returned.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getDriveQuotaMetadata([instanceOf=Entry] object entry,
GetDriveQuotaMetadataCallback callback);
@@ -1672,6 +1733,7 @@ interface Functions {
// Retrieves file manager preferences.
// |callback|
+ [supportsPromises]
static void getPreferences(GetPreferencesCallback callback);
// Sets file manager preferences.
@@ -1681,34 +1743,42 @@ interface Functions {
// Performs drive content search.
// |searchParams|
// |callback|
+ [supportsPromises]
static void searchDrive(SearchParams searchParams,
SearchDriveCallback callback);
// Performs drive metadata search.
// |searchParams|
// |callback|
+ [supportsPromises]
static void searchDriveMetadata(SearchMetadataParams searchParams,
SearchDriveMetadataCallback callback);
// Search files in the volume having |volumeId| by using |hashList|.
+ [supportsPromises]
static void searchFilesByHashes(DOMString volumeId,
DOMString[] hashList,
SearchFilesByHashesCallback callback);
// Search files in My Files.
- [nocompile]
+ [nocompile, supportsPromises]
static void searchFiles(SearchMetadataParams searchParams,
SearchFilesCallback callback);
+ // Retrieves the current device connection status.
+ // |callback|
+ static void getDeviceConnectionState(GetDeviceConnectionStateCallback callback);
+
// Retrieves the state of the current drive connection.
// |callback|
+ [supportsPromises]
static void getDriveConnectionState(GetDriveConnectionStateCallback callback);
// Checks whether the path name length fits in the limit of the filesystem.
// |parentEntry| The entry of the parent directory entry.
// |name| The name of the file.
// |callback| Called back when the check is finished.
- [nocompile]
+ [nocompile, supportsPromises]
static void validatePathNameLength(
[instanceOf=DirectoryEntry] object parentEntry,
DOMString name,
@@ -1719,6 +1789,7 @@ interface Functions {
static void zoom(ZoomOperationType operation);
// Obtains a list of profiles that are logged-in.
+ [supportsPromises]
static void getProfiles(GetProfilesCallback callback);
// Opens inspector window.
@@ -1726,37 +1797,40 @@ interface Functions {
static void openInspector(InspectionType type);
// Opens page in Settings window.
- // |sub_page| Name of a sub_page to show.
- static void openSettingsSubpage(DOMString sub_page);
+ // |subPage| Name of a subPage to show.
+ static void openSettingsSubpage(DOMString subPage);
// Computes an MD5 checksum for the given file.
// |entry| The entry of the file to checksum.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void computeChecksum([instanceOf=Entry] object entry,
ComputeChecksumCallback callback);
// Returns list of available providers.
+ [supportsPromises]
static void getProviders(GetProvidersCallback callback);
// Requests adding a new provided file system. On failure, sets
// $(ref:runtime.lastError).
+ [supportsPromises]
static void addProvidedFileSystem(DOMString providerId,
SimpleCallback callback);
// Requests configuring an existing volume. On failure, sets
// $(ref:runtime.lastError).
+ [supportsPromises]
static void configureVolume(DOMString volumeId, SimpleCallback callback);
// Requests list of custom actions for the specified entries. On failure, sets
// $(ref:runtime.lastError).
- [nocompile]
+ [nocompile, supportsPromises]
static void getCustomActions([instanceOf=Entry] object[] entries,
GetCustomActionsCallback callback);
// Executes a custom action for a set of entries. On failure, sets
// $(ref:runtime.lastError).
- [nocompile]
+ [nocompile, supportsPromises]
static void executeCustomAction([instanceOf=Entry] object[] entries,
DOMString actionId,
SimpleCallback callback);
@@ -1764,28 +1838,33 @@ interface Functions {
// Get the total size of a directory.
// |entry| Entry of the target directory.
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void getDirectorySize([instanceOf=DirectoryEntry] object entry,
GetDirectorySizeCallback callback);
// Gets recently modified files across file systems.
// |restriction| Flag to restrict sources of recent files.
// |fileType| Requested file type to filter recent files.
- // |callback|
- [nocompile]
+ // |query| When not empty, removes files with non-matching names.
+ // |cutoffDays| Specifies oldest modification time.
+ // |callback| Called with zero or more matched files.
+ [nocompile, supportsPromises]
static void getRecentFiles(SourceRestriction restriction,
+ DOMString query,
+ long cutoffDays,
FileCategory fileCategory,
boolean invalidateCache,
GetRecentFilesCallback callback);
// Requests the root directory of the volume with the ID specified in
// |options.volumeId|.
- [nocompile]
+ [nocompile, supportsPromises]
static void getVolumeRoot(GetVolumeRootOptions options,
GetVolumeRootCallback callback);
// Starts and mounts crostini container.
// |callback|
+ [supportsPromises]
static void mountCrostini(SimpleCallback callback);
// Shares paths with crostini container.
@@ -1793,33 +1872,37 @@ interface Functions {
// |entries| Entries of the files or directories to share.
// |persist| If true, shares will persist across restarts.
// |callback|
- [nocompile] static void sharePathsWithCrostini(
- DOMString vmName, [instanceOf=Entry] object[] entries, boolean persist,
- SimpleCallback callback);
+ [nocompile, supportsPromises]
+ static void sharePathsWithCrostini(DOMString vmName,
+ [instanceOf=Entry] object[] entries,
+ boolean persist,
+ SimpleCallback callback);
// Unshares path with crostini container.
// |vmName| VM to unshare path from.
// |entry| Entry of the file or directory to unshare.
// |callback|
- [nocompile] static void unsharePathWithCrostini(
- DOMString vmName, [instanceOf=Entry] object entry,
- SimpleCallback callback);
+ [nocompile, supportsPromises]
+ static void unsharePathWithCrostini(DOMString vmName,
+ [instanceOf=Entry] object entry,
+ SimpleCallback callback);
// Returns list of paths shared with crostini container.
// |observeFirstForSession| If true, callback provides whether this is the
// |vmName| VM to get shared paths of.
// first time this function has been called with observeFirstForSession true.
- [nocompile] static void getCrostiniSharedPaths(
- boolean observeFirstForSession, DOMString vmName,
- GetCrostiniSharedPathsCallback callback);
+ [nocompile, supportsPromises]
+ static void getCrostiniSharedPaths(boolean observeFirstForSession,
+ DOMString vmName,
+ GetCrostiniSharedPathsCallback callback);
// Requests information about a Linux package. |entry| is a .deb file.
- [nocompile]
+ [nocompile, supportsPromises]
static void getLinuxPackageInfo([instanceOf=Entry] object entry,
GetLinuxPackageInfoCallback callback);
// Starts installation of a Linux package.
- [nocompile]
+ [nocompile, supportsPromises]
static void installLinuxPackage([instanceOf=Entry] object entry,
InstallLinuxPackageCallback callback);
@@ -1828,40 +1911,13 @@ interface Functions {
[nocompile]
static void importCrostiniImage([instanceOf=Entry] object entry);
- // For a file in DriveFS, retrieves its thumbnail. If |cropToSquare| is true,
- // returns a thumbnail appropriate for file list or grid views; otherwise,
- // returns a thumbnail appropriate for quickview.
- [nocompile]
- static void getDriveThumbnail([instanceOf=FileEntry] object entry,
- boolean cropToSquare,
- GetThumbnailCallback callback);
-
- // For a local PDF file, retrieves its thumbnail with a given |width| and
- // |height|.
- [nocompile]
- static void getPdfThumbnail([instanceOf=FileEntry] object entry,
- long width,
- long height,
- GetThumbnailCallback callback);
-
- // Retrieves a thumbnail of an ARC DocumentsProvider file, closely matching
- // the hinted size specified by |widthHint| and |heightHint|, but not
- // necessarily the exact size. |callback| is called with thumbnail data
- // encoded as a data URL. If the document does not support thumbnails,
- // |callback| is called with an empty string.
- // Note: The thumbnail data may originate from third-party application code,
- // and is untrustworthy (Security).
- [nocompile]
- static void getArcDocumentsProviderThumbnail([instanceOf=FileEntry] object entry,
- long widthHint,
- long heightHint,
- GetThumbnailCallback callback);
-
// Returns a list of Android picker apps to be shown in file selector.
+ [supportsPromises]
static void getAndroidPickerApps(DOMString[] extensions,
GetAndroidPickerAppsCallback callback);
// Called when the user selects an Android picker app in file selector.
+ [supportsPromises]
static void selectAndroidPickerApp(AndroidApp androidApp,
SimpleCallback callback);
@@ -1870,7 +1926,7 @@ interface Functions {
// |callback| is called with error in case of failure and with no arguments
// if successfully launched the Sharesheet dialog, but before user has
// finished the sharing.
- [nocompile]
+ [nocompile, supportsPromises]
static void sharesheetHasTargets([instanceOf=Entry] object[] entries,
BooleanCallback callback);
@@ -1880,7 +1936,7 @@ interface Functions {
// |dlpSourceUrls| Array of source URLs corresponding to the entries, used to
// check Data Leak Prevention (DLP) restrictions
// |callback|
- [nocompile]
+ [nocompile, supportsPromises]
static void invokeSharesheet([instanceOf=Entry] object[] entries,
SharesheetLaunchSource launchSource,
DOMString[] dlpSourceUrls,
@@ -1892,7 +1948,7 @@ interface Functions {
// |entries| The list of entries whose holding space needs to be updated.
// |add| Whether items should be added or removed from the holding space.
// |callback| Completion callback.
- [nocompile]
+ [nocompile, supportsPromises]
static void toggleAddedToHoldingSpace([instanceOf=Entry] object[] entries,
boolean added,
optional SimpleCallback callback);
@@ -1900,9 +1956,11 @@ interface Functions {
// Retrieves the current holding space state, for example the list of items
// the holding space currently contains.
// |callback| The result callback.
+ [supportsPromises]
static void getHoldingSpaceState(HoldingSpaceStateCallback callback);
// Returns true via `callback` if tablet mode is enabled, false otherwise.
+ [supportsPromises]
static void isTabletModeEnabled(BooleanCallback callback);
// Notifies the browser of the result of a dialog displayed earlier as a
@@ -1913,6 +1971,7 @@ interface Functions {
static void openURL(DOMString url);
// Creates a new Files app window in the directory provided in `params`.
+ [supportsPromises]
static void openWindow(OpenWindowParams params, BooleanCallback callback);
// Opens the feedback report window.
@@ -1920,9 +1979,9 @@ interface Functions {
// Starts an I/O task of type |type| on |entries|. Task type specific
// parameters are passed via |params|.
- [nocompile]
+ [nocompile, supportsPromises]
static void startIOTask(
- IOTaskType type,
+ IoTaskType type,
[instanceOf=Entry] object[] entries,
IOTaskParams params,
optional IOTaskIdCallback callback);
@@ -1935,19 +1994,31 @@ interface Functions {
// each I/O task's progress status.
static void resumeIOTask(long taskId, ResumeParams params);
+ // Notifies the browser that any info still stored about an already completed
+ // I/O task identified by |taskId| can be cleared.
+ [supportsPromises]
+ static void dismissIOTask(long taskId, SimpleCallback callback);
+
// Shows a policy dialog for a task. Task ids are communicated to the Files
// App in each I/O task's progress status.
- static void showPolicyDialog(long taskId, PolicyDialogType type);
+ [supportsPromises]
+ static void showPolicyDialog(
+ long taskId,
+ PolicyDialogType type,
+ SimpleCallback callback);
// Makes I/O tasks in state::PAUSED emit (broadcast) their current I/O task
// progress status.
- static void progressPausedTasks();
+ [supportsPromises]
+ static void progressPausedTasks(SimpleCallback callback);
// Lists mountable Guest OSs.
+ [supportsPromises]
static void listMountableGuests(ListMountableGuestsCallback callback);
// Starts and mounts the target Guest OS.
// |callback|
+ [supportsPromises]
static void mountGuest(long id, SimpleCallback callback);
// Tells DriveFS to update its cached pin states of hosted files (once).
@@ -1957,15 +2028,17 @@ interface Functions {
static void openManageSyncSettings();
// Validates and parses the supplied `entries` as .trashinfo files.
- [nocompile]
+ [nocompile, supportsPromises]
static void parseTrashInfoFiles([instanceOf=Entry] object[] entries,
ParseTrashInfoFilesCallback callback);
// Returns the current progress of the bulk pinning manager.
+ [supportsPromises]
static void getBulkPinProgress(GetBulkPinProgressCallback callback);
// Starts calculating the space required to pin all the items in a users My
// drive.
+ [supportsPromises]
static void calculateBulkPinRequiredSpace(SimpleCallback callback);
};
@@ -1985,6 +2058,8 @@ interface Events {
static void onPreferencesChanged();
+ static void onDeviceConnectionStatusChanged(DeviceConnectionState state);
+
static void onDriveConnectionStatusChanged();
static void onDeviceChanged(DeviceEvent event);
diff --git a/idl/chrome/file_manager_private_internal.idl b/idl/chrome/file_manager_private_internal.idl
index 939303b..be2b055 100644
--- a/idl/chrome/file_manager_private_internal.idl
+++ b/idl/chrome/file_manager_private_internal.idl
@@ -31,6 +31,10 @@ namespace fileManagerPrivateInternal {
double modifiedTimestamp;
fileManagerPrivate.FileCategory category;
};
+ dictionary CrostiniSharedPathResponse {
+ EntryDescription[] entries;
+ boolean firstForSession;
+ };
callback SimpleCallback = void();
callback ResolveIsolatedEntriesCallback = void(EntryDescription[] entries);
@@ -57,11 +61,11 @@ namespace fileManagerPrivateInternal {
callback GetDirectorySizeCallback = void(double size);
callback GetRecentFilesCallback = void(EntryDescription[] entries);
callback GetCrostiniSharedPathsCallback =
- void(EntryDescription[] entries, boolean firstForSession);
+ void(CrostiniSharedPathResponse response);
callback GetLinuxPackageInfoCallback =
void(fileManagerPrivate.LinuxPackageInfo linux_package_info);
callback InstallLinuxPackageCallback =
- void(fileManagerPrivate.InstallLinuxPackageResponse response);
+ void(fileManagerPrivate.InstallLinuxPackageStatus status);
callback GetThumbnailCallback = void(DOMString ThumbnailDataUrl);
callback BooleanCallback = void(boolean result);
callback GetVolumeRootCallback = void(EntryDescription rootDir);
@@ -69,104 +73,123 @@ namespace fileManagerPrivateInternal {
callback SearchFilesCallback = void(EntryDescription[] entries);
interface Functions {
- static void resolveIsolatedEntries(DOMString[] urls,
- ResolveIsolatedEntriesCallback callback);
- static void getEntryProperties(
+ [supportsPromises] static void resolveIsolatedEntries(
+ DOMString[] urls,
+ ResolveIsolatedEntriesCallback callback);
+ [supportsPromises] static void getEntryProperties(
DOMString[] urls,
fileManagerPrivate.EntryPropertyName[] names,
GetEntryPropertiesCallback callback);
- static void addFileWatch(
+ [supportsPromises] static void addFileWatch(
DOMString url,
AddFileWatchCallback callback);
- static void removeFileWatch(
+ [supportsPromises] static void removeFileWatch(
DOMString url,
RemoveFileWatchCallback callback);
- static void getCustomActions(DOMString[] urls,
- GetCustomActionsCallback callback);
- static void executeCustomAction(DOMString[] urls,
- DOMString actionId,
- SimpleCallback callback);
- static void computeChecksum(DOMString url,
- ComputeChecksumCallback callback);
- static void getMimeType(DOMString url,
- GetMimeTypeCallback callback);
- static void getContentMimeType(DOMString blobUUID,
- GetContentMimeTypeCallback callback);
- static void getContentMetadata(DOMString blobUUID,
- DOMString mimeType,
- boolean includeImages,
- GetContentMetadataCallback callback);
- static void pinDriveFile(DOMString url,
- boolean pin,
- SimpleCallback callback);
- static void executeTask(fileManagerPrivate.FileTaskDescriptor descriptor,
- DOMString[] urls,
- ExecuteTaskCallback callback);
- static void searchFiles(SearchFilesParams searchParams, SearchFilesCallback callback);
- static void setDefaultTask(fileManagerPrivate.FileTaskDescriptor descriptor,
- DOMString[] urls,
- DOMString[] mimeTypes,
- SimpleCallback callback);
- static void getFileTasks(DOMString[] urls,
- DOMString[] dlpSourceUrls,
- GetFileTasksCallback callback);
- static void getDisallowedTransfers(DOMString[] entries,
- DOMString destinationEntry,
- boolean isMove,
- GetDisallowedTransfersCallback callback);
- static void getDlpMetadata(DOMString[] entries,
- GetDlpMetadataCallback callback);
- static void getDriveQuotaMetadata(DOMString url,
- GetDriveQuotaMetadataCallback callback);
- static void validatePathNameLength(
+ [supportsPromises] static void getCustomActions(
+ DOMString[] urls,
+ GetCustomActionsCallback callback);
+ [supportsPromises] static void executeCustomAction(
+ DOMString[] urls,
+ DOMString actionId,
+ SimpleCallback callback);
+ [supportsPromises] static void computeChecksum(
+ DOMString url,
+ ComputeChecksumCallback callback);
+ [supportsPromises] static void getMimeType(
+ DOMString url,
+ GetMimeTypeCallback callback);
+ [supportsPromises] static void getContentMimeType(
+ DOMString blobUUID,
+ GetContentMimeTypeCallback callback);
+ [supportsPromises] static void getContentMetadata(
+ DOMString blobUUID,
+ DOMString mimeType,
+ boolean includeImages,
+ GetContentMetadataCallback callback);
+ [supportsPromises] static void pinDriveFile(
+ DOMString url,
+ boolean pin,
+ SimpleCallback callback);
+ [supportsPromises] static void executeTask(
+ fileManagerPrivate.FileTaskDescriptor descriptor,
+ DOMString[] urls,
+ ExecuteTaskCallback callback);
+ [supportsPromises] static void searchFiles(
+ SearchFilesParams searchParams, SearchFilesCallback callback);
+ [supportsPromises] static void setDefaultTask(
+ fileManagerPrivate.FileTaskDescriptor descriptor,
+ DOMString[] urls,
+ DOMString[] mimeTypes,
+ SimpleCallback callback);
+ [supportsPromises] static void getFileTasks(
+ DOMString[] urls,
+ DOMString[] dlpSourceUrls,
+ GetFileTasksCallback callback);
+ [supportsPromises] static void getDisallowedTransfers(
+ DOMString[] entries,
+ DOMString destinationEntry,
+ boolean isMove,
+ GetDisallowedTransfersCallback callback);
+ [supportsPromises] static void getDlpMetadata(
+ DOMString[] entries,
+ GetDlpMetadataCallback callback);
+ [supportsPromises] static void getDriveQuotaMetadata(
+ DOMString url,
+ GetDriveQuotaMetadataCallback callback);
+ [supportsPromises] static void validatePathNameLength(
DOMString parentUrl,
DOMString name,
ValidatePathNameLengthCallback callback);
- static void getDirectorySize(DOMString url,
- GetDirectorySizeCallback callback);
- static void getVolumeRoot(fileManagerPrivate.GetVolumeRootOptions options,
- GetVolumeRootCallback callback);
- static void getRecentFiles(fileManagerPrivate.SourceRestriction restriction,
- fileManagerPrivate.FileCategory file_category,
- boolean invalidate_cache,
- GetRecentFilesCallback callback);
- static void sharePathsWithCrostini(DOMString vmName, DOMString[] urls,
- boolean persist,
- SimpleCallback callback);
- static void unsharePathWithCrostini(DOMString vmName, DOMString url,
- SimpleCallback callback);
- static void getCrostiniSharedPaths(boolean observeFirstForSession,
- DOMString vmName,
- GetCrostiniSharedPathsCallback callback);
- static void getLinuxPackageInfo(DOMString url,
- GetLinuxPackageInfoCallback callback);
- static void installLinuxPackage(DOMString url,
- InstallLinuxPackageCallback callback);
+ [supportsPromises] static void getDirectorySize(
+ DOMString url,
+ GetDirectorySizeCallback callback);
+ [supportsPromises] static void getVolumeRoot(
+ fileManagerPrivate.GetVolumeRootOptions options,
+ GetVolumeRootCallback callback);
+ [supportsPromises] static void getRecentFiles(
+ fileManagerPrivate.SourceRestriction restriction,
+ DOMString query,
+ long cutoff_days,
+ fileManagerPrivate.FileCategory file_category,
+ boolean invalidate_cache,
+ GetRecentFilesCallback callback);
+ [supportsPromises] static void sharePathsWithCrostini(
+ DOMString vmName, DOMString[] urls,
+ boolean persist,
+ SimpleCallback callback);
+ [supportsPromises] static void unsharePathWithCrostini(
+ DOMString vmName, DOMString url,
+ SimpleCallback callback);
+ static void getCrostiniSharedPaths(
+ boolean observeFirstForSession,
+ DOMString vmName,
+ GetCrostiniSharedPathsCallback callback);
+ [supportsPromises] static void getLinuxPackageInfo(
+ DOMString url,
+ GetLinuxPackageInfoCallback callback);
+ [supportsPromises] static void installLinuxPackage(
+ DOMString url,
+ InstallLinuxPackageCallback callback);
static void importCrostiniImage(DOMString url);
- static void getDriveThumbnail(DOMString url,
- boolean cropToSquare,
- GetThumbnailCallback callback);
- static void getPdfThumbnail(DOMString url,
- long width,
- long height,
- GetThumbnailCallback callback);
- static void getArcDocumentsProviderThumbnail(DOMString url,
- long widthHint,
- long heightHint,
- GetThumbnailCallback callback);
- static void sharesheetHasTargets(DOMString[] urls, BooleanCallback callback);
- static void invokeSharesheet(
+ [supportsPromises] static void sharesheetHasTargets(
+ DOMString[] urls,
+ BooleanCallback callback);
+ [supportsPromises] static void invokeSharesheet(
DOMString[] urls,
fileManagerPrivate.SharesheetLaunchSource launchSource,
DOMString[] dlpSourceUrls,
SimpleCallback callback);
- static void toggleAddedToHoldingSpace(DOMString[] urls, boolean add,
+ [supportsPromises] static void toggleAddedToHoldingSpace(
+ DOMString[] urls, boolean add,
optional SimpleCallback callback);
- static void startIOTask(fileManagerPrivate.IOTaskType type,
- DOMString[] urls,
- IOTaskParams params,
- optional IOTaskIdCallback callback);
- static void parseTrashInfoFiles(DOMString[] urls,
- ParseTrashInfoFilesCallback callback);
+ [supportsPromises] static void startIOTask(
+ fileManagerPrivate.IoTaskType type,
+ DOMString[] urls,
+ IOTaskParams params,
+ optional IOTaskIdCallback callback);
+ [supportsPromises] static void parseTrashInfoFiles(
+ DOMString[] urls,
+ ParseTrashInfoFilesCallback callback);
};
};
\ No newline at end of file
diff --git a/idl/chrome/file_system_provider.idl b/idl/chrome/file_system_provider.idl
index 51d112d..3f767db 100644
--- a/idl/chrome/file_system_provider.idl
+++ b/idl/chrome/file_system_provider.idl
@@ -52,6 +52,15 @@ namespace fileSystemProvider {
SHARE
};
+ // Cloud storage representation of a file system entry.
+ dictionary CloudIdentifier {
+ // Identifier for the cloud storage provider (e.g. 'drive.google.com').
+ DOMString providerName;
+
+ // The provider's identifier for the given file/directory.
+ DOMString id;
+ };
+
// Represents metadata of a file or a directory.
dictionary EntryMetadata {
// True if it is a directory. Must be provided if requested in
@@ -78,6 +87,12 @@ namespace fileSystemProvider {
// 32 KB in size. Optional, but can be provided only when explicitly
// requested by the $(ref:onGetMetadataRequested) event.
DOMString? thumbnail;
+
+ // Cloud storage representation of this entry. Must be provided if requested
+ // in options and the file is backed by cloud storage. For
+ // local files not backed by cloud storage, it should be undefined when
+ // requested.
+ CloudIdentifier? cloudIdentifier;
};
// Represents a watcher.
@@ -110,7 +125,7 @@ namespace fileSystemProvider {
// The identifier of the file system.
DOMString fileSystemId;
- // A human-readable name for the file system.
+ // A human-readable name for the file system.
DOMString displayName;
// Whether the file system supports operations which may change contents
@@ -138,7 +153,7 @@ namespace fileSystemProvider {
// extension.
DOMString fileSystemId;
- // A human-readable name for the file system.
+ // A human-readable name for the file system.
DOMString displayName;
// Whether the file system supports operations which may change contents
@@ -200,8 +215,12 @@ namespace fileSystemProvider {
// Set to true if mimeType value is requested.
boolean mimeType;
- // Set to true if the thumbnail is requested.
+ // Set to true if thumbnail value is requested.
boolean thumbnail;
+
+ // Set to true if cloudIdentifier value is
+ // requested.
+ boolean cloudIdentifier;
};
// Options for the $(ref:onGetActionsRequested) event.
@@ -224,7 +243,7 @@ namespace fileSystemProvider {
// The unique identifier of this request.
long requestId;
- // The path of the directory which contents are requested.
+ // The path of the directory which contents are requested.
DOMString directoryPath;
// Set to true if is_directory value is requested.
@@ -243,7 +262,7 @@ namespace fileSystemProvider {
// Set to true if mimeType value is requested.
boolean mimeType;
- // Set to true if the thumbnail is requested.
+ // Set to true if thumbnail value is requested.
boolean thumbnail;
};
@@ -584,7 +603,7 @@ namespace fileSystemProvider {
// Notifies about changes in the watched directory at
// observedPath in recursive mode. If the file
- // system is mounted with supportsNofityTag, then
+ // system is mounted with supportsNotifyTag, then
// tag must be provided, and all changes since the last
// notification always reported, even if the system was shutdown. The last
// tag can be obtained with $(ref:getAll).
@@ -785,4 +804,4 @@ namespace fileSystemProvider {
ProviderSuccessCallback successCallback,
ProviderErrorCallback errorCallback);
};
-};
+};
\ No newline at end of file
diff --git a/idl/chrome/history.json b/idl/chrome/history.json
index 4898aa7..b209bca 100644
--- a/idl/chrome/history.json
+++ b/idl/chrome/history.json
@@ -5,7 +5,7 @@
[
{
"namespace": "history",
- "description": "Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.",
+ "description": "Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.",
"types": [
{
"id": "TransitionType",
diff --git a/idl/chrome/identity.idl b/idl/chrome/identity.idl
index 88ff6ec..1e17087 100644
--- a/idl/chrome/identity.idl
+++ b/idl/chrome/identity.idl
@@ -12,9 +12,9 @@ namespace identity {
};
enum AccountStatus {
- // Sync is enabled for the primary account.
+ // Specifies that Sync is enabled for the primary account.
SYNC,
- // Any primary account, if exists.
+ // Specifies the existence of a primary account, if any.
ANY
};
@@ -135,7 +135,7 @@ namespace identity {
// Gets an OAuth2 access token using the client ID and scopes
// specified in the oauth2
+ // href="/docs/apps/app_identity#update_manifest">oauth2
// section of manifest.json.
//
// The Identity API caches access tokens in memory, so it's ok to
diff --git a/idl/chrome/image_loader_private.idl b/idl/chrome/image_loader_private.idl
new file mode 100644
index 0000000..f695fb4
--- /dev/null
+++ b/idl/chrome/image_loader_private.idl
@@ -0,0 +1,41 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// imageLoaderPrivate API.
+// This is a private API used by the ChromeOS FilesApp ImageLoader extension.
+[platforms=("chromeos"),
+ implemented_in="chrome/browser/ash/extensions/file_manager/image_loader_private_api.h"]
+namespace imageLoaderPrivate {
+ // |thumbnailDataUrl| A data URL for the thumbnail; |thumbnailDataUrl| is
+ // empty if no thumbnail was available.
+ callback GetThumbnailCallback = void(DOMString thumbnailDataUrl);
+
+ interface Functions {
+ // For a file in DriveFS, retrieves its thumbnail. If |cropToSquare| is
+ // true, returns a thumbnail appropriate for file list or grid views;
+ // otherwise, returns a thumbnail appropriate for quickview.
+ static void getDriveThumbnail(DOMString url,
+ boolean cropToSquare,
+ GetThumbnailCallback callback);
+
+ // For a local PDF file, retrieves its thumbnail with a given |width| and
+ // |height|.
+ static void getPdfThumbnail(DOMString url,
+ long width,
+ long height,
+ GetThumbnailCallback callback);
+
+ // Retrieves a thumbnail of an ARC DocumentsProvider file, closely matching
+ // the hinted size specified by |widthHint| and |heightHint|, but not
+ // necessarily the exact size. |callback| is called with thumbnail data
+ // encoded as a data URL. If the document does not support thumbnails,
+ // |callback| is called with an empty string.
+ // Note: The thumbnail data may originate from third-party application code,
+ // and is untrustworthy (Security).
+ static void getArcDocumentsProviderThumbnail(DOMString url,
+ long widthHint,
+ long heightHint,
+ GetThumbnailCallback callback);
+ };
+};
diff --git a/idl/chrome/image_writer_private.idl b/idl/chrome/image_writer_private.idl
index e491487..9dfef5c 100644
--- a/idl/chrome/image_writer_private.idl
+++ b/idl/chrome/image_writer_private.idl
@@ -142,4 +142,4 @@ namespace imageWriterPrivate {
static void onDeviceRemoved(RemovableStorageDevice device);
};
-};
+};
\ No newline at end of file
diff --git a/idl/chrome/input_method_private.json b/idl/chrome/input_method_private.json
index ae67a46..b567c50 100644
--- a/idl/chrome/input_method_private.json
+++ b/idl/chrome/input_method_private.json
@@ -63,6 +63,41 @@
"description": "The auto-capitalize type of the text field.",
"enum": ["off", "characters", "words", "sentences"]
},
+ {
+ "id": "LanguagePackStatus",
+ "type": "string",
+ "description": "The aggregated status of all language packs for a given input method.",
+ "enum": [
+ // This should only be used when we have uninitialised data.
+ "unknown",
+ "notInstalled",
+ "inProgress",
+ // If there are no language packs associated with an input method,
+ // such as for input methods which aren't Google 1P, installed is
+ // returned.
+ "installed",
+ "errorOther",
+ "errorNeedsReboot"
+ ]
+ },
+ {
+ "id": "LanguagePackStatusChange",
+ "type": "object",
+ "description": "Object returned by callbacks when the status of language packs change.",
+ "properties": {
+ "engineIds": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "All engine IDs for which this language pack status change applies to."
+ },
+ "status": {
+ "$ref": "LanguagePackStatus",
+ "description": "The new language pack status."
+ }
+ }
+ },
{
"id": "InputContext",
"type": "object",
@@ -94,6 +129,7 @@
"physicalKeyboardAutoCorrectionLevel": { "type": "integer", "optional": true, "description": "The level of auto correction for physical keyboard (0: Off, 1: Modest, 2: Aggressive)."},
"physicalKeyboardEnableCapitalization": { "type": "boolean", "optional": true, "description": "Whether to enable auto capitalization for physical keyboard."},
"physicalKeyboardEnableDiacriticsOnLongpress": { "type": "boolean", "optional": true, "description": "Whether to enable diacritics on longpress for physical keyboard."},
+ "physicalKeyboardEnablePredictiveWriting" : {"type": "boolean", "optional": true, "description": "Whether to enable physical keyboard predictive writing"},
"virtualKeyboardAutoCorrectionLevel": { "type": "integer", "optional": true, "description": "The level of auto correction for virtual keyboard (0: Off, 1: Modest, 2: Aggressive)."},
"virtualKeyboardEnableCapitalization": { "type": "boolean", "optional": true, "description": "Whether enable auto capitalization for virtual keyboard."},
"xkbLayout": { "type": "string", "optional": true, "description": "The xkb keyboard (system provided keyboard) layout."},
@@ -131,7 +167,16 @@
},
"zhuyinKeyboardLayout": { "type": "string", "optional": true, "description": "The layout of zhuyin keyboard."},
"zhuyinPageSize": { "type": "integer", "optional": true, "description": "The page size of zhuyin candidate page."},
- "zhuyinSelectKeys": { "type": "string", "optional": true, "description": "The keys used to select candidates in zhuyin."}
+ "zhuyinSelectKeys": { "type": "string", "optional": true, "description": "The keys used to select candidates in zhuyin."},
+ "vietnameseVniAllowFlexibleDiacritics": { "type": "boolean", "optional": true, "description": "Enable VNI flexible Vietnamese typing mode"},
+ "vietnameseVniNewStyleToneMarkPlacement": { "type": "boolean", "optional": true, "description": "Enable VNI modern tone mark placement"},
+ "vietnameseVniInsertDoubleHornOnUo": { "type": "boolean", "optional": true, "description": "Enable VNI insert-double-horn-on-UO shortcut"},
+ "vietnameseVniShowUnderline": { "type": "boolean", "optional": true, "description": "Enable VNI showing underline on composition text"},
+ "vietnameseTelexAllowFlexibleDiacritics": { "type": "boolean", "optional": true, "description": "Enable Telex flexible Vietnamese typing mode"},
+ "vietnameseTelexNewStyleToneMarkPlacement": { "type": "boolean", "optional": true, "description": "Enable Telex modern tone mark placement"},
+ "vietnameseTelexInsertDoubleHornOnUo": { "type": "boolean", "optional": true, "description": "Enable Telex insert-double-horn-on-UO horn shortcut"},
+ "vietnameseTelexInsertUHornOnW": { "type": "boolean", "optional": true, "description": "Enable Telex inser-U-Horn-on-W shortcut"},
+ "vietnameseTelexShowUnderline": { "type": "boolean", "optional": true, "description": "Enable Telex showing underline on composition text"}
}
}
],
@@ -501,55 +546,33 @@
}]
},
{
- "name" : "getTextFieldBounds",
+ "name" : "notifyInputMethodReadyForTesting",
"type" : "function",
- "description" : "Get the bounds of the current text field",
- "parameters" :[
+ "description" : "Notifies Chrome that the current input method is ready to accept key events from Tast.",
+ "parameters": []
+ },
+ {
+ "name": "getLanguagePackStatus",
+ "type": "function",
+ "description": "Gets the aggregate status of all language packs for a given input method.",
+ "parameters": [
{
- "name": "parameters",
- "type": "object",
- "properties": {
- "contextID": {
- "description": "ID of the context.",
- "type": "integer"
- }
- }
+ "name": "inputMethodId",
+ "type": "string",
+ "description": "Fully qualified ID of the input method"
}
],
"returns_async": {
"name": "callback",
- "description": "Called with screen coordinates of the text field when the operation completes. On failure, $(ref:runtime.lastError) is set.",
+ "description": "Called with a LanguagePackStatus when the operation completes.",
"parameters": [
{
- "name": "textFieldBounds",
- "type": "object",
- "properties": {
- "x": {
- "description": "The x-coordinate of the text field's bounds.",
- "type": "integer"
- },
- "y": {
- "description": "The y-coordinate of the text field's bounds.",
- "type": "integer"
- },
- "width": {
- "description": "The width of the text field's bounds.",
- "type": "integer"
- },
- "height":{
- "description": "The height of the bounds.",
- "type": "integer"
- }
- }
+ "name": "status",
+ "$ref": "LanguagePackStatus",
+ "description": "The aggregated status of all language packs for the given input method, or 'installed' if there are no language packs."
}
]
}
- },
- {
- "name" : "notifyInputMethodReadyForTesting",
- "type" : "function",
- "description" : "Notifies Chrome that the current input method is ready to accept key events from Tast.",
- "parameters": []
}
],
"events": [
@@ -654,17 +677,6 @@
"description": "Describes the text field that has acquired focus."
}
]
- }, {
- "name": "onTouch",
- "type": "function",
- "description": "This event is sent when a touch occurs in a text field. Should only happen after onFocus()",
- "parameters": [
- {
- "$ref": "FocusReason",
- "name": "pointerType",
- "description": "Pointer type used to touch the text field"
- }
- ]
}, {
"name": "onSettingsChanged",
"type": "function",
@@ -717,6 +729,17 @@
"description": "The engine ID for the input method being changed."
}
]
+ }, {
+ "name": "onLanguagePackStatusChanged",
+ "type": "function",
+ "description": "This event is sent when any IME's language pack status is changed.",
+ "parameters": [
+ {
+ "name": "change",
+ "$ref": "LanguagePackStatusChange",
+ "description": "Information about what changed."
+ }
+ ]
}
]
}
diff --git a/idl/chrome/login_state.idl b/idl/chrome/login_state.idl
index 6819d20..fe65b8b 100644
--- a/idl/chrome/login_state.idl
+++ b/idl/chrome/login_state.idl
@@ -8,30 +8,30 @@
implemented_in="chrome/browser/chromeos/extensions/login_screen/login_state/login_state_api.h"]
namespace loginState {
enum ProfileType {
- // The extension is in the signin profile.
+ // Specifies that the extension is in the signin profile.
SIGNIN_PROFILE,
- // The extension is in the user profile.
+ // Specifies that the extension is in the user profile.
USER_PROFILE
};
enum SessionState {
- // The session state is unknown.
+ // Specifies that the session state is unknown.
UNKNOWN,
- // The user is in the out-of-box-experience screen.
+ // Specifies that the user is in the out-of-box-experience screen.
IN_OOBE_SCREEN,
- // The user is in the login screen.
+ // Specifies that the user is in the login screen.
IN_LOGIN_SCREEN,
- // The user is in the session.
+ // Specifies that the user is in the session.
IN_SESSION,
- // The user is in the lock screen.
+ // Specifies that the user is in the lock screen.
IN_LOCK_SCREEN,
- // The device is in RMA mode, finalizing repairs.
+ // Specifies that the device is in RMA mode, finalizing repairs.
IN_RMA_SCREEN
};
diff --git a/idl/chrome/manifest_types.json b/idl/chrome/manifest_types.json
index 849a053..9bdb15e 100644
--- a/idl/chrome/manifest_types.json
+++ b/idl/chrome/manifest_types.json
@@ -8,7 +8,9 @@
{
"namespace": "manifestTypes",
"description": "Schemas for structured manifest entries",
- "compiler_options": { "generate_error_messages": true },
+ "compiler_options": {
+ "generate_error_messages": true
+ },
"types": [
{
"id": "ChromeSettingsOverrides",
diff --git a/idl/chrome/notifications.idl b/idl/chrome/notifications.idl
index 2d30def..fe8c649 100644
--- a/idl/chrome/notifications.idl
+++ b/idl/chrome/notifications.idl
@@ -6,27 +6,30 @@
// using templates and show these notifications to users in the system tray.
namespace notifications {
[noinline_doc] enum TemplateType {
- // icon, title, message, expandedMessage, up to two buttons
+ // Contains an icon, title, message, expandedMessage, and up to two
+ // buttons.
basic,
- // icon, title, message, expandedMessage, image, up to two buttons
+ // Contains an icon, title, message, expandedMessage, image, and up
+ // to two buttons.
[deprecated="The image is not visible for Mac OS X users."]
image,
- // icon, title, message, items, up to two buttons. Users on Mac OS X only
- // see the first item.
+ // Contains an icon, title, message, items, and up to two buttons.
+ // Users on Mac OS X only see the first item.
list,
- // icon, title, message, progress, up to two buttons
+ // Contains an icon, title, message, progress, and up to two buttons.
progress
};
enum PermissionLevel {
- // User has elected to show notifications from the app or extension.
- // This is the default at install time.
+ // Specifies that the user has elected to show notifications
+ // from the app or extension. This is the default at install time.
granted,
- // User has elected not to show notifications from the app or extension.
+ // Specifies that the user has elected not to show notifications
+ // from the app or extension.
denied
};
diff --git a/idl/chrome/odfs_config_private.idl b/idl/chrome/odfs_config_private.idl
new file mode 100644
index 0000000..e16ef6f
--- /dev/null
+++ b/idl/chrome/odfs_config_private.idl
@@ -0,0 +1,57 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Use the chrome.odfsConfigPrivate API to configure the
+// Microsoft OneDrive integration.
+[implemented_in = "chrome/browser/chromeos/extensions/odfs_config_private/odfs_config_private_api.h",
+modernised_enums]
+namespace odfsConfigPrivate {
+
+ enum Mount {
+ allowed,
+ disallowed,
+ automated
+ };
+
+ dictionary MountInfo {
+ Mount mode;
+ };
+
+ dictionary AccountRestrictionsInfo {
+ DOMString[] restrictions;
+ };
+
+ callback GetMountCallback = void(MountInfo mount);
+ callback GetAccountRestrictionsCallback = void(
+ AccountRestrictionsInfo restrictions);
+ callback ShowAutomatedMountErrorCallback = void();
+
+ interface Functions {
+ // Returns the OneDrive mount mode from the admin policy.
+ // |callback|: Invoked when the policy value was retrieved.
+ static void getMount(
+ GetMountCallback callback);
+
+ // Returns the OneDrive account restrictions from the admin policy.
+ // |callback|: Invoked when the policy value was retrieved.
+ static void getAccountRestrictions(
+ GetAccountRestrictionsCallback callback);
+
+ // Shows a notification that the automated mount failed.
+ static void showAutomatedMountError(
+ ShowAutomatedMountErrorCallback callback);
+ };
+
+ interface Events {
+ // Fired when the OneDrive mount mode changed.
+ // |event|: A OneDrive mount mode changed event.
+ static void onMountChanged(MountInfo event);
+
+ // Fired when the OneDrive restrictions changed.
+ // |event|: A OneDrive restrictions changed event.
+ static void onAccountRestrictionsChanged(
+ AccountRestrictionsInfo event);
+ };
+
+};
\ No newline at end of file
diff --git a/idl/chrome/passwords_private.idl b/idl/chrome/passwords_private.idl
index 03eb500..2fafbe1 100644
--- a/idl/chrome/passwords_private.idl
+++ b/idl/chrome/passwords_private.idl
@@ -118,6 +118,44 @@ namespace passwordsPrivate {
VALID
};
+ enum FamilyFetchStatus {
+ // Unknown or network error.
+ UNKNOWN_ERROR,
+ // No family members found.
+ NO_MEMBERS,
+ // At least one family member found.
+ SUCCESS
+ };
+
+ dictionary PublicKey {
+ // The value of the public key.
+ DOMString value;
+ // The version of the public key.
+ long version;
+ };
+
+ dictionary RecipientInfo {
+ // User ID of the recipient.
+ DOMString userId;
+ // Email of the recipient.
+ DOMString email;
+ // Name of the recipient.
+ DOMString displayName;
+ // Profile image URL of the recipient.
+ DOMString profileImageUrl;
+ // Whether the user can receive passwords.
+ boolean isEligible;
+ // The public key of the recipient.
+ PublicKey? publicKey;
+ };
+
+ dictionary FamilyFetchResults {
+ // Status of the family members fetch.
+ FamilyFetchStatus status;
+ // List of family members.
+ RecipientInfo[] familyMembers;
+ };
+
dictionary ImportEntry {
// The parsing status of individual row that represents
// credential during import process.
@@ -190,10 +228,7 @@ namespace passwordsPrivate {
// Entry used to display a password in the settings UI.
dictionary PasswordUiEntry {
// The URL collection corresponding to this saved password entry.
- // TODO(crbug.com/1383972): remove |urls| when old Password Manager UI is
- // deprecated.
- UrlCollection urls;
- DomainInfo[]? affiliatedDomains;
+ DomainInfo[] affiliatedDomains;
// The username used in conjunction with the saved password.
DOMString username;
@@ -214,9 +249,6 @@ namespace passwordsPrivate {
// Corresponds to where the credential is stored.
PasswordStoreSet storedIn;
- // Indicates whether this credential belongs to an Android app.
- boolean isAndroidCredential;
-
// Indicates whether this credential is a passkey.
boolean isPasskey;
@@ -305,25 +337,12 @@ namespace passwordsPrivate {
boolean useAccountStore;
};
- // Object describing the changes for a password entry.
- dictionary ChangeSavedPasswordParams {
- // The new username of the password.
- DOMString username;
-
- // The password value to be saved.
- DOMString password;
-
- // The note attached to the password. Omitting the note will clear it.
- DOMString? note;
- };
-
// An object holding an array of PasswordUiEntries.
dictionary PasswordUiEntryList {
PasswordUiEntry[] entries;
};
callback PlaintextPasswordCallback = void(DOMString password);
- callback ChangeSavedPasswordCallback = void(long newId);
callback PasswordListCallback = void(PasswordUiEntry[] entries);
callback CredentialsGroupCallback = void(CredentialGroup[] entries);
callback ExceptionListCallback = void(ExceptionEntry[] exceptions);
@@ -332,6 +351,7 @@ namespace passwordsPrivate {
callback OptInCallback = void(boolean optedIn);
callback PasswordCheckStatusCallback = void(PasswordCheckStatus status);
callback ImportPasswordsCallback = void(ImportResults results);
+ callback FetchFamilyResultsCallback = void(FamilyFetchResults results);
callback IsAccountStoreDefaultCallback = void(boolean isDefault);
callback GetUrlCollectionCallback = void(UrlCollection urlCollection);
callback CredentialsWithReusedPasswordCallback =
@@ -342,17 +362,6 @@ namespace passwordsPrivate {
// Settings WebUI.
static void recordPasswordsPageAccessInSettings();
- // Changes the saved password corresponding to |id|. Invokes |callback| or
- // raises an error depending on whether the operation succeeded.
- // |id|: The id for the password entry being updated.
- // |params|: The dictionary which holds the changed parameters.
- // |callback|: The callback that gets invoked in the end.
- // TODO(crbug.com/1420597): clean up after old password manager is removed.
- [supportsPromises] static void changeSavedPassword(
- long id,
- ChangeSavedPasswordParams params,
- optional ChangeSavedPasswordCallback callback);
-
// Changes the credential. Not all attributes can be updated.
// Optional attributes that are not set will be unchanged.
// Returns a promise that resolves if successful, and rejects otherwise.
@@ -422,6 +431,19 @@ namespace passwordsPrivate {
// |ids|: The ids for the password entries being moved.
static void movePasswordsToAccount(long[] ids);
+ // Fetches family members (password share recipients).
+ [supportsPromises] static void fetchFamilyMembers(
+ FetchFamilyResultsCallback callback);
+
+ // Sends sharing invitations to the recipients.
+ // |id|: The id of the password entry to be shared.
+ // |recipients|: The list of selected recipients.
+ // |callback|: The callback that gets invoked on success.
+ [supportsPromises] static void sharePassword(
+ long id,
+ RecipientInfo[] recipients,
+ optional VoidCallback callback);
+
// Triggers the Password Manager password import functionality.
[supportsPromises] static void importPasswords(
PasswordStoreSet toStore,
@@ -456,10 +478,6 @@ namespace passwordsPrivate {
[supportsPromises] static void requestExportProgressStatus(
ExportProgressStatusCallback callback);
- // Stops exporting passwords and cleans up any passwords, which were already
- // written to the filesystem.
- static void cancelExportPasswords();
-
// Requests the account-storage opt-in state of the current user.
[supportsPromises] static void isOptedInForAccountStorage(
OptInCallback callback);
@@ -486,22 +504,10 @@ namespace passwordsPrivate {
[supportsPromises] static void unmuteInsecureCredential(
PasswordUiEntry credential, optional VoidCallback callback);
- // Records that a change password flow was started for |credential|.
- // |credential|: The credential for which the flow was triggered.
- // |isAutomatedFlow|: Whether the flow is a manual one.
- // Invokes |callback| on completion.
- [supportsPromises] static void recordChangePasswordFlowStarted(
- PasswordUiEntry credential,
- optional VoidCallback callback);
-
// Starts a check for insecure passwords. Invokes |callback| on completion.
[supportsPromises] static void startPasswordCheck(
optional VoidCallback callback);
- // Stops checking for insecure passwords. Invokes |callback| on completion.
- [supportsPromises] static void stopPasswordCheck(
- optional VoidCallback callback);
-
// Returns the current status of the check via |callback|.
[supportsPromises] static void getPasswordCheckStatus(
PasswordCheckStatusCallback callback);
diff --git a/idl/chrome/pdf_viewer_private.idl b/idl/chrome/pdf_viewer_private.idl
index 96136ca..cecd250 100644
--- a/idl/chrome/pdf_viewer_private.idl
+++ b/idl/chrome/pdf_viewer_private.idl
@@ -6,11 +6,47 @@
// functionality that the PDF Viewer needs from outside the PDF plugin. This API
// is exclusively for the PDF Viewer.
namespace pdfViewerPrivate {
+ // Nearly identical to mimeHandlerPrivate.StreamInfo, but without a mime type
+ // nor a response header field. Those fields are unused by the PDF viewer.
+ dictionary StreamInfo {
+ // The original URL that was intercepted.
+ DOMString originalUrl;
+
+ // The URL that the stream can be read from.
+ DOMString streamUrl;
+
+ // The ID of the tab that opened the stream. If the stream is not opened in
+ // a tab, it will be -1.
+ long tabId;
+
+ // Whether the stream is embedded within another document.
+ boolean embedded;
+ };
+
+ // Identical to mimeHandlerPrivate.StreamInfo.
+ dictionary PdfPluginAttributes {
+ // The background color in ARGB format for painting. Since the background
+ // color is an unsigned 32-bit integer which can be outside the range of
+ // "long" type, define it as a "double" type here.
+ double backgroundColor;
+
+ // Indicates whether the plugin allows to execute JavaScript and maybe XFA.
+ // Loading XFA for PDF forms will automatically be disabled if this flag is
+ // false.
+ boolean allowJavascript;
+ };
+
+ callback GetStreamInfoCallback = void(StreamInfo streamInfo);
callback IsAllowedLocalFileAccessCallback = void(boolean result);
callback IsPdfOcrAlwaysActiveCallback = void(boolean result);
callback OnPdfOcrPrefSetCallback = void(boolean result);
+ callback VoidCallback = void();
interface Functions {
+ // Returns the StreamInfo for the stream for this context if there is one.
+ [supportsPromises] static void getStreamInfo(
+ GetStreamInfoCallback callback);
+
// Determines if the given URL should be allowed to access local files from
// the PDF Viewer. |callback|: Called with true if URL should be allowed to
// access local files from the PDF Viewer, false otherwise.
@@ -29,11 +65,21 @@ namespace pdfViewerPrivate {
// |callback|: The callback for whether the pref was set or not.
[supportsPromises] static void setPdfOcrPref(
boolean value, OnPdfOcrPrefSetCallback callback);
+
+ // Sets PDF plugin attributes in the stream for this context if there is
+ // one.
+ [supportsPromises] static void setPdfPluginAttributes(
+ PdfPluginAttributes attributes,
+ optional VoidCallback callback);
};
interface Events {
// Fired when a pref value for PDF OCR has changed.
// |value| The pref value that changed.
static void onPdfOcrPrefChanged(boolean value);
+
+ // Fired when the browser wants the listener to perform a save.
+ // `streamUrl`: Unique ID for the instance that should perform the save.
+ static void onSave(DOMString streamUrl);
};
};
\ No newline at end of file
diff --git a/idl/chrome/permissions.json b/idl/chrome/permissions.json
index c18a4a6..9213992 100644
--- a/idl/chrome/permissions.json
+++ b/idl/chrome/permissions.json
@@ -5,7 +5,7 @@
[
{
"namespace": "permissions",
- "description": "Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.",
+ "description": "Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary.",
"types": [
{
"id": "Permissions",
diff --git a/idl/chrome/platform_keys.idl b/idl/chrome/platform_keys.idl
index c34cfd6..966cd27 100644
--- a/idl/chrome/platform_keys.idl
+++ b/idl/chrome/platform_keys.idl
@@ -132,9 +132,11 @@ namespace platformKeys {
// apply PKCS#1 v1.5 padding but not hash the given data.
//
Currently, this method only supports the "RSASSA-PKCS1-v1_5" and
// "ECDSA" algorithms.
- [nocompile] static void getKeyPair(ArrayBuffer certificate,
- object parameters,
- GetKeyPairCallback callback);
+ [nocompile, doesNotSupportPromises=
+ "Multi-parameter callback crbug.com/1313625"]
+ static void getKeyPair(ArrayBuffer certificate,
+ object parameters,
+ GetKeyPairCallback callback);
// Passes the key pair identified by publicKeySpkiDer for
// usage with $(ref:platformKeys.subtleCrypto) to callback.
@@ -155,9 +157,11 @@ namespace platformKeys {
// named-curve P-256 and "RSASSA-PKCS1-v1_5" algorithm with one of the
// hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and
// "SHA-512".
- [nocompile] static void getKeyPairBySpki(ArrayBuffer publicKeySpkiDer,
- object parameters,
- GetKeyPairCallback callback);
+ [nocompile, doesNotSupportPromises=
+ "Multi-parameter callback crbug.com/1313625"]
+ static void getKeyPairBySpki(ArrayBuffer publicKeySpkiDer,
+ object parameters,
+ GetKeyPairCallback callback);
// An implementation of WebCrypto's
//
diff --git a/idl/chrome/platform_keys_internal.idl b/idl/chrome/platform_keys_internal.idl
index 008672d..5780720 100644
--- a/idl/chrome/platform_keys_internal.idl
+++ b/idl/chrome/platform_keys_internal.idl
@@ -56,6 +56,7 @@ namespace platformKeysInternal {
// KeyAlgorithm dictionary describing the key's algorithm. The
// name property will equal algorithmName.
// Otherwise, calls back with an error.
+ [doesNotSupportPromises="Multi-parameter callback crbug.com/1313625"]
static void getPublicKey(ArrayBuffer certificate,
DOMString algorithmName,
GetPublicKeyCallback callback);
@@ -67,6 +68,7 @@ namespace platformKeysInternal {
// KeyAlgorithm dictionary describing the key's algorithm. The
// name property will equal algorithmName.
// Otherwise, calls back with an error.
+ [doesNotSupportPromises="Multi-parameter callback crbug.com/1313625"]
static void getPublicKeyBySpki(ArrayBuffer publicKeySpkiDer,
DOMString algorithmName,
GetPublicKeyCallback callback);
diff --git a/idl/chrome/printing.idl b/idl/chrome/printing.idl
index 4aeca11..18afd73 100644
--- a/idl/chrome/printing.idl
+++ b/idl/chrome/printing.idl
@@ -9,9 +9,11 @@ implemented_in="chrome/browser/extensions/api/printing/printing_api.h"]
namespace printing {
dictionary SubmitJobRequest {
// The print job to be submitted.
- // The only supported content type is "application/pdf", and the CJT ticket
- // shouldn't include FitToPageTicketItem, PageRangeTicketItem,
- // ReverseOrderTicketItem and VendorTicketItem fields since they are
+ // The only supported content type is "application/pdf", and the
+ // Cloud Job Ticket
+ // shouldn't include FitToPageTicketItem,
+ // PageRangeTicketItem, ReverseOrderTicketItem
+ // and VendorTicketItem fields since they are
// irrelevant for native printing. All other fields must be present.
printerProvider.PrintJob job;
@@ -153,9 +155,11 @@ namespace printing {
callback GetPrinterInfoCallback = void(GetPrinterInfoResponse response);
interface Functions {
- // Submits the job for print.
- // If the extension is not listed in PrintingAPIExtensionsAllowlist policy,
- // the user will be prompted to accept the print job.
+ // Submits the job for printing. If the extension is not listed in
+ // the
+ // PrintingAPIExtensionsAllowlist policy,
+ // the user is prompted to accept the print job.
+ // Before Chrome 120, this function did not return a promise.
[supportsPromises] static void submitJob(SubmitJobRequest request,
SubmitJobCallback callback);
diff --git a/idl/chrome/printing_metrics.idl b/idl/chrome/printing_metrics.idl
index 4742199..9e36115 100644
--- a/idl/chrome/printing_metrics.idl
+++ b/idl/chrome/printing_metrics.idl
@@ -9,53 +9,57 @@
namespace printingMetrics {
// The source of the print job.
enum PrintJobSource {
- // The job was created from the Print Preview page initiated by the user.
+ // Specifies that the job was created from the Print Preview page
+ // initiated by the user.
PRINT_PREVIEW,
- // The job was created from an Android App.
+ // Specifies that the job was created from an Android App.
ANDROID_APP,
- // The job was created by extension via Chrome API.
- EXTENSION
+ // Specifies that the job was created by extension via Chrome API.
+ EXTENSION,
+
+ // Specifies that the job was created by an Isolated Web App via API.
+ ISOLATED_WEB_APP
};
- // The final status of the print job.
+ // Specifies the final status of the print job.
enum PrintJobStatus {
- // Print job was interrupted due to some error.
+ // Specifies that the print job was interrupted due to some error.
FAILED,
- // Print job was canceled by the user or via API.
+ // Specifies that the print job was canceled by the user or via API.
CANCELED,
- // Print job was printed without any errors.
+ // Specifies that the print job was printed without any errors.
PRINTED
};
// The source of the printer.
enum PrinterSource {
- // Printer was added by user.
+ // Specifies that the printer was added by user.
USER,
- // Printer was added via policy.
+ // Specifies that the printer was added via policy.
POLICY
};
enum ColorMode {
- // Black and white mode was used.
+ // Specifies that black and white mode was used.
BLACK_AND_WHITE,
- // Color mode was used.
+ // Specifies that color mode was used.
COLOR
};
enum DuplexMode {
- // One-sided printing was used.
+ // Specifies that one-sided printing was used.
ONE_SIDED,
- // Two-sided printing was used, flipping on long edge.
+ // Specifies that two-sided printing was used, flipping on long edge.
TWO_SIDED_LONG_EDGE,
- // Two-sided printing was used, flipping on short edge.
+ // Specifies that two-sided printing was used, flipping on short edge.
TWO_SIDED_SHORT_EDGE
};
diff --git a/idl/chrome/privacy.json b/idl/chrome/privacy.json
index 494e3f4..9a3b60f 100644
--- a/idl/chrome/privacy.json
+++ b/idl/chrome/privacy.json
@@ -100,12 +100,6 @@
"value": ["thirdPartyCookiesAllowed", {"type": "boolean"}],
"description": "If disabled, Chrome blocks third-party sites from setting cookies. The value of this preference is of type boolean, and the default value is true."
},
- "privacySandboxEnabled": {
- "$ref": "types.ChromeSetting",
- "value": ["privacySandboxEnabled", {"type": "boolean"}],
- "deprecated": "We’re deprecating the API chrome.privacy.websites.privacySandboxEnabled, though it will remain active for backward compatibility until release M113. Instead, please use chrome.privacy.websites.topicsEnabled, chrome.privacy.websites.fledgeEnabled and chrome.privacy.websites.adMeasurementEnabled. During the migration period: 1. Enabling privacySandboxEnabled will CLEAR the new APIs listed above because extensions aren’t allowed to enable them; 2. Disabling privacySandboxEnabled will also disable the new APIs; 3. Clearing privacySandboxEnabled will also clear the new APIs.",
- "description": "If enabled, the experimental Privacy Sandbox features are active. The value of this preference is of type boolean, and the default value is true."
- },
"topicsEnabled": {
"$ref": "types.ChromeSetting",
"value": ["topicsEnabled", {"type": "boolean"}],
@@ -141,6 +135,11 @@
"value": ["protectedContentEnabled", {"type":"boolean"}],
"description": "Available on Windows and ChromeOS only: If enabled, Chrome provides a unique ID to plugins in order to run protected content. The value of this preference is of type boolean, and the default value is true.",
"platforms": ["win", "chromeos", "lacros"]
+ },
+ "relatedWebsiteSetsEnabled": {
+ "$ref": "types.ChromeSetting",
+ "value": ["relatedWebsiteSetsEnabled", {"type": "boolean"}],
+ "description": "If disabled, Related Website Sets is deactivated. The value of this preference is of type boolean, and the default value is true. Extensions may only disable this API by setting the value to false. If you try setting this API to true, it will throw an error."
}
}
}
diff --git a/idl/chrome/proxy.json b/idl/chrome/proxy.json
index b47ef7c..c677647 100644
--- a/idl/chrome/proxy.json
+++ b/idl/chrome/proxy.json
@@ -5,7 +5,7 @@
[
{
"namespace": "proxy",
- "description": "Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration.",
+ "description": "Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration.",
"types": [
{
"id": "Scheme",
diff --git a/idl/chrome/reading_list.idl b/idl/chrome/reading_list.idl
new file mode 100644
index 0000000..819c899
--- /dev/null
+++ b/idl/chrome/reading_list.idl
@@ -0,0 +1,116 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Use the chrome.readingList API to read from and modify
+// the items in the
+// Reading List.
+namespace readingList{
+ dictionary ReadingListEntry {
+ // The url of the entry.
+ DOMString url;
+
+ // The title of the entry.
+ DOMString title;
+
+ // Will be true if the entry has been read.
+ boolean hasBeenRead;
+
+ // The last time the entry was updated.
+ // This value is in milliseconds since Jan 1, 1970.
+ double lastUpdateTime;
+
+ // The time the entry was created.
+ // Recorded in milliseconds since Jan 1, 1970.
+ double creationTime;
+ };
+
+ dictionary AddEntryOptions {
+ // The url of the entry.
+ DOMString url;
+
+ // The title of the entry.
+ DOMString title;
+
+ // Will be true if the entry has been read.
+ boolean hasBeenRead;
+ };
+
+ dictionary RemoveOptions {
+ // The url to remove.
+ DOMString url;
+ };
+
+ dictionary UpdateEntryOptions {
+ // The url that will be updated.
+ DOMString url;
+
+ // The new title. The existing tile remains if a value isn't provided.
+ DOMString? title;
+
+ // The updated read status. The existing status remains if a value
+ // isn't provided.
+ boolean? hasBeenRead;
+ };
+
+ dictionary QueryInfo {
+ // A url to search for.
+ DOMString? url;
+
+ // A title to search for.
+ DOMString? title;
+
+ // Indicates whether to search for read (true) or unread
+ // (false) items.
+ boolean? hasBeenRead;
+ };
+
+ callback AddEntryCallback = void ();
+ callback RemoveEntryCallback = void();
+ callback UpdateEntryCallback = void();
+ callback QueryCallback = void(ReadingListEntry[] entries);
+
+ interface Functions {
+ // Adds an entry to the reading list if it does not exist.
+ // |entry|: The entry to add to the reading list.
+ // |callback|: Invoked once the entry has been added.
+ [supportsPromises] static void addEntry(
+ AddEntryOptions entry,
+ optional AddEntryCallback callback);
+
+ // Removes an entry from the reading list if it exists.
+ // |info|: The entry to remove from the reading list.
+ // |callback|: Invoked once the entry has been removed.
+ [supportsPromises] static void removeEntry(
+ RemoveOptions info,
+ optional RemoveEntryCallback callback);
+
+ // Updates a reading list entry if it exists.
+ // |info|: The entry to update.
+ // |callback|: Invoked once the matched entries have been updated.
+ [supportsPromises] static void updateEntry(
+ UpdateEntryOptions info,
+ optional UpdateEntryCallback callback);
+
+ // Retrieves all entries that match the QueryInfo properties.
+ // Properties that are not provided will not be matched.
+ // |info|: The properties to search for.
+ // |callback|: Invoked once the entries have been matched.
+ [supportsPromises] static void query(QueryInfo info,
+ QueryCallback callback);
+ };
+
+ interface Events {
+ // Triggered when a ReadingListEntry is added to the reading list.
+ // |entry|: The entry that was added.
+ static void onEntryAdded(ReadingListEntry entry);
+
+ // Triggered when a ReadingListEntry is removed from the reading list.
+ // |entry|: The entry that was removed.
+ static void onEntryRemoved(ReadingListEntry entry);
+
+ // Triggered when a ReadingListEntry is updated in the reading list.
+ // |entry|: The entry that was updated.
+ static void onEntryUpdated(ReadingListEntry entry);
+ };
+};
\ No newline at end of file
diff --git a/idl/chrome/safe_browsing_private.idl b/idl/chrome/safe_browsing_private.idl
index 414c83a..691cd0b 100644
--- a/idl/chrome/safe_browsing_private.idl
+++ b/idl/chrome/safe_browsing_private.idl
@@ -41,7 +41,10 @@ namespace safeBrowsingPrivate {
// Navigation is initiated by the browser process and it is believed the
// navigation is the result of the user copy and paste the address from the
// browser into the address bar.
- COPY_PASTE_USER_INITIATED
+ COPY_PASTE_USER_INITIATED,
+
+ // Navigation is initiated by a click on a Push Notification.
+ NOTIFICATION_INITIATED
};
dictionary PolicySpecifiedPasswordReuse {
diff --git a/idl/chrome/scripting.idl b/idl/chrome/scripting.idl
index e2d4b9f..ba3a2e0 100644
--- a/idl/chrome/scripting.idl
+++ b/idl/chrome/scripting.idl
@@ -17,9 +17,11 @@ namespace scripting {
// The JavaScript world for a script to execute within.
enum ExecutionWorld {
- // The isolated world, unique to this extension.
+ // Specifies the isolated world, which is the execution environment unique
+ // to this extension.
ISOLATED,
- // The main world of the DOM, shared with the page's JavaScript.
+ // Specifies the main world of the DOM, which is the execution environment
+ // shared with the host page's JavaScript.
MAIN
};
@@ -46,11 +48,11 @@ namespace scripting {
// A JavaScript function to inject. This function will be serialized, and
// then deserialized for injection. This means that any bound parameters
// and execution context will be lost.
- // Exactly one of files and func must be
+ // Exactly one of files or func must be
// specified.
[serializableFunction]InjectedFunction? func;
- // The arguments to curry into a provided function. This is only valid if
+ // The arguments to pass to the provided function. This is only valid if
// the func parameter is specified. These arguments must be
// JSON-serializable.
any[]? args;
@@ -64,7 +66,7 @@ namespace scripting {
// The path of the JS or CSS files to inject, relative to the extension's
// root directory.
- // Exactly one of files and func must be
+ // Exactly one of files or func must be
// specified.
DOMString[]? files;
@@ -119,13 +121,13 @@ namespace scripting {
// with a '_' as it's reserved as a prefix for generated script IDs.
DOMString id;
// Specifies which pages this content script will be injected into. See
- // Match Patterns for more details on the
- // syntax of these strings. Must be specified for
+ // Match Patterns for more
+ // details on the syntax of these strings. Must be specified for
// $(ref:registerContentScripts).
DOMString[]? matches;
// Excludes pages that this content script would otherwise be injected into.
- // See Match Patterns for more details on the
- // syntax of these strings.
+ // See Match Patterns for
+ // more details on the syntax of these strings.
DOMString[]? excludeMatches;
// The list of CSS files to be injected into matching pages. These are
// injected in the order they appear in this array, before any DOM is
@@ -140,9 +142,13 @@ namespace scripting {
// requirements are not met. Defaults to false, meaning that only the top
// frame is matched.
boolean? allFrames;
- // TODO(devlin): Add documentation once the implementation is complete. See
- // crbug.com/55084.
- [nodoc]
+ // Indicates whether the script can be injected into frames where the URL
+ // contains an unsupported scheme; specifically: about:, data:, blob:, or
+ // filesystem:. In these cases, the URL's origin is checked to determine if
+ // the script should be injected. If the origin is `null` (as is the case
+ // for data: URLs) then the used origin is either the frame that created
+ // the current frame or the frame that initiated the navigation to this
+ // frame. Note that this may not be the parent frame.
boolean? matchOriginAsFallback;
// Specifies when JavaScript files are injected into the web page. The
// preferred and default value is document_idle.
diff --git a/idl/chrome/search.idl b/idl/chrome/search.idl
index 607e5a2..51a84b2 100644
--- a/idl/chrome/search.idl
+++ b/idl/chrome/search.idl
@@ -5,13 +5,14 @@
// Use the chrome.search API to search via the default provider.
namespace search {
enum Disposition {
- // Display results in the calling tab or the tab from the active browser.
+ // Specifies that the search results display in the calling tab or the tab
+ // from the active browser.
CURRENT_TAB,
- // Display search results in a new tab.
+ // Specifies that the search results display in a new tab.
NEW_TAB,
- // Display search results in a new window.
+ // Specifies that the search results display in a new window.
NEW_WINDOW
};
diff --git a/idl/chrome/side_panel.idl b/idl/chrome/side_panel.idl
index 57e6f15..6e7fff5 100644
--- a/idl/chrome/side_panel.idl
+++ b/idl/chrome/side_panel.idl
@@ -47,13 +47,13 @@ namespace sidePanel {
};
// Options for opening the side panel.
- // At least one of `tabId` and `windowId` must be specified.
+ // At least one of `tabId` or `windowId` must be specified.
dictionary OpenOptions {
// The window in which to open the side panel. This is only applicable if
// the extension has a global (non-tab-specific) side panel or
// tabId is also specified. This will override any
// currently-active global side panel the user has open in the given
- // window. At least one of this and tabId must be provided.
+ // window. At least one of this or tabId must be provided.
long? windowId;
// The tab in which to open the side panel. If the corresponding tab has
@@ -62,7 +62,7 @@ namespace sidePanel {
// the specified tab and any other tabs without a currently-open tab-
// specific panel. This will override any currently-active side panel
// (global or tab-specific) in the corresponding tab. At least one of this
- // and windowId must be provided.
+ // or windowId must be provided.
long? tabId;
};
diff --git a/idl/chrome/smart_card_provider_private.idl b/idl/chrome/smart_card_provider_private.idl
index c82e969..a0ad331 100644
--- a/idl/chrome/smart_card_provider_private.idl
+++ b/idl/chrome/smart_card_provider_private.idl
@@ -120,11 +120,18 @@ namespace smartCardProviderPrivate {
dictionary ReaderStateIn {
DOMString reader;
ReaderStateFlags currentState;
+ // Number of card insertion and removal events that happened in this reader,
+ // as known by the application.
+ long currentCount;
};
dictionary ReaderStateOut {
DOMString reader;
ReaderStateFlags eventState;
+ // The actual number of card insertion and removal events that happened in
+ // this reader.
+ // Set to zero if not supported.
+ long eventCount;
ArrayBuffer atr;
};
@@ -209,6 +216,18 @@ namespace smartCardProviderPrivate {
// reportStatusResult.
[maxListeners=1] static void onStatusRequested(long requestId,
long scardHandle);
+
+ // Browser requested a SCardBeginTransaction call.
+ // Extension must report the result to the browser by calling
+ // reportPlainResult.
+ [maxListeners=1] static void onBeginTransactionRequested(long requestId,
+ long scardHandle);
+
+ // Browser requested a SCardEndTransaction call.
+ // Extension must report the result to the browser by calling
+ // reportPlainResult.
+ [maxListeners=1] static void onEndTransactionRequested(long requestId,
+ long scardHandle, Disposition disposition);
};
interface Functions {
diff --git a/idl/chrome/tab_capture.idl b/idl/chrome/tab_capture.idl
index c082097..97e92b2 100644
--- a/idl/chrome/tab_capture.idl
+++ b/idl/chrome/tab_capture.idl
@@ -91,6 +91,7 @@ namespace tabCapture {
// null. null indicates an error has occurred
// and the client may query $(ref:runtime.lastError) to access the error
// details.
+ [doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
static void capture(CaptureOptions options,
GetTabMediaCallback callback);
diff --git a/idl/chrome/tabs.json b/idl/chrome/tabs.json
index 031f7d3..7919cba 100644
--- a/idl/chrome/tabs.json
+++ b/idl/chrome/tabs.json
@@ -55,6 +55,7 @@
"windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window that contains the tab."},
"openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
"selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."},
+ "lastAccessed": {"type": "number", "optional": true, "description": "The last time the tab was accessed as the number of milliseconds since epoch."},
"highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."},
"active": {"type": "boolean", "description": "Whether the tab is active in its window. Does not necessarily mean the window is focused."},
"pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
@@ -172,7 +173,7 @@
{
"name": "getCurrent",
"type": "function",
- "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example, a background page or popup view).",
+ "description": "Gets the tab that this script call is being made from. Returns undefined if called from a non-tab context (for example, a background page or popup view).",
"parameters": [],
"returns_async": {
"name": "callback",
@@ -826,7 +827,7 @@
{
"name": "captureVisibleTab",
"type": "function",
- "description": "Captures the visible area of the currently active tab in the specified window. In order to call this method, the extension must have either the permission or the activeTab permission. In addition to sites that extensions can normally access, this method allows extensions to capture sensitive sites that are otherwise restricted, including chrome:-scheme pages, other extensions' pages, and data: URLs. These sensitive sites can only be captured with the activeTab permission. File URLs may be captured only if the extension has been granted file access.",
+ "description": "Captures the visible area of the currently active tab in the specified window. In order to call this method, the extension must have either the permission or the activeTab permission. In addition to sites that extensions can normally access, this method allows extensions to capture sensitive sites that are otherwise restricted, including chrome:-scheme pages, other extensions' pages, and data: URLs. These sensitive sites can only be captured with the activeTab permission. File URLs may be captured only if the extension has been granted file access.",
"parameters": [
{
"type": "integer",
@@ -856,7 +857,7 @@
"name": "executeScript",
"deprecated": "Replaced by $(ref:scripting.executeScript) in Manifest V3.",
"type": "function",
- "description": "Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.",
+ "description": "Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.",
"parameters": [
{"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."},
{
@@ -884,7 +885,7 @@
"name": "insertCSS",
"deprecated": "Replaced by $(ref:scripting.insertCSS) in Manifest V3.",
"type": "function",
- "description": "Injects CSS into a page. Styles inserted with this method can be removed with $(ref:scripting.removeCSS). For details, see the programmatic injection section of the content scripts doc.",
+ "description": "Injects CSS into a page. Styles inserted with this method can be removed with $(ref:scripting.removeCSS). For details, see the programmatic injection section of the content scripts doc.",
"parameters": [
{"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."},
{
diff --git a/idl/chrome/vpn_provider.idl b/idl/chrome/vpn_provider.idl
index 3e3ecd8..f2ed2f3 100644
--- a/idl/chrome/vpn_provider.idl
+++ b/idl/chrome/vpn_provider.idl
@@ -60,25 +60,25 @@ namespace vpnProvider {
// The enum is used by the platform to notify the client of the VPN session
// status.
enum PlatformMessage {
- // VPN configuration connected.
+ // Indicates that the VPN configuration connected.
connected,
- // VPN configuration disconnected.
+ // Indicates that the VPN configuration disconnected.
disconnected,
- // An error occurred in VPN connection, for example a timeout. A description
+ // Indicates that an error occurred in VPN connection, for example a timeout. A description
// of the error is given as the
// error argument to onPlatformMessage.
error,
- // The default physical network connection is down.
+ // Indicates that the default physical network connection is down.
linkDown,
- // The default physical network connection is back up.
+ // Indicates that the default physical network connection is back up.
linkUp,
- // The default physical network connection changed, e.g. wifi->mobile.
+ // Indicates that the default physical network connection changed, e.g. wifi->mobile.
linkChanged,
- // The OS is preparing to suspend, so the VPN should drop its connection.
+ // Indicates that the OS is preparing to suspend, so the VPN should drop its connection.
// The extension is not guaranteed to receive this event prior to
// suspending.
suspend,
- // The OS has resumed and the user has logged back in, so the VPN should
+ // Indicates that the OS has resumed and the user has logged back in, so the VPN should
// try to reconnect.
resume
};
@@ -87,18 +87,20 @@ namespace vpnProvider {
// of its current state. This helps provide meaningful messages
// to the user.
enum VpnConnectionState {
- // VPN connection was successful.
+ // Specifies that VPN connection was successful.
connected,
- // VPN connection failed.
+ // Specifies that VPN connection has failed.
failure
};
// The enum is used by the platform to indicate the event that triggered
// onUIEvent.
enum UIEvent {
- // Request the VPN client to show add configuration dialog to the user.
+ // Requests that the VPN client show the add configuration dialog box to
+ // the user.
showAddDialog,
- // Request the VPN client to show configuration settings dialog to the user.
+ // Requests that the VPN client show the configuration settings dialog box
+ // to the user.
showConfigureDialog
};
diff --git a/idl/chrome/webrtc_desktop_capture_private.idl b/idl/chrome/webrtc_desktop_capture_private.idl
index 60e9e00..5410f61 100644
--- a/idl/chrome/webrtc_desktop_capture_private.idl
+++ b/idl/chrome/webrtc_desktop_capture_private.idl
@@ -23,6 +23,7 @@ namespace webrtcDesktopCapturePrivate {
interface Functions {
// Shows desktop media picker UI with the specified set of sources.
+ [doesNotSupportPromises="Synchronous return and callback crbug.com/1143032"]
static long chooseDesktopMedia(DesktopCaptureSourceType[] sources,
RequestInfo request,
chooseDesktopMediaCallback callback);
diff --git a/idl/chrome/webrtc_logging_private.idl b/idl/chrome/webrtc_logging_private.idl
index bfa5c90..d286b89 100644
--- a/idl/chrome/webrtc_logging_private.idl
+++ b/idl/chrome/webrtc_logging_private.idl
@@ -180,6 +180,7 @@ namespace webrtcLoggingPrivate {
// Returns the directory entry for the "WebRTC Logs" directory. If the
// directory doesn't exist yet, this will create it. If the directory
// cannot be created, this call will fail with a runtime error.
+ [doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
static void getLogsDirectory(GetLogsDirectoryCallback callback);
};
};
\ No newline at end of file
diff --git a/idl/chrome/webstore_private.json b/idl/chrome/webstore_private.json
index 68cfaa9..e246b2d 100644
--- a/idl/chrome/webstore_private.json
+++ b/idl/chrome/webstore_private.json
@@ -121,14 +121,13 @@
"name": "expected_id",
"type": "string",
"description": "The id of the extension to install."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
},
{
"name": "beginInstallWithManifest3",
@@ -186,22 +185,20 @@
}
},
"additionalProperties": { "type": "any" }
- },
- {
- "name": "callback",
- "type": "function",
- "description": "Called when the user has either accepted/rejected the dialog, or some error occurred (such as invalid manifest or icon image data).",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "Result",
- "description": "A string result code, which will be empty upon success. The possible values in the case of errors include 'unknown_error', 'user_cancelled', 'manifest_error', 'icon_error', 'invalid_id', 'permission_denied', 'invalid_icon_url' and 'already_installed'."
- }
- ]
}
- ]
-
+ ],
+ "returns_async": {
+ "name": "callback",
+ "description": "Called when the user has either accepted/rejected the dialog, or some error occurred (such as invalid manifest or icon image data).",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "Result",
+ "description": "A string result code, which will be empty upon success. The possible values in the case of errors include 'unknown_error', 'user_cancelled', 'manifest_error', 'icon_error', 'invalid_id', 'permission_denied', 'invalid_icon_url' and 'already_installed'."
+ }
+ ]
+ }
},
{
"name": "completeInstall",
@@ -211,149 +208,99 @@
"name": "expected_id",
"type": "string",
"description": "The id of the extension to be installed. This should match a previous call to beginInstallWithManifest3."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
},
{
"name": "enableAppLauncher",
"description": "",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
},
{
"name": "getBrowserLogin",
"description": "Returns the logged-in sync user login if there is one, or the empty string otherwise.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "info",
- "type": "object",
- "properties": {
- "login": { "type": "string" }
- }
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "info",
+ "type": "object",
+ "properties": {
+ "login": { "type": "string" }
}
- ]
- }
- ]
+ }
+ ]
+ }
},
{
"name": "getStoreLogin",
"description": "Returns the previous value set by setStoreLogin, or the empty string if there is none.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "login", "type": "string" }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "login", "type": "string" }
+ ]
+ }
},
{
"name": "setStoreLogin",
"description": "Sets a preference value with the store login.",
"parameters": [
- { "name": "login", "type": "string" },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
+ { "name": "login", "type": "string" }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
},
{
"name": "getWebGLStatus",
"description": "Invokes a callback that returns whether WebGL is blacklisted or not.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "webgl_status",
- "$ref": "WebGlStatus"
- }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "webgl_status",
+ "$ref": "WebGlStatus"
+ }
+ ]
+ }
},
{
"name": "getIsLauncherEnabled",
"description": "Returns whether the apps launcher is enabled or not.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "is_enabled", "type": "boolean" }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "is_enabled", "type": "boolean" }
+ ]
+ }
},
{
"name": "isInIncognitoMode",
"description": "Returns whether the browser is in incognito mode or not.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "is_incognito", "type": "boolean" }
- ]
- }
- ]
- },
- {
- "name": "getEphemeralAppsEnabled",
- "description": "Returns whether the ephemeral apps feature is enabled.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "is_enabled", "type": "boolean" }
- ]
- }
- ]
- },
- {
- "name": "launchEphemeralApp",
- "description": "Installs an app ephemerally in Chrome (if not already fully installed) and launches the app. A user gesture is required.",
- "parameters": [
- {
- "name": "id",
- "type": "string",
- "description": "The extension id of the app to launch."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "Result",
- "description": "Whether an attempt to launch an app succeeded, or the reason for failure."
- }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "is_incognito", "type": "boolean" }
+ ]
+ }
},
{
"name": "isPendingCustodianApproval",
@@ -363,28 +310,25 @@
"name": "id",
"type": "string",
"description": "The extension id of the extension to be checked."
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "is_pending_approval", "type": "boolean" }
- ]
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "is_pending_approval", "type": "boolean" }
+ ]
+ }
},
{
"name": "getReferrerChain",
"description": "Returns a base-64 encoded referrer chain leading to the webstore page. Should only be used for extension anti-abuse purposes.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "referrerChain", "type": "string" }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "referrerChain", "type": "string" }
+ ]
+ }
},
{
"name": "getExtensionStatus",
@@ -399,15 +343,14 @@
"type": "string",
"optional": true,
"description": "The manifest of the extension"
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- { "name": "status", "$ref": "ExtensionInstallStatus" }
- ]
}
- ]
+ ],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ { "name": "status", "$ref": "ExtensionInstallStatus" }
+ ]
+ }
}
]
}
diff --git a/idl/chrome/windows.json b/idl/chrome/windows.json
index 375d667..8a5c031 100644
--- a/idl/chrome/windows.json
+++ b/idl/chrome/windows.json
@@ -88,7 +88,20 @@
"id": "CreateType",
"type": "string",
"description": "Specifies what type of browser window to create. 'panel' is deprecated and is available only to existing allowlisted extensions on Chrome OS.",
- "enum": ["normal", "popup", "panel"]
+ "enum": [
+ {
+ "name": "normal",
+ "description": "Specifies the window as a standard window."
+ },
+ {
+ "name": "popup",
+ "description": "Specifies the window as a popup window."
+ },
+ {
+ "name": "panel",
+ "description": "Specifies the window as a panel."
+ }
+ ]
},
{
"id": "QueryOptions",
@@ -106,7 +119,7 @@
},
"WINDOW_ID_CURRENT": {
"value": -2,
- "description": "The windowId value that represents the current window."
+ "description": "The windowId value that represents the current window."
}
},
"functions": [
diff --git a/idl/chrome/wm_desks_private.idl b/idl/chrome/wm_desks_private.idl
index fcd070a..6922736 100644
--- a/idl/chrome/wm_desks_private.idl
+++ b/idl/chrome/wm_desks_private.idl
@@ -21,6 +21,9 @@ namespace wmDesksPrivate {
// Define whether close all windows on the desk and combine them to the
// active desk to the left.
boolean combineDesks;
+
+ // Define whether removed desk is retrievable.
+ boolean? allowUndo;
};
dictionary Desk {
@@ -83,8 +86,9 @@ namespace wmDesksPrivate {
// Removes a desk as specified in `deskId`. If `combineDesks` of
// `RemoveDeskOptions` is present or set to true, remove the desk and
- // combine windows to the active desk to the left. Otherwise close all
- // windows on the desk.
+ // combine windows to the active desk to the left. If `allowUndo` is
+ // present or set to true, prompt the user with a notification allowing for
+ // the desk to be retrieved. Otherwise close all windows on the desk.
[supportsPromises] static void removeDesk(
DOMString deskId,
optional RemoveDeskOptions removeDeskOptions,
@@ -127,7 +131,7 @@ namespace wmDesksPrivate {
interface Events {
// Fires when new desks is added.
- static void OnDeskAdded(DOMString deskId);
+ static void OnDeskAdded(DOMString deskId, boolean fromUndo);
// Fires when desk removal is finalized.
static void OnDeskRemoved(DOMString deskId);
diff --git a/idl/extensions/alarms.idl b/idl/extensions/alarms.idl
index 7101d7f..b6a33bf 100644
--- a/idl/extensions/alarms.idl
+++ b/idl/extensions/alarms.idl
@@ -52,12 +52,12 @@ namespace alarms {
// replaced by this alarm.
//
// In order to reduce the load on the user's machine, Chrome limits alarms
- // to at most once every 1 minute but may delay them an arbitrary amount
+ // to at most once every 30 seconds but may delay them an arbitrary amount
// more. That is, setting delayInMinutes or
- // periodInMinutes to less than 1 will not be
+ // periodInMinutes to less than 0.5 will not be
// honored and will cause a warning. when can be set to less
- // than 1 minute after "now" without warning but won't actually cause the
- // alarm to fire for at least 1 minute.
+ // than 30 seconds after "now" without warning but won't actually cause the
+ // alarm to fire for at least 30 seconds.
//
// To help you debug your app or extension, when you've loaded it unpacked,
// there's no limit to how often the alarm can fire.
diff --git a/idl/extensions/app_runtime.idl b/idl/extensions/app_runtime.idl
index a758e51..c297b3b 100644
--- a/idl/extensions/app_runtime.idl
+++ b/idl/extensions/app_runtime.idl
@@ -5,7 +5,6 @@
// Use the chrome.app.runtime API to manage the app lifecycle.
// The app runtime manages app installation, controls the event page, and can
// shut down the app at anytime.
-[modernised_enums]
namespace app.runtime {
[inline_doc] dictionary LaunchItem {
diff --git a/idl/extensions/app_window.idl b/idl/extensions/app_window.idl
index 725dfeb..97b4dfb 100644
--- a/idl/extensions/app_window.idl
+++ b/idl/extensions/app_window.idl
@@ -7,7 +7,6 @@
// associated with any Chrome browser windows. See the
// Window State Sample for a demonstration of these options.
-[modernised_enums]
namespace app.window {
// Previously named Bounds.
@@ -448,9 +447,9 @@ namespace app.window {
// window with the same id. If you need to open a window with an id at a
// location other than the remembered default, you can create it hidden,
// move it to the desired location, then show it.
- static void create(DOMString url,
- optional CreateWindowOptions options,
- optional CreateWindowCallback callback);
+ [supportsPromises] static void create(DOMString url,
+ optional CreateWindowOptions options,
+ optional CreateWindowCallback callback);
// Returns an $(ref:AppWindow) object for the
// current script context (ie JavaScript 'window' object). This can also be
diff --git a/idl/extensions/audio.idl b/idl/extensions/audio.idl
index 7b83f11..ab775b7 100644
--- a/idl/extensions/audio.idl
+++ b/idl/extensions/audio.idl
@@ -6,7 +6,6 @@
// get information about and control the audio devices attached to the
// system.
// This API is currently only available in kiosk mode for ChromeOS.
-[modernised_enums]
namespace audio {
// Type of stream an audio device provides.
diff --git a/idl/extensions/automation.idl b/idl/extensions/automation.idl
index 897718e..14ca879 100644
--- a/idl/extensions/automation.idl
+++ b/idl/extensions/automation.idl
@@ -7,7 +7,7 @@
// tree, but only exposes the semantic structure of a page. It can be
// used to programmatically interact with a page by examining names, roles, and
// states, listening for events, and performing actions on nodes.
-[nocompile, modernised_enums] namespace automation {
+[nocompile] namespace automation {
// Keep the following enums in sync with 'ui/accessibility/ax_enums.mojom'.
// They are kept here purely for extension docs generation.
@@ -16,7 +16,10 @@
accessKeyChanged,
activeDescendantChanged,
alert,
- ariaAttributeChanged,
+ // TODO(crbug.com/1464633) Fully remove ariaAttributeChangedDeprecated
+ // starting in 122, because although it was removed in 118, it is still
+ // present in earlier versions of LaCros.
+ ariaAttributeChangedDeprecated,
ariaCurrentChanged,
atomicChanged,
autoCompleteChanged,
@@ -89,6 +92,7 @@
multiselectableStateChanged,
nameChanged,
objectAttributeChanged,
+ orientationChanged,
otherAttributeChanged,
parentChanged,
placeholderChanged,
@@ -173,6 +177,7 @@
dialog,
directory,
disclosureTriangle,
+ disclosureTriangleGrouped,
// --------------------------------------------------------------
// DPub Roles:
// https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
@@ -306,7 +311,7 @@
pluginObject,
popUpButton,
portal,
- pre,
+ preDeprecated,
progressIndicator,
radioButton,
radioGroup,
@@ -418,6 +423,7 @@
showContextMenu,
signalEndOfTest,
showTooltip,
+ stitchChildTree,
startDuckingMedia,
stopDuckingMedia,
suspendMedia
@@ -705,9 +711,6 @@ enum PositionType {
long focusOffset;
};
- // Called when the result for a query is available.
- callback QueryCallback = void(AutomationNode node);
-
[nocompile, noinline_doc] dictionary AutomationIntent {
// A command associated with this AutomationIntent.
IntentCommandType command;
@@ -776,22 +779,6 @@ enum PositionType {
DOMString description;
};
- // The string which the indices are relative to is not included in this
- // structure. See documentation on $(ref:languageAnnotationForStringAttribute)
- // for details on how to associate this object with a string.
- // Also, the start and end indices always point to the first code unit of a
- // valid code-point.
- [nocompile, noinline_doc] dictionary LanguageSpan {
- // Inclusive start index of substring that contains language.
- long startIndex;
- // Exclusive end index of substring that contains language.
- long endIndex;
- // Detected language for substring.
- DOMString language;
- // Probability that language is correct.
- double probability;
- };
-
// A marker associated with an AutomationNode.
[nocompile, noinline_doc] dictionary Marker {
// The start offset within the text of the associated node.
@@ -1027,8 +1014,8 @@ enum PositionType {
// A node that provides more details about the current node.
AutomationNode[]? details;
- // A node that provides an error message for a current node.
- AutomationNode? errorMessage;
+ // The nodes, if any, that provide an error message for the current node.
+ AutomationNode[]? errorMessages;
// Reverse relationship for details.
AutomationNode[]? detailsFor;
@@ -1514,22 +1501,6 @@ enum PositionType {
static void removeEventListener(
EventType eventType, AutomationListener listener, boolean capture);
- // Gets the first node in this node's subtree which matches the given CSS
- // selector and is within the same DOM context.
- //
- // If this node doesn't correspond directly with an HTML node in the DOM,
- // querySelector will be run on this node's nearest HTML node ancestor. Note
- // that this may result in the query returning a node which is not a
- // descendant of this node.
- //
- // If the selector matches a node which doesn't directly correspond to an
- // automation node (for example an element within an ARIA widget, where the
- // ARIA widget forms one node of the automation tree, or an element which
- // is hidden from accessibility via hiding it using CSS or using
- // aria-hidden), this will return the nearest ancestor which does correspond
- // to an automation node.
- static void domQuerySelector(DOMString selector, QueryCallback callback);
-
// Finds the first AutomationNode in this node's subtree which matches the
// given search parameters.
static AutomationNode find(FindParams params);
@@ -1544,17 +1515,6 @@ enum PositionType {
static AutomationNode getNextTextMatch(
DOMString searchStr, boolean backward);
- // Returns the detected languages for the provided string attribute as an
- // array of LanguageSpan objects. There are several guarantees about the
- // format of the LanguageSpan array:
- // 1. Is either empty or contains LanguageSpans that cover all indices in
- // the associated string attribute value.
- // 2. Is sorted by increasing startIndex (those with smaller startIndex
- // appear first).
- // 3. LanguageSpans are non-overlapping and contain exactly one language.
- static LanguageSpan[] languageAnnotationForStringAttribute(
- DOMString attribute);
-
// Creates a position object backed by Chrome's accessibility position support.
static AutomationPosition createPosition(PositionType type, long offset, optional boolean isUpstream);
};
@@ -1570,14 +1530,6 @@ enum PositionType {
callback AccessibilityFocusCallback = void(AutomationNode focusedNode);
interface Functions {
- // Get the automation tree for the tab with the given tabId, or the current
- // tab if no tabID is given, enabling automation if necessary. Returns a
- // tree with a placeholder root node; listen for the "loadComplete" event to
- // get a notification that the tree has fully loaded (the previous root node
- // reference will stop working at or before this point).
- [nocompile] static void getTree(optional long tabId,
- optional RootCallback callback);
-
// Get the automation tree for the whole desktop which consists of all on
// screen views. Note this API is currently only supported on Chrome OS.
[nocompile] static void getDesktop(RootCallback callback);
@@ -1596,11 +1548,13 @@ enum PositionType {
// listen to changes across all trees. Pass a filter to determine what
// specific tree changes to listen to, and note that listnening to all
// tree changes can be expensive.
- [nocompile] static void addTreeChangeObserver(
+ [nocompile, doesNotSupportPromises="Event callback"]
+ static void addTreeChangeObserver(
TreeChangeObserverFilter filter, TreeChangeObserver observer);
// Remove a tree change observer.
- [nocompile] static void removeTreeChangeObserver(
+ [nocompile, doesNotSupportPromises="Event callback"]
+ static void removeTreeChangeObserver(
TreeChangeObserver observer);
// Sets the selection in a tree. This creates a selection in a single
diff --git a/idl/extensions/automation_internal.idl b/idl/extensions/automation_internal.idl
index 5437c75..bb14dbe 100644
--- a/idl/extensions/automation_internal.idl
+++ b/idl/extensions/automation_internal.idl
@@ -98,18 +98,6 @@ namespace automationInternal {
long y;
};
- // Arguments for the querySelector function.
- dictionary QuerySelectorRequiredParams {
- DOMString treeID;
- long automationNodeID;
- DOMString selector;
- };
-
- // Arguments for the enableTab function.
- dictionary EnableTabParams {
- long? tabID;
- };
-
// Arguments for the getImageData action.
dictionary GetImageDataParams {
long maxWidth;
@@ -129,16 +117,6 @@ namespace automationInternal {
long endIndex;
};
- // Info returned for the EnableTabCallback.
- dictionary EnableTabCallbackInfo {
- DOMString treeID;
- long tabId;
- };
-
- // Returns the accessibility tree id of the web contents who's accessibility
- // was enabled using enableTab().
- callback EnableTabCallback = void(EnableTabCallbackInfo info);
-
// Callback called when enableDesktop() returns. Returns the accessibility
// tree id of the desktop tree.
callback EnableDesktopCallback = void(DOMString tree_id);
@@ -147,16 +125,7 @@ namespace automationInternal {
// accessibility api state at that point.
callback DisableDesktopCallback = void();
- // Callback called when querySelector() returns.
- callback QuerySelectorCallback = void(long resultAutomationNodeID);
-
interface Functions {
- // Enable automation of the tab with the given id, or the active tab if no
- // tab id is given, and retrieves accessibility tree id for use in
- // future updates.
- [supportsPromises] static void enableTab(EnableTabParams args,
- EnableTabCallback callback);
-
// Enable automation of the tree with the given id.
static void enableTree(DOMString tree_id);
@@ -170,11 +139,6 @@ namespace automationInternal {
// Performs an action on an automation node.
static void performAction(PerformActionRequiredParams args,
object opt_args);
-
- // Performs a query selector query.
- [supportsPromises] static void querySelector(
- QuerySelectorRequiredParams args,
- QuerySelectorCallback callback);
};
interface Events {
diff --git a/idl/extensions/bluetooth.idl b/idl/extensions/bluetooth.idl
index 7423209..0e95092 100644
--- a/idl/extensions/bluetooth.idl
+++ b/idl/extensions/bluetooth.idl
@@ -4,7 +4,6 @@
// Use the chrome.bluetooth API to connect to a Bluetooth
// device. All functions report failures via chrome.runtime.lastError.
-[modernised_enums]
namespace bluetooth {
// Allocation authorities for Vendor IDs.
enum VendorIdSource {bluetooth, usb};
diff --git a/idl/extensions/bluetooth_low_energy.idl b/idl/extensions/bluetooth_low_energy.idl
index f42c7f0..d4eaf3f 100644
--- a/idl/extensions/bluetooth_low_energy.idl
+++ b/idl/extensions/bluetooth_low_energy.idl
@@ -6,7 +6,6 @@
// Bluetooth Smart (Low Energy) devices using the
//
// Generic Attribute Profile (GATT).
-[modernised_enums]
namespace bluetoothLowEnergy {
// Values representing the possible properties of a characteristic.
// Characteristic permissions are inferred from these properties.
diff --git a/idl/extensions/bluetooth_private.idl b/idl/extensions/bluetooth_private.idl
index f3ea202..1fe8b89 100644
--- a/idl/extensions/bluetooth_private.idl
+++ b/idl/extensions/bluetooth_private.idl
@@ -6,8 +6,7 @@
// adapter state and handle device pairing.
// NOTE: This IDL is dependent on bluetooth.idl.
-[implemented_in = "extensions/browser/api/bluetooth/bluetooth_private_api.h",
-modernised_enums]
+[implemented_in = "extensions/browser/api/bluetooth/bluetooth_private_api.h"]
namespace bluetoothPrivate {
// Events that can occur during pairing. The method used for pairing varies
// depending on the capability of the two devices.
diff --git a/idl/extensions/bluetooth_socket.idl b/idl/extensions/bluetooth_socket.idl
index 0675268..659edda 100644
--- a/idl/extensions/bluetooth_socket.idl
+++ b/idl/extensions/bluetooth_socket.idl
@@ -4,7 +4,6 @@
// Use the chrome.bluetoothSocket API to send and receive data
// to Bluetooth devices using RFCOMM and L2CAP connections.
-[modernised_enums]
namespace bluetoothSocket {
// The socket properties specified in the $ref:create or $ref:update
// function. Each property is optional. If a property value is not specified,
diff --git a/idl/extensions/cec_private.idl b/idl/extensions/cec_private.idl
index 5a78e2e..db7bb07 100644
--- a/idl/extensions/cec_private.idl
+++ b/idl/extensions/cec_private.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Private API for HDMI CEC functionality.
-[modernised_enums, platforms=("chromeos")]
+[platforms=("chromeos")]
namespace cecPrivate {
enum DisplayCecPowerState {
diff --git a/idl/extensions/clipboard.idl b/idl/extensions/clipboard.idl
index 9ac721d..131da74 100644
--- a/idl/extensions/clipboard.idl
+++ b/idl/extensions/clipboard.idl
@@ -6,7 +6,7 @@
// access data of the clipboard. This is a temporary solution for
// chromeos platform apps until open-web alternative is available. It will be
// deprecated once open-web solution is available, which could be in 2017 Q4.
-[modernised_enums, platforms=("chromeos", "lacros"),
+[platforms=("chromeos", "lacros"),
implemented_in="extensions/browser/api/clipboard/clipboard_api.h"]
namespace clipboard {
// Supported image types.
diff --git a/idl/extensions/content_scripts.idl b/idl/extensions/content_scripts.idl
index d231af9..4115840 100644
--- a/idl/extensions/content_scripts.idl
+++ b/idl/extensions/content_scripts.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Stub namespace for the "content_scripts" manifest key.
-[generate_error_messages, modernised_enums]
+[generate_error_messages]
namespace contentScripts {
// The stage in the document lifecycle when the javascript file is injected.
enum RunAt {
@@ -28,12 +28,12 @@ namespace contentScripts {
// Describes a content script to be injected into a web page.
dictionary ContentScript {
// Specifies which pages this content script will be injected into. See
- // Match Patterns for more details on the
- // syntax of these strings.
+ // Match Patterns for more
+ // details on the syntax of these strings.
DOMString[] matches;
// Excludes pages that this content script would otherwise be injected into.
- // See Match Patterns for more details on the
- // syntax of these strings.
+ // See Match Patterns for more
+ // details on the syntax of these strings.
DOMString[]? exclude_matches;
// The list of CSS files to be injected into matching pages. These are
// injected in the order they appear in this array, before any DOM is
diff --git a/idl/extensions/declarative_net_request.idl b/idl/extensions/declarative_net_request.idl
index 3f5f9d0..d965c21 100644
--- a/idl/extensions/declarative_net_request.idl
+++ b/idl/extensions/declarative_net_request.idl
@@ -6,7 +6,7 @@
// network requests by specifying declarative rules. This lets extensions
// modify network requests without intercepting them and viewing their content,
// thus providing more privacy.
-[generate_error_messages, modernised_enums]
+[generate_error_messages]
namespace declarativeNetRequest {
// This describes the resource type of the network request.
enum ResourceType {
@@ -170,6 +170,18 @@ namespace declarativeNetRequest {
DOMString? regexSubstitution;
};
+ // TODO(crbug.com/1141166): Add documentation once feature is complete.
+ [nodoc] dictionary HeaderInfo {
+ // The name of the header.
+ DOMString header;
+ // If specified, match this rule if the header's value contains at least one
+ // element in this list.
+ DOMString[]? values;
+ // If specified, the rule is not matched if the header exists but its value
+ // contains at least one element in this list.
+ DOMString[]? excludedValues;
+ };
+
[noinline_doc] dictionary RuleCondition {
// The pattern which is matched against the network request url.
@@ -221,7 +233,7 @@ namespace declarativeNetRequest {
DOMString? regexFilter;
// Whether the urlFilter or regexFilter
- // (whichever is specified) is case sensitive. Default is true.
+ // (whichever is specified) is case sensitive. Default is false.
boolean? isUrlFilterCaseSensitive;
// The rule will only match network requests originating from the list of
@@ -338,6 +350,15 @@ namespace declarativeNetRequest {
// $(ref:tabs.TAB_ID_NONE) excludes requests which don't originate from a
// tab. Only supported for session-scoped rules.
long[]? excludedTabIds;
+
+ // Rule matches if the request matches any response header in this list (if
+ // specified).
+ // TODO(crbug,com/1141166): Add documentation once feature is complete.
+ [nodoc] HeaderInfo[]? responseHeaders;
+
+ // Rule does not match if the request has any of the specified headers.
+ // TODO(crbug,com/1141166): Add documentation once feature is complete.
+ [nodoc] DOMString[]? excludedResponseHeaders;
};
dictionary ModifyHeaderInfo {
@@ -689,7 +710,7 @@ namespace declarativeNetRequest {
// |callback|: Called once the update is complete. In case of an error,
// $(ref:runtime.lastError) will be set and no change will be made to the
// enabled static rules.
- [nodoc, supportsPromises] static void updateStaticRules(
+ [supportsPromises] static void updateStaticRules(
UpdateStaticRulesOptions options,
optional EmptyCallback callback);
@@ -698,7 +719,7 @@ namespace declarativeNetRequest {
// |options|: Specifies the ruleset to query.
// |callback|: Called with a list of ids that correspond to the disabled
// rules in that ruleset.
- [nodoc, supportsPromises] static void getDisabledRuleIds(
+ [supportsPromises] static void getDisabledRuleIds(
GetDisabledRuleIdsOptions options,
GetDisabledRuleIdsCallback callback);
@@ -758,13 +779,22 @@ namespace declarativeNetRequest {
// the global static rule limit.
[value=30000] static long GUARANTEED_MINIMUM_STATIC_RULES();
- // The maximum number of dynamic rules that an extension can add.
- [nodoc, deprecated="Use $(ref:MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES) instead", value=5000]
- static long MAX_NUMBER_OF_DYNAMIC_RULES();
-
// The maximum number of combined dynamic and session scoped rules an
// extension can add.
- [value=5000] static long MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES();
+ [nodoc, value=5000] static long MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES();
+
+ // The maximum number of dynamic rules that an extension can add.
+ [value=30000] static long MAX_NUMBER_OF_DYNAMIC_RULES();
+
+ // The maximum number of "unsafe" dynamic rules that an extension can add.
+ [value=5000] static long MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES();
+
+ // The maximum number of session scoped rules that an extension can add.
+ [value=5000] static long MAX_NUMBER_OF_SESSION_RULES();
+
+ // The maximum number of "unsafe" session scoped rules that an extension can
+ // add.
+ [value=5000] static long MAX_NUMBER_OF_UNSAFE_SESSION_RULES();
// Time interval within which MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL
// getMatchedRules calls can be made, specified in minutes.
@@ -784,11 +814,11 @@ namespace declarativeNetRequest {
// The maximum number of static Rulesets an extension can
// specify as part of the "rule_resources" manifest key.
- [value=50] static long MAX_NUMBER_OF_STATIC_RULESETS();
+ [value=100] static long MAX_NUMBER_OF_STATIC_RULESETS();
// The maximum number of static Rulesets an extension can
// enable at any one time.
- [value=10] static long MAX_NUMBER_OF_ENABLED_STATIC_RULESETS();
+ [value=50] static long MAX_NUMBER_OF_ENABLED_STATIC_RULESETS();
// Ruleset ID for the dynamic rules added by the extension.
[value="_dynamic"] static DOMString DYNAMIC_RULESET_ID();
diff --git a/idl/extensions/extension_types.json b/idl/extensions/extension_types.json
index 9ba1b5f..7c1578a 100644
--- a/idl/extensions/extension_types.json
+++ b/idl/extensions/extension_types.json
@@ -6,9 +6,6 @@
{
"namespace": "extensionTypes",
"description": "The chrome.extensionTypes API contains type declarations for Chrome extensions.",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "ImageFormat",
@@ -120,8 +117,12 @@
"id": "ExecutionWorld",
"type": "string",
"nodoc": true,
- "enum": ["ISOLATED", "MAIN"],
- "description": "The JavaScript world for a script to execute within. Can either be an isolated world, unique to this extension, or the main world of the DOM which is shared with the page's JavaScript."
+ "enum": [
+ "ISOLATED",
+ "MAIN",
+ "USER_SCRIPT"
+ ],
+ "description": "The JavaScript world for a script to execute within. Can either be an isolated world unique to this extension, the main world of the DOM which is shared with the page's JavaScript, or a user scripts world that is only available for scripts registered with the User Scripts API."
}
]
}
diff --git a/idl/extensions/extensions_manifest_types.json b/idl/extensions/extensions_manifest_types.json
index e37ef21..42c87f3 100644
--- a/idl/extensions/extensions_manifest_types.json
+++ b/idl/extensions/extensions_manifest_types.json
@@ -28,11 +28,6 @@
"optional": true,
"type": "array",
"items": { "type": "string" }
- },
- "interact": {
- "description": "Whether the extension is allowed interactive access (true) or read-only access (false; default) to the automation tree.",
- "optional": true,
- "type": "boolean"
}
}
}
diff --git a/idl/extensions/feedback_private.idl b/idl/extensions/feedback_private.idl
index cf0a069..cd4a227 100644
--- a/idl/extensions/feedback_private.idl
+++ b/idl/extensions/feedback_private.idl
@@ -4,7 +4,6 @@
// Use the chrome.feedbackPrivate API to provide Chrome [OS]
// feedback to the Google Feedback servers.
-[modernised_enums]
namespace feedbackPrivate {
dictionary AttachedFile {
@@ -31,7 +30,10 @@ namespace feedbackPrivate {
sadTabCrash,
// Flow for internal Google users.
- googleInternal
+ googleInternal,
+
+ // Flow for AI features.
+ ai
};
dictionary FeedbackInfo {
@@ -112,6 +114,12 @@ namespace feedbackPrivate {
// Whether or not |autofillMetadata| should be included in the feedback
// report.
boolean? sendAutofillMetadata;
+
+ // Whether or not the content is offensive or unsafe.
+ boolean? isOffensiveOrUnsafe;
+
+ // A JSON formatted string containing ai metadata.
+ DOMString? aiMetadata;
};
// Possible statuses that can result from sending feedback.
diff --git a/idl/extensions/file_handlers.idl b/idl/extensions/file_handlers.idl
index b347746..de3b881 100644
--- a/idl/extensions/file_handlers.idl
+++ b/idl/extensions/file_handlers.idl
@@ -43,8 +43,8 @@
Icon[]? icons;
// Whether multiple files should be opened in a single client or multiple.
- // Defaults to `single-client`, which opens one window containing one array
- // with each file. `multiple-clients` opens a new window for each file.
+ // Defaults to `single-client`, which makes all files available in only one
+ // tab. `multiple-client` opens a new tab for each file.
DOMString? launch_type;
};
diff --git a/idl/extensions/file_system.idl b/idl/extensions/file_system.idl
index e42fd47..68cf1eb 100644
--- a/idl/extensions/file_system.idl
+++ b/idl/extensions/file_system.idl
@@ -7,7 +7,6 @@
// read and write to a user-selected location. For example, a text editor app
// can use the API to read and write local documents. All failures are notified
// via chrome.runtime.lastError.
-[modernised_enums]
namespace fileSystem {
dictionary AcceptOption {
// This is the optional text description for this option. If not present,
@@ -113,32 +112,41 @@ namespace fileSystem {
// Get the display path of an Entry object. The display path is based on
// the full path of the file or directory on the local file system, but may
// be made more readable for display purposes.
- static void getDisplayPath([instanceOf=Entry] object entry,
- GetDisplayPathCallback callback);
+ [supportsPromises] static void getDisplayPath(
+ [instanceOf=Entry] object entry,
+ GetDisplayPathCallback callback);
// Get a writable Entry from another Entry. This call will fail with a
// runtime error if the application does not have the 'write' permission
// under 'fileSystem'. If entry is a DirectoryEntry, this call will fail if
// the application does not have the 'directory' permission under
// 'fileSystem'.
- static void getWritableEntry([instanceOf=Entry] object entry,
- EntryCallback callback);
+ [doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
+ static void getWritableEntry(
+ [instanceOf=Entry] object entry,
+ EntryCallback callback);
// Gets whether this Entry is writable or not.
- static void isWritableEntry([instanceOf=Entry] object entry,
- IsWritableCallback callback);
+ [supportsPromises] static void isWritableEntry(
+ [instanceOf=Entry] object entry,
+ IsWritableCallback callback);
// Ask the user to choose a file or directory.
+ [doesNotSupportPromises="Multi-parameter callback crbug.com/1313625,
+ Custom hook sets lastError crbug.com/1504349"]
static void chooseEntry(optional ChooseEntryOptions options,
EntriesCallback callback);
// Returns the file entry with the given id if it can be restored. This call
// will fail with a runtime error otherwise.
- static void restoreEntry(DOMString id, EntryCallback callback);
+ [doesNotSupportPromises="Custom hook sets lastError crbug.com/1504349"]
+ static void restoreEntry(DOMString id,
+ EntryCallback callback);
// Returns whether the app has permission to restore the entry with the
// given id.
- static void isRestorable(DOMString id, IsRestorableCallback callback);
+ [supportsPromises] static void isRestorable(DOMString id,
+ IsRestorableCallback callback);
// Returns an id that can be passed to restoreEntry to regain access to a
// given file entry. Only the 500 most recently used entries are retained,
@@ -157,15 +165,17 @@ namespace fileSystem {
// confirmation dialog will be shown on top of the active app window.
// In case of an error, fileSystem will be undefined, and
// chrome.runtime.lastError will be set.
- static void requestFileSystem(RequestFileSystemOptions options,
- RequestFileSystemCallback callback);
+ [supportsPromises] static void requestFileSystem(
+ RequestFileSystemOptions options,
+ RequestFileSystemCallback callback);
// Returns a list of volumes available for requestFileSystem().
// The "fileSystem": {"requestFileSystem"} manifest permission
// is required. Available to kiosk apps running in the kiosk session only.
// In case of an error, volumes will be undefined, and
// chrome.runtime.lastError will be set.
- static void getVolumeList(GetVolumeListCallback callback);
+ [supportsPromises] static void getVolumeList(
+ GetVolumeListCallback callback);
};
interface Events {
diff --git a/idl/extensions/guest_view_internal.json b/idl/extensions/guest_view_internal.json
index ead1747..029a6e9 100644
--- a/idl/extensions/guest_view_internal.json
+++ b/idl/extensions/guest_view_internal.json
@@ -56,6 +56,10 @@
"name": "viewType",
"nodoc": true
},
+ {
+ "type": "string",
+ "name": "ownerFrameToken"
+ },
{
"type": "object",
"name": "createParams",
@@ -66,13 +70,22 @@
"name": "callback",
"parameters": [
{
- "type": "object",
- "name": "returnParams",
- "additionalProperties": {"type": "any"}
+ "type": "integer",
+ "name": "instanceId"
}
]
}
},
+ {
+ "name": "destroyUnattachedGuest",
+ "type": "function",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "instanceId"
+ }
+ ]
+ },
{
"name": "setSize",
"type": "function",
diff --git a/idl/extensions/hid.idl b/idl/extensions/hid.idl
index 816f997..56514d8 100644
--- a/idl/extensions/hid.idl
+++ b/idl/extensions/hid.idl
@@ -85,22 +85,24 @@ namespace hid {
interface Functions {
// Enumerate connected HID devices.
// |options|: The properties to search for on target devices.
- static void getDevices(GetDevicesOptions options,
- GetDevicesCallback callback);
+ [supportsPromises] static void getDevices(GetDevicesOptions options,
+ GetDevicesCallback callback);
// Open a connection to an HID device for communication.
// |deviceId|: The $(ref:HidDeviceInfo.deviceId) of the device to open.
- static void connect(long deviceId,
- ConnectCallback callback);
+ [supportsPromises] static void connect(long deviceId,
+ ConnectCallback callback);
// Disconnect from a device. Invoking operations on a device after calling
// this is safe but has no effect.
// |connectionId|: The connectionId returned by $(ref:connect).
- static void disconnect(long connectionId,
- optional DisconnectCallback callback);
+ [supportsPromises] static void disconnect(
+ long connectionId,
+ optional DisconnectCallback callback);
// Receive the next input report from the device.
// |connectionId|: The connectionId returned by $(ref:connect).
+ [doesNotSupportPromises="Multi-parameter callback crbug.com/1313625"]
static void receive(long connectionId,
ReceiveCallback callback);
@@ -111,17 +113,18 @@ namespace hid {
// |connectionId|: The connectionId returned by $(ref:connect).
// |reportId|: The report ID to use, or 0 if none.
// |data|: The report data.
- static void send(long connectionId,
- long reportId,
- ArrayBuffer data,
- SendCallback callback);
+ [supportsPromises] static void send(long connectionId,
+ long reportId,
+ ArrayBuffer data,
+ SendCallback callback);
// Request a feature report from the device.
// |connectionId|: The connectionId returned by $(ref:connect).
// |reportId|: The report ID, or 0 if none.
- static void receiveFeatureReport(long connectionId,
- long reportId,
- ReceiveFeatureReportCallback callback);
+ [supportsPromises] static void receiveFeatureReport(
+ long connectionId,
+ long reportId,
+ ReceiveFeatureReportCallback callback);
// Send a feature report to the device.
//
@@ -130,10 +133,10 @@ namespace hid {
// |connectionId|: The connectionId returned by $(ref:connect).
// |reportId|: The report ID to use, or 0 if none.
// |data|: The report data.
- static void sendFeatureReport(long connectionId,
- long reportId,
- ArrayBuffer data,
- SendCallback callback);
+ [supportsPromises] static void sendFeatureReport(long connectionId,
+ long reportId,
+ ArrayBuffer data,
+ SendCallback callback);
};
interface Events {
diff --git a/idl/extensions/i18n.json b/idl/extensions/i18n.json
index a0d6f41..6483f8a 100644
--- a/idl/extensions/i18n.json
+++ b/idl/extensions/i18n.json
@@ -35,7 +35,7 @@
{
"type": "string",
"name": "messageName",
- "description": "The name of the message, as specified in the messages.json file."
+ "description": "The name of the message, as specified in the messages.json file."
},
{
"type": "any",
diff --git a/idl/extensions/incognito.json b/idl/extensions/incognito.json
index 664d654..3e9e76b 100644
--- a/idl/extensions/incognito.json
+++ b/idl/extensions/incognito.json
@@ -5,10 +5,7 @@
[
{
"namespace": "incognito",
- "description": "Dummy namepsace for the incognito manifest key.",
- "compiler_options": {
- "modernised_enums": true
- },
+ "description": "Dummy namespace for the incognito manifest key.",
"types": [
{
"id": "IncognitoMode",
diff --git a/idl/extensions/management.json b/idl/extensions/management.json
index 5ed069f..94d1c58 100644
--- a/idl/extensions/management.json
+++ b/idl/extensions/management.json
@@ -5,10 +5,7 @@
[
{
"namespace":"management",
- "description": "The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page.",
- "compiler_options": {
- "modernised_enums": true
- },
+ "description": "The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page.",
"types": [
{
"id": "IconInfo",
@@ -65,11 +62,11 @@
"type": "string"
},
"version": {
- "description": "The version of this extension, app, or theme.",
+ "description": "The version of this extension, app, or theme.",
"type": "string"
},
"versionName": {
- "description": "The version name of this extension, app, or theme if the manifest specified one.",
+ "description": "The version name of this extension, app, or theme if the manifest specified one.",
"type": "string",
"optional": true
},
@@ -124,7 +121,7 @@
"type": "string"
},
"icons": {
- "description": "A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.",
+ "description": "A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.",
"type": "array",
"optional": true,
"items": {
@@ -234,7 +231,7 @@
},
{
"name": "getPermissionWarningsById",
- "description": "Returns a list of permission warnings for the given extension id.",
+ "description": "Returns a list of permission warnings for the given extension id.",
"parameters": [
{ "name": "id",
"type": "string",
@@ -255,7 +252,7 @@
},
{
"name": "getPermissionWarningsByManifest",
- "description": "Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.",
+ "description": "Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.",
"parameters": [
{
"name": "manifestStr",
@@ -413,30 +410,6 @@
]
}
},
- {
- "name": "canInstallReplacementAndroidApp",
- "description": "Checks if the replacement android app can be installed. Errors generated by this API are reported by setting $(ref:runtime.lastError) and executing the function's regular callback.",
- "parameters": [],
- "returns_async": {
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "boolean"
- }
- ]
- }
- },
- {
- "name": "installReplacementAndroidApp",
- "description": "Prompts the user to install the replacement Android app from the manifest. Errors generated by this API are reported by setting $(ref:runtime.lastError) and executing the function's regular callback.",
- "parameters": [],
- "returns_async": {
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- },
{
"name": "installReplacementWebApp",
"description": "Launches the replacement_web_app specified in the manifest. Prompts the user to install if not already installed.",
diff --git a/idl/extensions/media_perception_private.idl b/idl/extensions/media_perception_private.idl
index 30ad69d..d9a9efa 100644
--- a/idl/extensions/media_perception_private.idl
+++ b/idl/extensions/media_perception_private.idl
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Private API for receiving real-time media perception information.
-[platforms=("chromeos"), modernised_enums]
+[platforms=("chromeos")]
namespace mediaPerceptionPrivate {
enum Status {
// The media analytics process is waiting to be launched.
diff --git a/idl/extensions/metrics_private.json b/idl/extensions/metrics_private.json
index 4bc29dc..a104b45 100644
--- a/idl/extensions/metrics_private.json
+++ b/idl/extensions/metrics_private.json
@@ -6,9 +6,6 @@
{
"namespace": "metricsPrivate",
"description": "none",
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "MetricTypeType",
diff --git a/idl/extensions/mime_handler_private.idl b/idl/extensions/mime_handler_private.idl
index 2734316..e343343 100644
--- a/idl/extensions/mime_handler_private.idl
+++ b/idl/extensions/mime_handler_private.idl
@@ -45,7 +45,9 @@
interface Functions {
// Returns the StreamInfo for the stream for this context if there is one.
- [nocompile] static void getStreamInfo(GetStreamDetailsCallback callback);
+ [nocompile, doesNotSupportPromises=
+ "Custom hook sets lastError crbug.com/1504349"]
+ static void getStreamInfo(GetStreamDetailsCallback callback);
// Sets PDF plugin attributes in the stream for this context if there is
// one.
@@ -54,7 +56,9 @@
// Instructs the PluginDocument, if running in one, to show a dialog in
// response to beforeunload events.
- [nocompile] static void setShowBeforeUnloadDialog(
+ [nocompile, doesNotSupportPromises=
+ "Custom hook sets lastError crbug.com/1504349"]
+ static void setShowBeforeUnloadDialog(
boolean showDialog,
optional SetShowBeforeUnloadDialogCallback callback);
};
diff --git a/idl/extensions/networking_private.idl b/idl/extensions/networking_private.idl
index bc71dfe..c4fd63e 100644
--- a/idl/extensions/networking_private.idl
+++ b/idl/extensions/networking_private.idl
@@ -27,7 +27,6 @@
// TODO(stevenjb/pneubeck): Merge the ONC documentation with this document and
// use it as the ONC specification.
-[modernised_enums]
namespace networkingPrivate {
enum ActivationStateType {
Activated, Activating, NotActivated, PartiallyActivated
@@ -325,7 +324,9 @@ namespace networkingPrivate {
EAPProperties? EAP;
DOMString? Group;
long? IKEVersion;
+ DOMString? LocalIdentity;
DOMString? PSK;
+ DOMString? RemoteIdentity;
boolean? SaveCredentials;
DOMString[]? ServerCAPEMs;
DOMString[]? ServerCARefs;
diff --git a/idl/extensions/offscreen.idl b/idl/extensions/offscreen.idl
index cec419e..875b5e8 100644
--- a/idl/extensions/offscreen.idl
+++ b/idl/extensions/offscreen.idl
@@ -3,40 +3,49 @@
// found in the LICENSE file.
// Use the offscreen API to create and manage offscreen documents.
-[modernised_enums]
namespace offscreen {
enum Reason {
// A reason used for testing purposes only.
TESTING,
- // The offscreen document is responsible for playing audio.
+ // Specifies that the offscreen document is responsible for playing audio.
AUDIO_PLAYBACK,
- // The offscreen document needs to embed and script an iframe in order to
- // modify the iframe's content.
+ // Specifies that the offscreen document needs to embed and script an
+ // iframe in order to modify the iframe's content.
IFRAME_SCRIPTING,
- // The offscreen document needs to embed an iframe and scrape its DOM to
- // extract information.
+ // Specifies that the offscreen document needs to embed an iframe and
+ // scrape its DOM to extract information.
DOM_SCRAPING,
- // The offscreen document needs to interact with Blob objects (including
- // URL.createObjectURL()).
+ // Specifies that the offscreen document needs to interact with Blob
+ // objects (including URL.createObjectURL()).
BLOBS,
- // The offscreen document needs to use the DOMParser API.
+ // Specifies that the offscreen document needs to use the
+ // WebRTC APIs.
WEB_RTC,
- // The offscreen document needs to interact with the clipboard APIs
- // (e.g. Navigator.clipboard).
+ // Specifies that the offscreen document needs to interact with the
+ // localStorage.
+ // Specifies that the offscreen document needs access to
+ // localStorage.
LOCAL_STORAGE,
- // The offscreen document needs to spawn workers.
+ // Specifies that the offscreen document needs to spawn workers.
WORKERS,
- // The offscreen document needs to use navigator.geolocation
+ // Specifies that the offscreen document needs to use
+ // navigator.getBattery.
+ BATTERY_STATUS,
+ // Specifies that the offscreen document needs to use
+ // window.matchMedia.
+ MATCH_MEDIA,
+ // Specifies that the offscreen document needs to use
+ // navigator.geolocation.
GEOLOCATION
};
diff --git a/idl/extensions/power.idl b/idl/extensions/power.idl
index ba0b11d..e10a881 100644
--- a/idl/extensions/power.idl
+++ b/idl/extensions/power.idl
@@ -8,10 +8,10 @@ namespace power {
callback VoidCallback = void ();
[noinline_doc] enum Level {
- // Prevent the system from sleeping in response to user inactivity.
+ // Prevents the system from sleeping in response to user inactivity.
system,
- // Prevent the display from being turned off or dimmed or the system
+ // Prevents the display from being turned off or dimmed, or the system
// from sleeping in response to user inactivity.
display
};
diff --git a/idl/extensions/printer_provider.idl b/idl/extensions/printer_provider.idl
index 9c4007e..83b836e 100644
--- a/idl/extensions/printer_provider.idl
+++ b/idl/extensions/printer_provider.idl
@@ -5,23 +5,22 @@
// The chrome.printerProvider API exposes events used by print
// manager to query printers controlled by extensions, to query their
// capabilities and to submit print jobs to these printers.
-[modernised_enums]
namespace printerProvider {
// Error codes returned in response to $(ref:onPrintRequested) event.
enum PrintError {
- // Operation completed successfully.
+ // Specifies that the operation was completed successfully.
OK,
- // General failure.
+ // Specifies that a general failure occured.
FAILED,
- // Print ticket is invalid. For example, ticket is inconsistent with
- // capabilities or extension is not able to handle all settings from the
- // ticket.
+ // Specifies that the print ticket is invalid. For example, the ticket is
+ // inconsistent with some capabilities, or the extension is not able to
+ // handle all settings from the ticket.
INVALID_TICKET,
- // Document is invalid. For example, data may be corrupted or the format is
- // incompatible with the extension.
+ // Specifies that the document is invalid. For example, data may be
+ // corrupted or the format is incompatible with the extension.
INVALID_DATA
};
@@ -48,6 +47,12 @@ namespace printerProvider {
// Print ticket in
//
// CJT format.
+ //
object ticket;
// The document content type. Supported formats are
diff --git a/idl/extensions/printer_provider_internal.idl b/idl/extensions/printer_provider_internal.idl
index 342198a..afbb47d 100644
--- a/idl/extensions/printer_provider_internal.idl
+++ b/idl/extensions/printer_provider_internal.idl
@@ -12,7 +12,7 @@
// is internally dispatched having a requestId argument (which is removed from
// the argument list before the event actually reaches the event listeners). The
// requestId is forwarded to the chrome.printerProviderInternal API functions.
-[modernised_enums, implemented_in="extensions/browser/api/printer_provider/printer_provider_internal_api.h"]
+[implemented_in="extensions/browser/api/printer_provider/printer_provider_internal_api.h"]
namespace printerProviderInternal {
// Same as in printerProvider.PrintError enum API.
enum PrintError { OK, FAILED, INVALID_TICKET, INVALID_DATA };
diff --git a/idl/extensions/requirements.json b/idl/extensions/requirements.json
index 02792ed..e32487a 100644
--- a/idl/extensions/requirements.json
+++ b/idl/extensions/requirements.json
@@ -5,9 +5,8 @@
[
{
"namespace": "requirements",
- "description": "Stub namepsace for the 'requirements' manifest key.",
+ "description": "Stub namespace for the 'requirements' manifest key.",
"compiler_options": {
- "modernised_enums": true,
"generate_error_messages": true
},
"types": [
@@ -42,16 +41,6 @@
"items": { "$ref": "3DFeature" }
}
}
- },
- "window": {
- "type": "object",
- "optional": true,
- "properties": {
- "shape": {
- "type": "boolean",
- "optional": true
- }
- }
}
}
}
diff --git a/idl/extensions/runtime.json b/idl/extensions/runtime.json
index 753fd0e..95e37c9 100644
--- a/idl/extensions/runtime.json
+++ b/idl/extensions/runtime.json
@@ -8,10 +8,7 @@
[
{
"namespace": "runtime",
- "description": "Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.",
- "compiler_options": {
- "modernised_enums": true
- },
+ "description": "Use the chrome.runtime API to retrieve the service worker, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.",
"types": [
{
"id": "Port",
@@ -83,26 +80,39 @@
"type": "string",
"description": "The operating system Chrome is running on.",
"enum": [
- "mac",
- "win",
- "android",
- "cros",
- "linux",
- "openbsd",
- "fuchsia"
+ {"name": "mac", "description": "Specifies the MacOS operating system."},
+ {"name": "win", "description": "Specifies the Windows operating system."},
+ {"name": "android", "description": "Specifies the Android operating system."},
+ {"name": "cros", "description": "Specifies the Chrome operating system."},
+ {"name": "linux", "description": "Specifies the Linux operating system."},
+ {"name": "openbsd", "description": "Specifies the OpenBSD operating system."},
+ {"name": "fuchsia", "description": "Specifies the Fuchsia operating system."}
]
},
{
"id": "PlatformArch",
"type": "string",
- "enum": ["arm", "arm64", "x86-32", "x86-64", "mips", "mips64"],
+ "enum": [
+ {"name": "arm", "description": "Specifies the processer architecture as arm."},
+ {"name": "arm64", "description": "Specifies the processer architecture as arm64."},
+ {"name": "x86-32", "description": "Specifies the processer architecture as x86-32."},
+ {"name": "x86-64", "description": "Specifies the processer architecture as x86-64."},
+ {"name": "mips", "description": "Specifies the processer architecture as mips."},
+ {"name": "mips64", "description": "Specifies the processer architecture as mips64."}
+ ],
"description": "The machine's processor architecture."
},
{
"id": "PlatformNaclArch",
"description": "The native client architecture. This may be different from arch on some platforms.",
"type": "string",
- "enum": ["arm", "x86-32", "x86-64", "mips", "mips64"]
+ "enum": [
+ {"name": "arm", "description": "Specifies the native client architecture as arm."},
+ {"name": "x86-32", "description": "Specifies the native client architecture as x86-32."},
+ {"name": "x86-64", "description": "Specifies the native client architecture as x86-64."},
+ {"name": "mips", "description": "Specifies the native client architecture as mips."},
+ {"name": "mips64", "description": "Specifies the native client architecture as mips64."}
+ ]
},
{
"id": "PlatformInfo",
@@ -126,25 +136,44 @@
{
"id": "RequestUpdateCheckStatus",
"type": "string",
- "enum": ["throttled", "no_update", "update_available"],
+ "enum": [
+ {"name": "throttled", "description": "Specifies that the status check has been throttled. This can occur after repeated checks within a short amount of time."},
+ {"name": "no_update", "description": "Specifies that there are no available updates to install."},
+ {"name": "update_available", "description": "Specifies that there is an available update to install."}
+ ],
"description": "Result of the update check."
},
{
"id": "OnInstalledReason",
"type": "string",
- "enum": ["install", "update", "chrome_update", "shared_module_update"],
+ "enum": [
+ {"name": "install", "description": "Specifies the event reason as an installation."},
+ {"name": "update", "description": "Specifies the event reason as an extension update."},
+ {"name": "chrome_update", "description": "Specifies the event reason as a Chrome update."},
+ {"name": "shared_module_update", "description": "Specifies the event reason as an update to a shared module."}
+ ],
"description": "The reason that this event is being dispatched."
},
{
"id": "OnRestartRequiredReason",
"type": "string",
"description": "The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the application is updated to a newer version. 'os_update' is used when the restart is needed because the browser/OS is updated to a newer version. 'periodic' is used when the system runs for more than the permitted uptime set in the enterprise policy.",
- "enum": ["app_update", "os_update", "periodic"]
+ "enum": [
+ {"name": "app_update", "description": "Specifies the event reason as an update to the app."},
+ {"name": "os_update", "description": "Specifies the event reason as an update to the operating system."},
+ {"name": "periodic", "description": "Specifies the event reason as a periodic restart of the app."}
+ ]
},
{
"id": "ContextType",
"type": "string",
- "enum": ["TAB", "POPUP", "BACKGROUND", "OFFSCREEN_DOCUMENT", "SIDE_PANEL"]
+ "enum": [
+ {"name": "TAB", "description": "Specifies the context type as a tab"},
+ {"name": "POPUP", "description": "Specifies the context type as an extension popup window"},
+ {"name": "BACKGROUND", "description": "Specifies the context type as a service worker."},
+ {"name": "OFFSCREEN_DOCUMENT", "description": "Specifies the context type as an offscreen document."},
+ {"name": "SIDE_PANEL", "description": "Specifies the context type as a side panel."}
+ ]
},
{
"id": "ExtensionContext",
@@ -248,7 +277,7 @@
"lastError": {
"type": "object",
"optional": true,
- "description": "This will be defined during an API method callback if there was an error",
+ "description": "Populated with an error message if calling an API function fails; otherwise undefined. This is only defined within the scope of that function's callback. If an error is produced, but runtime.lastError is not accessed within the callback, a message is logged to the console listing the API function that produced the error. API functions that return promises do not set this property.",
"properties": {
"message": {
"optional": true,
@@ -297,7 +326,7 @@
},
{
"name": "getManifest",
- "description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.",
+ "description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.",
"type": "function",
"nocompile": true,
"parameters": [],
@@ -405,9 +434,9 @@
"name": "connect",
"type": "function",
"nocompile": true,
- "description": "Attempts to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).",
+ "description": "Attempts to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).",
"parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging."},
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging."},
{
"type": "object",
"name": "connectInfo",
@@ -427,7 +456,7 @@
"name": "connectNative",
"type": "function",
"nocompile": true,
- "description": "Connects to a native application in the host machine. See Native Messaging for more information.",
+ "description": "Connects to a native application in the host machine. See Native Messaging for more information.",
"parameters": [
{
"type": "string",
@@ -447,7 +476,7 @@
"allowAmbiguousOptionalArguments": true,
"description": "Sends a single message to event listeners within your extension/app or a different extension/app. Similar to $(ref:runtime.connect) but only sends a single message, with an optional response. If sending to your extension, the $(ref:runtime.onMessage) event will be fired in every frame of your extension (except for the sender's frame), or $(ref:runtime.onMessageExternal), if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $(ref:tabs.sendMessage).",
"parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging."},
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging."},
{ "type": "any", "name": "message", "description": "The message to send. This message should be a JSON-ifiable object." },
{
"type": "object",
@@ -525,20 +554,18 @@
"name": "getPackageDirectoryEntry",
"type": "function",
"description": "Returns a DirectoryEntry for the package directory.",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "directoryEntry",
- "type": "object",
- "additionalProperties": { "type": "any" },
- "isInstanceOf": "DirectoryEntry"
- }
- ]
- }
- ]
+ "parameters": [],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "directoryEntry",
+ "type": "object",
+ "additionalProperties": { "type": "any" },
+ "isInstanceOf": "DirectoryEntry"
+ }
+ ]
+ }
},
{
"name": "getContexts",
@@ -652,14 +679,13 @@
"name": "onConnectExternal",
"type": "function",
"nocompile": true,
- "description": "Fired when a connection is made from another extension (by $(ref:runtime.connect)).",
+ "description": "Fired when a connection is made from another extension (by $(ref:runtime.connect)), or from an externally connectable web site.",
"parameters": [
{"$ref": "Port", "name": "port"}
]
},
{
"name": "onUserScriptConnect",
- "nodoc": true,
"type": "function",
"nocompile": true,
"options": { "unmanaged": true },
@@ -715,7 +741,6 @@
},
{
"name": "onUserScriptMessage",
- "nodoc": true,
"type": "function",
"nocompile": true,
"options": { "unmanaged": true },
diff --git a/idl/extensions/scripts_internal.idl b/idl/extensions/scripts_internal.idl
new file mode 100644
index 0000000..010ff69
--- /dev/null
+++ b/idl/extensions/scripts_internal.idl
@@ -0,0 +1,69 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Internal namespace for representing content scripts.
+namespace scriptsInternal {
+ // The source of the user script. This will also determine certain
+ // capabilities of the script (such as whether it can use globs, raw strings
+ // for code, etc).
+ enum Source {
+ DYNAMIC_CONTENT_SCRIPT,
+ DYNAMIC_USER_SCRIPT,
+ MANIFEST_CONTENT_SCRIPT
+ };
+
+ // The source of the script to inject.
+ dictionary ScriptSource {
+ // A string containing the JavaScript code to inject. Exactly one of
+ // file or code must be specified.
+ DOMString? code;
+ // The path of the JavaScript file to inject relative to the extension's
+ // root directory. Exactly one of file or code
+ // must be specified.
+ DOMString? file;
+ };
+
+ // Describes a serialized script, intended for storage and persistence across
+ // browser sessions.
+ // Note: Though it is called "UserScript", this is used for scripts through
+ // the scripting API (dynamic content scripts), content scripts in the
+ // manifest (static content scripts), and user scripts through the userScripts
+ // API. "UserScript" was chosen because it matches the correspodning
+ // extenisons::UserScript object (the runtime representation of this) and
+ // because "Script" is ambiguous (e.g. background script, general JS script,
+ // etc).
+ dictionary SerializedUserScript {
+ // Whether the script will inject into all frames, regardless if it is not
+ // the top-most frame in the tab.
+ boolean? allFrames;
+ // The list of CSS files to be injected into matching pages. Note that,
+ // today, we only expect these to contain files. It is represented as a
+ // ScriptSource for compatibility and consistency with `js`.
+ ScriptSource[]? css;
+ // Excludes pages that this user script would otherwise be injected into.
+ DOMString[]? excludeMatches;
+ // Specifies wildcard patterns for pages this user script will NOT be
+ // injected into.
+ DOMString[]? excludeGlobs;
+ // The ID of the script.
+ DOMString id;
+ // Specifies wildcard patterns for pages this user script will be injected
+ // into.
+ DOMString[]? includeGlobs;
+ // The list of sources of javascript to be injected into matching pages.
+ ScriptSource[]? js;
+ // Specifies which pages this user script will be injected into.
+ DOMString[] matches;
+ // Whether the script should inject into any frames where the URL belongs to
+ // a scheme that would never match a specified Match Pattern, including
+ // about:, data:, blob:, and filesystem: schemes.
+ boolean? matchOriginAsFallback;
+ // Specifies when JavaScript files are injected into the web page.
+ extensionTypes.RunAt? runAt;
+ // The "source" of the user script.
+ Source source;
+ // The JavaScript "world" to run the script in.
+ extensionTypes.ExecutionWorld world;
+ };
+};
\ No newline at end of file
diff --git a/idl/extensions/serial.idl b/idl/extensions/serial.idl
index aadc033..4f9f5c4 100644
--- a/idl/extensions/serial.idl
+++ b/idl/extensions/serial.idl
@@ -4,7 +4,6 @@
// Use the chrome.serial API to read from and write to a device
// connected to a serial port.
-[modernised_enums]
namespace serial {
dictionary DeviceInfo {
@@ -263,82 +262,90 @@ namespace serial {
// Returns information about available serial devices on the system.
// The list is regenerated each time this method is called.
// |callback| : Called with the list of DeviceInfo objects.
- static void getDevices(GetDevicesCallback callback);
+ [supportsPromises] static void getDevices(GetDevicesCallback callback);
// Connects to a given serial port.
// |path| : The system path of the serial port to open.
// |options| : Port configuration options.
// |callback| : Called when the connection has been opened.
- static void connect(DOMString path,
- optional ConnectionOptions options,
- ConnectCallback callback);
+ [supportsPromises] static void connect(DOMString path,
+ optional ConnectionOptions options,
+ ConnectCallback callback);
// Update the option settings on an open serial port connection.
// |connectionId| : The id of the opened connection.
// |options| : Port configuration options.
// |callback| : Called when the configuation has completed.
- static void update(long connectionId,
- ConnectionOptions options,
- UpdateCallback callback);
+ [supportsPromises] static void update(long connectionId,
+ ConnectionOptions options,
+ UpdateCallback callback);
// Disconnects from a serial port.
// |connectionId| : The id of the opened connection.
// |callback| : Called when the connection has been closed.
- static void disconnect(long connectionId, DisconnectCallback callback);
+ [supportsPromises] static void disconnect(long connectionId,
+ DisconnectCallback callback);
// Pauses or unpauses an open connection.
// |connectionId| : The id of the opened connection.
// |paused| : Flag to indicate whether to pause or unpause.
// |callback| : Called when the connection has been successfully paused or
// unpaused.
- static void setPaused(long connectionId,
- boolean paused,
- SetPausedCallback callback);
+ [supportsPromises] static void setPaused(long connectionId,
+ boolean paused,
+ SetPausedCallback callback);
// Retrieves the state of a given connection.
// |connectionId| : The id of the opened connection.
// |callback| : Called with connection state information when available.
- static void getInfo(long connectionId, GetInfoCallback callback);
+ [supportsPromises] static void getInfo(long connectionId,
+ GetInfoCallback callback);
// Retrieves the list of currently opened serial port connections owned by
// the application.
// |callback| : Called with the list of connections when available.
- static void getConnections(GetConnectionsCallback callback);
+ [supportsPromises] static void getConnections(
+ GetConnectionsCallback callback);
// Writes data to the given connection.
// |connectionId| : The id of the connection.
// |data| : The data to send.
// |callback| : Called when the operation has completed.
- static void send(long connectionId,
- ArrayBuffer data,
- SendCallback callback);
+ [supportsPromises] static void send(long connectionId,
+ ArrayBuffer data,
+ SendCallback callback);
// Flushes all bytes in the given connection's input and output buffers.
- static void flush(long connectionId, FlushCallback callback);
+ [supportsPromises] static void flush(long connectionId,
+ FlushCallback callback);
// Retrieves the state of control signals on a given connection.
// |connectionId| : The id of the connection.
// |callback| : Called when the control signals are available.
- static void getControlSignals(long connectionId,
- GetControlSignalsCallback callback);
+ [supportsPromises] static void getControlSignals(
+ long connectionId,
+ GetControlSignalsCallback callback);
// Sets the state of control signals on a given connection.
// |connectionId| : The id of the connection.
// |signals| : The set of signal changes to send to the device.
// |callback| : Called once the control signals have been set.
- static void setControlSignals(long connectionId,
- HostControlSignals signals,
- SetControlSignalsCallback callback);
+ [supportsPromises] static void setControlSignals(
+ long connectionId,
+ HostControlSignals signals,
+ SetControlSignalsCallback callback);
// Suspends character transmission on a given connection and places the
// transmission line in a break state until the clearBreak is called.
// |connectionId| : The id of the connection.
- static void setBreak(long connectionId, SetBreakCallback callback);
+ [supportsPromises] static void setBreak(long connectionId,
+ SetBreakCallback callback);
// Restore character transmission on a given connection and place the
// transmission line in a nonbreak state.
// |connectionId| : The id of the connection.
- static void clearBreak(long connectionId, ClearBreakCallback callback);
+ [supportsPromises] static void clearBreak(long connectionId,
+ ClearBreakCallback callback);
};
interface Events {
diff --git a/idl/extensions/socket.idl b/idl/extensions/socket.idl
index abc2751..3f3c8d2 100644
--- a/idl/extensions/socket.idl
+++ b/idl/extensions/socket.idl
@@ -6,7 +6,6 @@
// network using TCP and UDP connections. Note: Starting with Chrome 33,
// this API is deprecated in favor of the $(ref:sockets.udp), $(ref:sockets.tcp) and
// $(ref:sockets.tcpServer) APIs.
-[modernised_enums]
namespace socket {
enum SocketType {
tcp,
@@ -173,6 +172,8 @@ namespace socket {
// |hostname| : The hostname or IP address of the remote machine.
// |port| : The port of the remote machine.
// |callback| : Called when the connection attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void connect(long socketId,
DOMString hostname,
long port,
@@ -184,6 +185,8 @@ namespace socket {
// |address| : The address of the local machine.
// |port| : The port of the local machine.
// |callback| : Called when the bind attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void bind(long socketId,
DOMString address,
long port,
@@ -199,6 +202,8 @@ namespace socket {
// |bufferSize| : The read buffer size.
// |callback| : Delivers data that was available to be read without
// blocking.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void read(long socketId,
optional long bufferSize,
ReadCallback callback);
@@ -208,6 +213,8 @@ namespace socket {
// |data| : The data to write.
// |callback| : Called when the write operation completes without blocking
// or an error occurs.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void write(long socketId,
ArrayBuffer data,
WriteCallback callback);
@@ -216,6 +223,8 @@ namespace socket {
// |socketId| : The socketId.
// |bufferSize| : The receive buffer size.
// |callback| : Returns result of the recvFrom operation.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void recvFrom(long socketId,
optional long bufferSize,
RecvFromCallback callback);
@@ -227,6 +236,8 @@ namespace socket {
// |port| : The port of the remote machine.
// |callback| : Called when the send operation completes without blocking
// or an error occurs.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void sendTo(long socketId,
ArrayBuffer data,
DOMString address,
@@ -242,6 +253,8 @@ namespace socket {
// |port| : The port of the local machine.
// |backlog| : Length of the socket's listen queue.
// |callback| : Called when listen operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void listen(long socketId,
DOMString address,
long port,
@@ -255,6 +268,8 @@ namespace socket {
// invoked immediately with an error as the resultCode.
// |socketId| : The socketId.
// |callback| : The callback is invoked when a new socket is accepted.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void accept(long socketId,
AcceptCallback callback);
@@ -264,6 +279,8 @@ namespace socket {
// |delay| : Set the delay seconds between the last data packet received
// and the first keepalive probe. Default is 0.
// |callback| : Called when the setKeepAlive attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setKeepAlive(long socketId,
boolean enable,
optional long delay,
@@ -274,6 +291,8 @@ namespace socket {
// |socketId| : The socketId.
// |noDelay| : If true, disables Nagle's algorithm.
// |callback| : Called when the setNoDelay attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setNoDelay(long socketId,
boolean noDelay,
SetNoDelayCallback callback);
@@ -295,6 +314,8 @@ namespace socket {
// |address| : The group address to join. Domain names are not supported.
// |callback| : Called when the join group operation is done with an
// integer parameter indicating the platform-independent error code.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void joinGroup(long socketId,
DOMString address,
JoinGroupCallback callback);
@@ -311,6 +332,8 @@ namespace socket {
// |address| : The group address to leave. Domain names are not supported.
// |callback| : Called when the leave group operation is done with an
// integer parameter indicating the platform-independent error code.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void leaveGroup(long socketId, DOMString address,
LeaveGroupCallback callback);
@@ -321,6 +344,8 @@ namespace socket {
// |socketId| : The socketId.
// |ttl| : The time-to-live value.
// |callback| : Called when the configuration operation is done.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setMulticastTimeToLive(
long socketId,
long ttl,
@@ -343,6 +368,8 @@ namespace socket {
// |socketId| : The socketId.
// |enabled| : Indicate whether to enable loopback mode.
// |callback| : Called when the configuration operation is done.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setMulticastLoopbackMode(
long socketId,
boolean enabled,
@@ -351,6 +378,8 @@ namespace socket {
// Get the multicast group addresses the socket is currently joined to.
// |socketId| : The socketId.
// |callback| : Called with an array of strings of the result.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void getJoinedGroups(long socketId,
GetJoinedGroupsCallback callback);
@@ -358,6 +387,8 @@ namespace socket {
// |socketId| : The connected socket to use.
// |options| : Constraints and parameters for the TLS connection.
// |callback| : Called when the TLS connection attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void secure(long socketId,
optional SecureOptions options,
SecureCallback callback);
diff --git a/idl/extensions/sockets_tcp.idl b/idl/extensions/sockets_tcp.idl
index ca19f9c..9437ebc 100644
--- a/idl/extensions/sockets_tcp.idl
+++ b/idl/extensions/sockets_tcp.idl
@@ -5,7 +5,6 @@
// Use the chrome.sockets.tcp API to send and receive data over the
// network using TCP connections. This API supersedes the TCP functionality
// previously found in the chrome.socket API.
-[modernised_enums]
namespace sockets.tcp {
// The socket properties specified in the create or
// update function. Each property is optional. If a property
@@ -197,6 +196,8 @@ namespace sockets.tcp {
// |delay| : Set the delay seconds between the last data packet received
// and the first keepalive probe. Default is 0.
// |callback| : Called when the setKeepAlive attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setKeepAlive(long socketId,
boolean enable,
optional long delay,
@@ -207,6 +208,8 @@ namespace sockets.tcp {
// |socketId| : The socket identifier.
// |noDelay| : If true, disables Nagle's algorithm.
// |callback| : Called when the setNoDelay attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setNoDelay(long socketId,
boolean noDelay,
SetNoDelayCallback callback);
@@ -223,6 +226,8 @@ namespace sockets.tcp {
// |peerPort| : The port of the remote machine.
// |dnsQueryType| : The address resolution preference.
// |callback| : Called when the connect attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void connect(long socketId,
DOMString peerAddress,
long peerPort,
@@ -239,6 +244,8 @@ namespace sockets.tcp {
// |socketId| : The existing, connected socket to use.
// |options| : Constraints and parameters for the TLS connection.
// |callback| : Called when the connection attempt is complete.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void secure(long socketId,
optional SecureOptions options,
SecureCallback callback);
@@ -247,6 +254,8 @@ namespace sockets.tcp {
// |socketId| : The socket identifier.
// |data| : The data to send.
// |callback| : Called when the send operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void send(long socketId,
ArrayBuffer data,
SendCallback callback);
diff --git a/idl/extensions/sockets_tcp_server.idl b/idl/extensions/sockets_tcp_server.idl
index cbbde5d..5c3bf36 100644
--- a/idl/extensions/sockets_tcp_server.idl
+++ b/idl/extensions/sockets_tcp_server.idl
@@ -144,6 +144,8 @@ namespace sockets.tcpServer {
// depends on the Operating System (SOMAXCONN), which ensures a reasonable
// queue length for most applications.
// |callback| : Called when listen operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void listen(long socketId,
DOMString address,
long port,
diff --git a/idl/extensions/sockets_udp.idl b/idl/extensions/sockets_udp.idl
index f4b021b..2ba62f4 100644
--- a/idl/extensions/sockets_udp.idl
+++ b/idl/extensions/sockets_udp.idl
@@ -5,7 +5,6 @@
// Use the chrome.sockets.udp API to send and receive data over the
// network using UDP connections. This API supersedes the UDP functionality
// previously found in the "socket" API.
-[modernised_enums]
namespace sockets.udp {
// The socket properties specified in the create or
// update function. Each property is optional. If a property
@@ -200,6 +199,8 @@ namespace sockets.udp {
// available network interfaces.
// |port| : The port of the local machine. Use "0" to bind to a free port.
// |callback| : Called when the bind operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void bind(long socketId,
DOMString address,
long port,
@@ -213,6 +214,8 @@ namespace sockets.udp {
// |port| : The port of the remote machine.
// |dnsQueryType| : The address resolution preference.
// |callback| : Called when the send operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void send(long socketId,
ArrayBuffer data,
DOMString address,
@@ -244,6 +247,8 @@ namespace sockets.udp {
// |socketId| : The socket ID.
// |address| : The group address to join. Domain names are not supported.
// |callback| : Called when the joinGroup operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void joinGroup(long socketId,
DOMString address,
JoinGroupCallback callback);
@@ -260,6 +265,8 @@ namespace sockets.udp {
// |socketId| : The socket ID.
// |address| : The group address to leave. Domain names are not supported.
// |callback| : Called when the leaveGroup operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void leaveGroup(long socketId,
DOMString address,
LeaveGroupCallback callback);
@@ -271,6 +278,8 @@ namespace sockets.udp {
// |socketId| : The socket ID.
// |ttl| : The time-to-live value.
// |callback| : Called when the configuration operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setMulticastTimeToLive(
long socketId,
long ttl,
@@ -293,6 +302,8 @@ namespace sockets.udp {
// |socketId| : The socket ID.
// |enabled| : Indicate whether to enable loopback mode.
// |callback| : Called when the configuration operation completes.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setMulticastLoopbackMode(
long socketId,
boolean enabled,
@@ -309,6 +320,8 @@ namespace sockets.udp {
// |socketId| : The socket ID.
// |enabled| : true to enable broadcast packets,
// false to disable them.
+ [doesNotSupportPromises=
+ "Sets error along with callback arguments crbug.com/1504372"]
static void setBroadcast(long socketId,
boolean enabled,
SetBroadcastCallback callback);
diff --git a/idl/extensions/storage.json b/idl/extensions/storage.json
index 078e98a..8723ecc 100644
--- a/idl/extensions/storage.json
+++ b/idl/extensions/storage.json
@@ -7,14 +7,15 @@
"namespace": "storage",
"description": "Use the chrome.storage API to store, retrieve, and track changes to user data.",
"unprivileged": true,
- "compiler_options": {
- "modernised_enums": true
- },
"types": [
{
"id": "AccessLevel",
"type": "string",
- "enum": ["TRUSTED_CONTEXTS", "TRUSTED_AND_UNTRUSTED_CONTEXTS"],
+ "enum": [
+ {"name": "TRUSTED_CONTEXTS", "description": "Specifies contexts originating from the extension itself."},
+ {"name": "TRUSTED_AND_UNTRUSTED_CONTEXTS", "description": "Specifies contexts originating from outside the extension."}
+ //
+ ],
"description": "The storage area's access level."
},
{
@@ -96,7 +97,7 @@
"parameters": [
{
"name": "bytesInUse",
- "type": "integer",
+ "type": "number",
"description": "Amount of space being used in storage, in bytes."
}
]
diff --git a/idl/extensions/system_display.idl b/idl/extensions/system_display.idl
index 99331d0..66cc3c0 100644
--- a/idl/extensions/system_display.idl
+++ b/idl/extensions/system_display.idl
@@ -3,7 +3,6 @@
// found in the LICENSE file.
// Use the system.display API to query display metadata.
-[modernised_enums]
namespace system.display {
dictionary Bounds {
@@ -130,6 +129,14 @@ namespace system.display {
long yearOfManufacture;
};
+ // An enum to tell if the display is detected and used by the
+ // system. The display is considered 'inactive', if it is not
+ // detected by the system (maybe disconnected, or considered
+ // disconnected due to sleep mode, etc). This state is used to keep
+ // existing display when the all displays are disconnected, for
+ // example.
+ enum ActiveState { active, inactive };
+
dictionary DisplayUnitInfo {
// The unique identifier of the display.
DOMString id;
@@ -160,6 +167,9 @@ namespace system.display {
// True if this display is enabled.
boolean isEnabled;
+ // Active if the display is detected and used by the system.
+ ActiveState activeState;
+
// True for all displays when in unified desktop mode. See documentation
// for $(ref:enableUnifiedDesktop).
boolean isUnified;
@@ -283,14 +293,16 @@ namespace system.display {
// Mirror mode, i.e. different ways of how a display is mirrored to other
// displays.
enum MirrorMode {
- // Use the default mode (extended or unified desktop).
+ // Specifies the default mode (extended or unified desktop).
off,
- // The default source display will be mirrored to all other displays.
+ // Specifies that the default source display will be mirrored to all other
+ // displays.
normal,
- // The specified source display will be mirrored to the provided
- // destination displays. All other connected displays will be extended.
+ // Specifies that the specified source display will be mirrored to the
+ // provided destination displays. All other connected displays will be
+ // extended.
mixed
};
diff --git a/idl/extensions/system_storage.idl b/idl/extensions/system_storage.idl
index 5f29301..8195745 100644
--- a/idl/extensions/system_storage.idl
+++ b/idl/extensions/system_storage.idl
@@ -5,7 +5,6 @@
// Use the chrome.system.storage API to query storage device
// information and be notified when a removable storage device is attached and
// detached.
-[modernised_enums]
namespace system.storage {
enum StorageUnitType {
diff --git a/idl/extensions/test.json b/idl/extensions/test.json
index 6901b97..58c3c3b 100644
--- a/idl/extensions/test.json
+++ b/idl/extensions/test.json
@@ -116,6 +116,14 @@
{"type": "string", "name": "message"}
]
},
+ {
+ "name": "openFileUrl",
+ "type": "function",
+ "description": "Open file: URLs for tests.",
+ "parameters": [
+ {"type": "string", "name": "url"}
+ ]
+ },
{
"name": "sendMessage",
"type": "function",
diff --git a/idl/extensions/types.json b/idl/extensions/types.json
new file mode 100644
index 0000000..b43c29b
--- /dev/null
+++ b/idl/extensions/types.json
@@ -0,0 +1,161 @@
+// Copyright 2012 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ {
+ "namespace": "types",
+ "description": "The chrome.types API contains type declarations for Chrome.",
+ "types": [
+ {
+ "id": "ChromeSettingScope",
+ "type": "string",
+ "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"],
+ "description": "The scope of the ChromeSetting. One of
regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere),
regular_only: setting for the regular profile only (not inherited by the incognito profile),
incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
not_controllable: cannot be controlled by any extension
controlled_by_other_extensions: controlled by extensions with higher precedence
controllable_by_this_extension: can be controlled by this extension
controlled_by_this_extension: controlled by this extension
"
+ },
+ {
+ "id": "ChromeSetting",
+ "type": "object",
+ "js_module": "ChromeSetting",
+ "customBindings": "ChromeSetting",
+ "description": "An interface that allows access to a Chrome browser setting. See $(ref:accessibilityFeatures) for an example.",
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "nocompile": true,
+ "description": "Gets the value of a setting.",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to consider.",
+ "properties": {
+ "incognito": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether to return the value that applies to the incognito session (default false)."
+ }
+ }
+ }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Details of the currently effective value.",
+ "properties": {
+ "value": {
+ "description": "The value of the setting.",
+ "type": "any"
+ },
+ "levelOfControl": {
+ "$ref": "LevelOfControl",
+ "description": "The level of control of the setting."
+ },
+ "incognitoSpecific": {
+ "description": "Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true.",
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ },
+ {
+ "name": "set",
+ "type": "function",
+ "nocompile": true,
+ "description": "Sets the value of a setting.",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to change.",
+ "properties": {
+ "value": {
+ "description": "The value of the setting. Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type.",
+ "type": "any"
+ },
+ "scope": {
+ "$ref": "ChromeSettingScope",
+ "optional": true,
+ "description": "Where to set the setting (default: regular)."
+ }
+ }
+ }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "description": "Called at the completion of the set operation.",
+ "optional": true,
+ "parameters": []
+ }
+ },
+ {
+ "name": "clear",
+ "type": "function",
+ "nocompile": true,
+ "description": "Clears the setting, restoring any default value.",
+ "parameters": [
+ {
+ "name": "details",
+ "type": "object",
+ "description": "Which setting to clear.",
+ "properties": {
+ "scope": {
+ "$ref": "ChromeSettingScope",
+ "optional": true,
+ "description": "Where to clear the setting (default: regular)."
+ }
+ }
+ }
+ ],
+ "returns_async": {
+ "name": "callback",
+ "description": "Called at the completion of the clear operation.",
+ "optional": true,
+ "parameters": []
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onChange",
+ "description": "Fired after the setting changes.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "details",
+ "properties": {
+ "value": {
+ "description": "The value of the setting after the change.",
+ "type": "any"
+ },
+ "levelOfControl": {
+ "$ref": "LevelOfControl",
+ "description": "The level of control of the setting."
+ },
+ "incognitoSpecific": {
+ "description": "Whether the value that has changed is specific to the incognito session. This property will only be present if the user has enabled the extension in incognito mode.",
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/idl/extensions/usb.idl b/idl/extensions/usb.idl
index 9ef518d..6ecc2cb 100644
--- a/idl/extensions/usb.idl
+++ b/idl/extensions/usb.idl
@@ -9,7 +9,6 @@
// Errors generated by this API are reported by setting
// $(ref:runtime.lastError) and executing the function's regular callback. The
// callback's regular parameters will be undefined in this case.
-[modernised_enums]
namespace usb {
// Direction, Recipient, RequestType, and TransferType all map to their
diff --git a/idl/extensions/user_scripts.idl b/idl/extensions/user_scripts.idl
new file mode 100644
index 0000000..62a90aa
--- /dev/null
+++ b/idl/extensions/user_scripts.idl
@@ -0,0 +1,144 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Use the userScripts API to execute user scripts in the User
+// Scripts context.
+namespace userScripts {
+ // The JavaScript world for a user script to execute within.
+ enum ExecutionWorld {
+ // Specifies the execution environment of the DOM, which is the execution
+ // environment shared with the host page's JavaScript.
+ MAIN,
+ // Specifies the execution enviroment that is specific to user scripts and
+ // is exempt from the page's CSP.
+ USER_SCRIPT
+ };
+
+ // The source of the script to inject.
+ dictionary ScriptSource {
+ // A string containing the JavaScript code to inject. Exactly one of
+ // file or code must be specified.
+ DOMString? code;
+ // The path of the JavaScript file to inject relative to the extension's
+ // root directory. Exactly one of file or code
+ // must be specified.
+ DOMString? file;
+ };
+
+ // Describes a user script to be injected into a web page registered through
+ // this API. The script is injected into a page if its URL matches any of
+ // "matches" or "include_globs" patterns, and the URL doesn't match
+ // "exclude_matches" and "exclude_globs" patterns.
+ dictionary RegisteredUserScript {
+ // If true, it will inject into all frames, even if the frame is not the
+ // top-most frame in the tab. Each frame is checked independently for URL
+ // requirements; it will not inject into child frames if the URL
+ // requirements are not met. Defaults to false, meaning that only the top
+ // frame is matched.
+ boolean? allFrames;
+ // Excludes pages that this user script would otherwise be injected into.
+ // See Match Patterns for more details on
+ // the syntax of these strings.
+ DOMString[]? excludeMatches;
+ // The ID of the user script specified in the API call. This property must
+ // not start with a '_' as it's reserved as a prefix for generated script
+ // IDs.
+ DOMString id;
+ // Specifies wildcard patterns for pages this user script will be injected
+ // into.
+ DOMString[]? includeGlobs;
+ // Specifies wildcard patterns for pages this user script will NOT be
+ // injected into.
+ DOMString[]? excludeGlobs;
+ // The list of ScriptSource objects defining sources of scripts to be
+ // injected into matching pages.
+ ScriptSource[] js;
+ // Specifies which pages this user script will be injected into. See
+ // Match Patterns for more details on the
+ // syntax of these strings. This property must be specified for
+ // ${ref:register}.
+ DOMString[]? matches;
+ // Specifies when JavaScript files are injected into the web page. The
+ // preferred and default value is document_idle.
+ extensionTypes.RunAt? runAt;
+ // The JavaScript execution environment to run the script in. The default is
+ // `USER_SCRIPT`.
+ ExecutionWorld? world;
+ };
+
+ // An object used to filter user scripts for ${ref:getScripts}.
+ dictionary UserScriptFilter {
+ // $(ref:getScripts) only returns scripts with the IDs specified in this
+ // list.
+ DOMString[]? ids;
+ };
+
+ // An object used to update the `USER_SCRIPT` world
+ // configuration. If a propertie is not specified, it will reset it to its
+ // default value.
+ dictionary WorldProperties{
+ // Specifies the world csp. The default is the `ISOLATED`
+ // world csp.
+ DOMString? csp;
+ // Specifies whether messaging APIs are exposed. The default is
+ // false.
+ boolean? messaging;
+ };
+
+ callback RegisterCallback = void();
+
+ callback GetScriptsCallback = void(RegisteredUserScript[] scripts);
+
+ callback UnregisterCallback = void();
+
+ callback UpdateCallback = void();
+
+ callback ConfigureWorldCallback = void();
+
+ interface Functions {
+ // Registers one or more user scripts for this extension.
+ // |scripts|: Contains a list of user scripts to be registered.
+ // |callback|: Called once scripts have been fully registered or if an error
+ // has ocurred.
+ [supportsPromises] static void register(RegisteredUserScript[] scripts,
+ optional RegisterCallback callback);
+
+ // Returns all dynamically-registered user scripts for this extension.
+ // |filter|: If specified, this method returns only the user scripts that
+ // match it.
+ // |callback|: Called once scripts have been fully registered or if an error
+ // occurs.
+ [supportsPromises] static void getScripts(
+ optional UserScriptFilter filter,
+ GetScriptsCallback callback);
+
+ // Unregisters all dynamically-registered user scripts for this extension.
+ // |filter|: If specified, this method unregisters only the user scripts
+ // that match it.
+ // |callback|: Called once scripts have been fully unregistered or if an
+ // error ocurs
+ [supportsPromises] static void unregister(
+ optional UserScriptFilter filter,
+ UnregisterCallback callback);
+
+ // Updates one or more user scripts for this extension.
+ // |scripts|: Contains a list of user scripts to be updated. A property is
+ // only updated for the existing script if it is specified in this object.
+ // If there are errors during script parsing/file validation, or if the IDs
+ // specified do not correspond to a fully registered script, then no scripts
+ // are updated.
+ // |callback|: Called once scripts have been fully updated or if an error
+ // occurs.
+ [supportsPromises] static void update(
+ RegisteredUserScript[] scripts,
+ optional UpdateCallback callback);
+
+ // Configures the `USER_SCRIPT` execution environment.
+ // |properties|: Contains the user script world configuration.
+ // |callback|: Called once world hase been configured.
+ [supportsPromises] static void configureWorld(
+ WorldProperties properties,
+ optional ConfigureWorldCallback callback);
+ };
+};
\ No newline at end of file
diff --git a/idl/extensions/virtual_keyboard_private.json b/idl/extensions/virtual_keyboard_private.json
index 9b59829..7d9e9c0 100644
--- a/idl/extensions/virtual_keyboard_private.json
+++ b/idl/extensions/virtual_keyboard_private.json
@@ -6,7 +6,6 @@
{
"namespace": "virtualKeyboardPrivate",
"compiler_options": {
- "modernised_enums": true,
"implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h"
},
"platforms": ["chromeos"],
diff --git a/idl/extensions/web_accessible_resources.idl b/idl/extensions/web_accessible_resources.idl
index 8cca3a1..7f45226 100644
--- a/idl/extensions/web_accessible_resources.idl
+++ b/idl/extensions/web_accessible_resources.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Stub namepsace for the "web_accessible_resources" manifest key.
+// Stub namespace for the "web_accessible_resources" manifest key.
[generate_error_messages] namespace webAccessibleResources {
dictionary WebAccessibleResource {
// Relative paths within the extension package representing web accessible
@@ -10,8 +10,8 @@
DOMString[] resources;
// List of match
- // patterns to which "resources" are accessible. These patterns should
+ // href="https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns">
+ // match patterns to which "resources" are accessible. These patterns should
// have an effective path of "*". Each match will be checked against the
// initiating origin.
DOMString[]? matches;
diff --git a/idl/extensions/web_accessible_resources_mv2.idl b/idl/extensions/web_accessible_resources_mv2.idl
index bb5ba13..1ed7a15 100644
--- a/idl/extensions/web_accessible_resources_mv2.idl
+++ b/idl/extensions/web_accessible_resources_mv2.idl
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Stub namepsace for the "web_accessible_resources" manifest key.
+// Stub namespace for the "web_accessible_resources" manifest key.
[generate_error_messages] namespace webAccessibleResourcesMv2 {
dictionary ManifestKeys {
// Relative paths within the extension package representing web accessible
diff --git a/idl/extensions/web_request.json b/idl/extensions/web_request.json
index 78923a7..2e8a260 100644
--- a/idl/extensions/web_request.json
+++ b/idl/extensions/web_request.json
@@ -6,9 +6,6 @@
{
"namespace": "webRequest",
"description": "Use the chrome.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight.",
- "compiler_options": {
- "modernised_enums": true
- },
"properties": {
"MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": {
"value": 20,
@@ -19,52 +16,101 @@
{
"id": "ResourceType",
"type": "string",
- "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "webbundle", "other"]
+ "enum": [
+ {"name": "main_frame", "description": "Specifies the resource as the main frame."},
+ {"name": "sub_frame", "description": "Specifies the resource as a sub frame."},
+ {"name": "stylesheet", "description": "Specifies the resource as a stylesheet."},
+ {"name": "script", "description": "Specifies the resource as a script."},
+ {"name": "image", "description": "Specifies the resource as an image."},
+ {"name": "font", "description": "Specifies the resource as a font."},
+ {"name": "object", "description": "Specifies the resource as an object."},
+ {"name": "xmlhttprequest",
+ "description": "Specifies the resource as an XMLHttpRequest."},
+ {"name": "ping",
+ "description": "Specifies the resource as a ping."},
+ {"name": "csp_report",
+ "description": "Specifies the resource as a Content Security Policy (CSP) report."},
+ {"name": "media", "description": "Specifies the resource as a media object."},
+ {"name": "websocket", "description": "Specifies the resource as a WebSocket."},
+ {"name": "webbundle", "description": "Specifies the resource as a WebBundle."},
+ {"name": "other", "description": "Specifies the resource as a type not included in the listed types."}
+ ]
},
{
"id": "OnBeforeRequestOptions",
"type": "string",
- "enum": ["blocking", "requestBody", "extraHeaders"]
+ "enum": [
+ {"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},
+ {"name": "requestBody", "description": "Specifies that the request body should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnBeforeSendHeadersOptions",
"type": "string",
- "enum": ["requestHeaders", "blocking", "extraHeaders"]
+ "enum": [
+ {"name": "requestHeaders", "description": "Specifies that the request header should be included in the event."},
+ {"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnSendHeadersOptions",
"type": "string",
- "enum": ["requestHeaders", "extraHeaders"]
+ "enum": [
+ {"name": "requestHeaders", "description": "Specifies that the request header should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnHeadersReceivedOptions",
"type": "string",
- "enum": ["blocking", "responseHeaders", "extraHeaders"]
+ "enum": [
+ {"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},
+ {"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnAuthRequiredOptions",
"type": "string",
- "enum": ["responseHeaders", "blocking", "asyncBlocking", "extraHeaders"]
+ "enum": [
+ {"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},
+ {"name": "blocking", "description": "Specifies the request is blocked until the callback function returns."},
+ {"name": "asyncBlocking", "description": "Specifies that the callback function is handled asynchronously."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnResponseStartedOptions",
"type": "string",
- "enum": ["responseHeaders", "extraHeaders"]
+ "enum": [
+ {"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnBeforeRedirectOptions",
"type": "string",
- "enum": ["responseHeaders", "extraHeaders"]
+ "enum": [
+ {"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnCompletedOptions",
"type": "string",
- "enum": ["responseHeaders", "extraHeaders"]
+ "enum": [
+ {"name": "responseHeaders", "description": "Specifies that the response headers should be included in the event."},
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "OnErrorOccurredOptions",
"type": "string",
- "enum": ["extraHeaders"]
+ "enum": [
+ {"name": "extraHeaders", "description": "Specifies that headers can violate Cross-Origin Resource Sharing (CORS)."}
+ ]
},
{
"id": "RequestFilter",
diff --git a/idl/extensions/web_view_internal.json b/idl/extensions/web_view_internal.json
index a894018..6baa6d7 100644
--- a/idl/extensions/web_view_internal.json
+++ b/idl/extensions/web_view_internal.json
@@ -7,7 +7,6 @@
"namespace": "webViewInternal",
"description": "none",
"compiler_options": {
- "modernised_enums": true,
"implemented_in": "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
},
"properties": {
diff --git a/idl/extensions/webcam_private.idl b/idl/extensions/webcam_private.idl
index e4bdfa5..f24f112 100644
--- a/idl/extensions/webcam_private.idl
+++ b/idl/extensions/webcam_private.idl
@@ -3,7 +3,6 @@
// found in the LICENSE file.
// Webcam Private API.
-[modernised_enums]
namespace webcamPrivate {
enum PanDirection { stop, right, left };
enum TiltDirection { stop, up, down };
diff --git a/lib/action.dart b/lib/action.dart
index b8fabdd..c7ccf61 100644
--- a/lib/action.dart
+++ b/lib/action.dart
@@ -67,7 +67,7 @@ class ChromeAction {
/// non-tab-specific badge text is returned. If
/// [displayActionCountAsBadgeText](declarativeNetRequest#setExtensionActionOptions)
/// is enabled, a placeholder text will be returned unless the
- /// [declarativeNetRequestFeedback](declare_permissions#declarativeNetRequestFeedback)
+ /// [declarativeNetRequestFeedback](/docs/extensions/develop/concepts/declare-permissions#declarativeNetRequestFeedback)
/// permission is present or tab-specific badge text was provided.
Future getBadgeText(TabDetails details) async {
var $res = await promiseToFuture(
diff --git a/lib/alarms.dart b/lib/alarms.dart
index f1a9cd1..541df55 100644
--- a/lib/alarms.dart
+++ b/lib/alarms.dart
@@ -27,12 +27,12 @@ class ChromeAlarms {
/// replaced by this alarm.
///
/// In order to reduce the load on the user's machine, Chrome limits alarms
- /// to at most once every 1 minute but may delay them an arbitrary amount
+ /// to at most once every 30 seconds but may delay them an arbitrary amount
/// more. That is, setting `delayInMinutes` or
- /// `periodInMinutes` to less than `1` will not be
+ /// `periodInMinutes` to less than `0.5` will not be
/// honored and will cause a warning. `when` can be set to less
- /// than 1 minute after "now" without warning but won't actually cause the
- /// alarm to fire for at least 1 minute.
+ /// than 30 seconds after "now" without warning but won't actually cause the
+ /// alarm to fire for at least 30 seconds.
///
/// To help you debug your app or extension, when you've loaded it unpacked,
/// there's no limit to how often the alarm can fire.
diff --git a/lib/browser_action.dart b/lib/browser_action.dart
index a6e7b3b..5d86e48 100644
--- a/lib/browser_action.dart
+++ b/lib/browser_action.dart
@@ -16,7 +16,7 @@ extension ChromeBrowserActionExtension on Chrome {
/// Use browser actions to put icons in the main Google Chrome toolbar, to the
/// right of the address bar. In addition to its [icon](browserAction#icon), a
/// browser action can have a [tooltip](browserAction#tooltip), a
- /// [badge](browserAction#badge), and a [popup](browserAction#popups).
+ /// [badge](browserAction#badge), and a [popup](browserAction#popup).
ChromeBrowserAction get browserAction => _browserAction;
}
diff --git a/lib/certificate_provider.dart b/lib/certificate_provider.dart
index 042d345..fbde10a 100644
--- a/lib/certificate_provider.dart
+++ b/lib/certificate_provider.dart
@@ -142,35 +142,40 @@ class ChromeCertificateProvider {
/// Types of supported cryptographic signature algorithms.
enum Algorithm {
- /// RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1 hashing. The
- /// extension must not prepend a DigestInfo prefix but only add PKCS#1
- /// padding. This algorithm is deprecated and will never be requested by
- /// Chrome as of version 109.
+ /// Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1
+ /// hashing. The extension must not prepend a DigestInfo prefix but only
+ /// add PKCS#1 padding. This algorithm is deprecated and will never be
+ /// requested
+ /// by Chrome as of version 109.
rsassaPkcs1V15Md5Sha1('RSASSA_PKCS1_v1_5_MD5_SHA1'),
- /// RSASSA PKCS#1 v1.5 signature algorithm with the SHA-1 hash function.
+ /// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ /// with the SHA-1 hash function.
rsassaPkcs1V15Sha1('RSASSA_PKCS1_v1_5_SHA1'),
- /// RSASSA PKCS#1 v1.5 signature algorithm with the SHA-256 hashing function.
+ /// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ /// with the SHA-256 hashing function.
rsassaPkcs1V15Sha256('RSASSA_PKCS1_v1_5_SHA256'),
- /// RSASSA PKCS#1 v1.5 signature algorithm with the SHA-384 hashing function.
+ /// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ /// with the SHA-384 hashing function.
rsassaPkcs1V15Sha384('RSASSA_PKCS1_v1_5_SHA384'),
- /// RSASSA PKCS#1 v1.5 signature algorithm with the SHA-512 hashing function.
+ /// Specifies the RSASSA PKCS#1 v1.5 signature algorithm
+ /// with the SHA-512 hashing function.
rsassaPkcs1V15Sha512('RSASSA_PKCS1_v1_5_SHA512'),
- /// Since Chrome 89. RSASSA PSS signature algorithm with the SHA-256 hashing
+ /// Specifies the RSASSA PSS signature algorithm with the SHA-256 hashing
/// function, MGF1 mask generation function and the salt of the same size as
/// the hash.
rsassaPssSha256('RSASSA_PSS_SHA256'),
- /// Since Chrome 89. RSASSA PSS signature algorithm with the SHA-384 hashing
+ /// Specifies the RSASSA PSS signature algorithm with the SHA-384 hashing
/// function, MGF1 mask generation function and the salt of the same size as
/// the hash.
rsassaPssSha384('RSASSA_PSS_SHA384'),
- /// Since Chrome 89. RSASSA PSS signature algorithm with the SHA-512 hashing
+ /// Specifies the RSASSA PSS signature algorithm with the SHA-512 hashing
/// function, MGF1 mask generation function and the salt of the same size as
/// the hash.
rsassaPssSha512('RSASSA_PSS_SHA512');
@@ -186,8 +191,8 @@ enum Algorithm {
/// Types of errors that the extension can report.
enum Error {
- /// General error that cannot be represented by other more specific error
- /// codes.
+ /// General error that cannot be represented by other more specific
+ /// error codes.
generalError('GENERAL_ERROR');
const Error(this.value);
@@ -201,10 +206,19 @@ enum Error {
/// Deprecated. Replaced by [Algorithm].
enum Hash {
+ /// Specifies the MD5 and SHA1 hashing algorithms.
md5Sha1('MD5_SHA1'),
+
+ /// Specifies the SHA1 hashing algorithm.
sha1('SHA1'),
+
+ /// Specifies the SHA256 hashing algorithm.
sha256('SHA256'),
+
+ /// Specifies the SHA384 hashing algorithm.
sha384('SHA384'),
+
+ /// Specifies the SHA512 hashing algorithm.
sha512('SHA512');
const Hash(this.value);
@@ -218,7 +232,10 @@ enum Hash {
/// The type of code being requested by the extension with requestPin function.
enum PinRequestType {
+ /// Specifies the requested code is a PIN.
pin('PIN'),
+
+ /// Specifies the requested code is a PUK.
puk('PUK');
const PinRequestType(this.value);
@@ -233,9 +250,16 @@ enum PinRequestType {
/// The types of errors that can be presented to the user through the
/// requestPin function.
enum PinRequestErrorType {
+ /// Specifies the PIN is invalid.
invalidPin('INVALID_PIN'),
+
+ /// Specifies the PUK is invalid.
invalidPuk('INVALID_PUK'),
+
+ /// Specifies the maximum attempt number has been exceeded.
maxAttemptsExceeded('MAX_ATTEMPTS_EXCEEDED'),
+
+ /// Specifies that the error cannot be represented by the above types.
unknownError('UNKNOWN_ERROR');
const PinRequestErrorType(this.value);
diff --git a/lib/commands.dart b/lib/commands.dart
index e9d4eda..016400d 100644
--- a/lib/commands.dart
+++ b/lib/commands.dart
@@ -25,7 +25,8 @@ class ChromeCommands {
bool get isAvailable => $js.chrome.commandsNullable != null && alwaysTrue;
/// Returns all the registered extension commands for this extension and their
- /// shortcut (if active).
+ /// shortcut (if active). Before Chrome 110, this command did not return
+ /// `_execute_action`.
/// [returns] Called to return the registered commands.
Future> getAll() async {
var $res = await promiseToFuture($js.chrome.commands.getAll());
diff --git a/lib/content_settings.dart b/lib/content_settings.dart
index e0c7998..cb5df25 100644
--- a/lib/content_settings.dart
+++ b/lib/content_settings.dart
@@ -122,6 +122,20 @@ class ChromeContentSettings {
ContentSetting get microphone =>
ContentSetting.fromJS($js.chrome.contentSettings.microphone);
+ /// Whether to allow sites to access the clipboard via advanced capabilities
+ /// of the Async Clipboard API. "Advanced" capabilities include anything
+ /// besides writing built-in formats after a user gesture, i.e. the ability to
+ /// read, the ability to write custom formats, and the ability to write
+ /// without a user gesture. One of
+ /// [allow]: Allow sites to use advanced clipboard capabilities,
+ /// [block]: Don't allow sites to use advanced clipboard capabilties,
+ /// [ask]: Ask when a site wants to use advanced clipboard capabilities.
+ /// Default is [ask].
+ /// The primary URL is the URL of the document which requested clipboard
+ /// access. The secondary URL is not used.
+ ContentSetting get clipboard =>
+ ContentSetting.fromJS($js.chrome.contentSettings.clipboard);
+
/// Whether to allow sites to access the camera. One of
/// [allow]: Allow sites to access the camera,
/// [block]: Don't allow sites to access the camera,
@@ -184,6 +198,20 @@ enum AutoVerifyContentSetting {
values.firstWhere((e) => e.value == value);
}
+enum ClipboardContentSetting {
+ allow('allow'),
+ block('block'),
+ ask('ask');
+
+ const ClipboardContentSetting(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static ClipboardContentSetting fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
enum CookiesContentSetting {
allow('allow'),
block('block'),
diff --git a/lib/context_menus.dart b/lib/context_menus.dart
index c9b8f96..1e28cf6 100644
--- a/lib/context_menus.dart
+++ b/lib/context_menus.dart
@@ -386,9 +386,9 @@ class CreateProperties {
/// Whether the item is visible in the menu.
bool? visible,
- /// A function that is called back when the menu item is clicked. Event
- /// pages cannot use this; instead, they should register a listener for
- /// [contextMenus.onClicked].
+ /// A function that is called back when the menu item is clicked. This is
+ /// not available inside of a service worker; instead, they should register
+ /// a listener for [contextMenus.onClicked].
JSFunction? onclick,
/// The ID of a parent menu item; this makes the item a child of a
@@ -397,7 +397,7 @@ class CreateProperties {
/// Restricts the item to apply only to documents or frames whose URL
/// matches one of the given patterns. For details on pattern formats, see
- /// [Match Patterns](match_patterns).
+ /// [Match Patterns](/docs/extensions/develop/concepts/match-patterns).
List? documentUrlPatterns,
/// Similar to `documentUrlPatterns`, filters based on the `src` attribute
@@ -484,9 +484,9 @@ class CreateProperties {
_wrapped.visible = v;
}
- /// A function that is called back when the menu item is clicked. Event pages
- /// cannot use this; instead, they should register a listener for
- /// [contextMenus.onClicked].
+ /// A function that is called back when the menu item is clicked. This is not
+ /// available inside of a service worker; instead, they should register a
+ /// listener for [contextMenus.onClicked].
JSFunction? get onclick => _wrapped.onclick;
set onclick(JSFunction? v) {
@@ -512,7 +512,7 @@ class CreateProperties {
/// Restricts the item to apply only to documents or frames whose URL matches
/// one of the given patterns. For details on pattern formats, see [Match
- /// Patterns](match_patterns).
+ /// Patterns](/docs/extensions/develop/concepts/match-patterns).
List? get documentUrlPatterns => _wrapped.documentUrlPatterns?.toDart
.cast()
.map((e) => e)
diff --git a/lib/cookies.dart b/lib/cookies.dart
index 0ae432a..bb04a8b 100644
--- a/lib/cookies.dart
+++ b/lib/cookies.dart
@@ -32,9 +32,10 @@ class ChromeCookies {
}
/// Retrieves all cookies from a single cookie store that match the given
- /// information. The cookies returned will be sorted, with those with the
- /// longest path first. If multiple cookies have the same path length, those
- /// with the earliest creation time will be first.
+ /// information. The cookies returned will be sorted, with those with the
+ /// longest path first. If multiple cookies have the same path length, those
+ /// with the earliest creation time will be first. This method only retrieves
+ /// cookies for domains that the extension has host permissions to.
/// [details] Information to filter the cookies being retrieved.
Future> getAll(GetAllDetails details) async {
var $res =
@@ -125,6 +126,27 @@ enum OnChangedCause {
values.firstWhere((e) => e.value == value);
}
+class CookiePartitionKey {
+ CookiePartitionKey.fromJS(this._wrapped);
+
+ CookiePartitionKey(
+ {
+ /// The top-level site the partitioned cookie is available in.
+ String? topLevelSite})
+ : _wrapped = $js.CookiePartitionKey(topLevelSite: topLevelSite);
+
+ final $js.CookiePartitionKey _wrapped;
+
+ $js.CookiePartitionKey get toJS => _wrapped;
+
+ /// The top-level site the partitioned cookie is available in.
+ String? get topLevelSite => _wrapped.topLevelSite;
+
+ set topLevelSite(String? v) {
+ _wrapped.topLevelSite = v;
+ }
+}
+
class Cookie {
Cookie.fromJS(this._wrapped);
@@ -168,6 +190,10 @@ class Cookie {
/// The ID of the cookie store containing this cookie, as provided in
/// getAllCookieStores().
required String storeId,
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? partitionKey,
}) : _wrapped = $js.Cookie(
name: name,
value: value,
@@ -180,6 +206,7 @@ class Cookie {
session: session,
expirationDate: expirationDate,
storeId: storeId,
+ partitionKey: partitionKey?.toJS,
);
final $js.Cookie _wrapped;
@@ -269,6 +296,15 @@ class Cookie {
set storeId(String v) {
_wrapped.storeId = v;
}
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? get partitionKey =>
+ _wrapped.partitionKey?.let(CookiePartitionKey.fromJS);
+
+ set partitionKey(CookiePartitionKey? v) {
+ _wrapped.partitionKey = v?.toJS;
+ }
}
class CookieStore {
@@ -321,10 +357,15 @@ class CookieDetails {
/// The ID of the cookie store in which to look for the cookie. By default,
/// the current execution context's cookie store will be used.
String? storeId,
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? partitionKey,
}) : _wrapped = $js.CookieDetails(
url: url,
name: name,
storeId: storeId,
+ partitionKey: partitionKey?.toJS,
);
final $js.CookieDetails _wrapped;
@@ -355,6 +396,15 @@ class CookieDetails {
set storeId(String? v) {
_wrapped.storeId = v;
}
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? get partitionKey =>
+ _wrapped.partitionKey?.let(CookiePartitionKey.fromJS);
+
+ set partitionKey(CookiePartitionKey? v) {
+ _wrapped.partitionKey = v?.toJS;
+ }
}
class OnChangedChangeInfo {
@@ -428,6 +478,10 @@ class GetAllDetails {
/// The cookie store to retrieve cookies from. If omitted, the current
/// execution context's cookie store will be used.
String? storeId,
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? partitionKey,
}) : _wrapped = $js.GetAllDetails(
url: url,
name: name,
@@ -436,6 +490,7 @@ class GetAllDetails {
secure: secure,
session: session,
storeId: storeId,
+ partitionKey: partitionKey?.toJS,
);
final $js.GetAllDetails _wrapped;
@@ -493,6 +548,15 @@ class GetAllDetails {
set storeId(String? v) {
_wrapped.storeId = v;
}
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? get partitionKey =>
+ _wrapped.partitionKey?.let(CookiePartitionKey.fromJS);
+
+ set partitionKey(CookiePartitionKey? v) {
+ _wrapped.partitionKey = v?.toJS;
+ }
}
class SetDetails {
@@ -536,6 +600,10 @@ class SetDetails {
/// The ID of the cookie store in which to set the cookie. By default, the
/// cookie is set in the current execution context's cookie store.
String? storeId,
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? partitionKey,
}) : _wrapped = $js.SetDetails(
url: url,
name: name,
@@ -547,6 +615,7 @@ class SetDetails {
sameSite: sameSite?.toJS,
expirationDate: expirationDate,
storeId: storeId,
+ partitionKey: partitionKey?.toJS,
);
final $js.SetDetails _wrapped;
@@ -629,6 +698,15 @@ class SetDetails {
set storeId(String? v) {
_wrapped.storeId = v;
}
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? get partitionKey =>
+ _wrapped.partitionKey?.let(CookiePartitionKey.fromJS);
+
+ set partitionKey(CookiePartitionKey? v) {
+ _wrapped.partitionKey = v?.toJS;
+ }
}
class RemoveCallbackDetails {
@@ -643,10 +721,15 @@ class RemoveCallbackDetails {
/// The ID of the cookie store from which the cookie was removed.
required String storeId,
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? partitionKey,
}) : _wrapped = $js.RemoveCallbackDetails(
url: url,
name: name,
storeId: storeId,
+ partitionKey: partitionKey?.toJS,
);
final $js.RemoveCallbackDetails _wrapped;
@@ -673,4 +756,13 @@ class RemoveCallbackDetails {
set storeId(String v) {
_wrapped.storeId = v;
}
+
+ /// The partition key for reading or modifying cookies with the Partitioned
+ /// attribute.
+ CookiePartitionKey? get partitionKey =>
+ _wrapped.partitionKey?.let(CookiePartitionKey.fromJS);
+
+ set partitionKey(CookiePartitionKey? v) {
+ _wrapped.partitionKey = v?.toJS;
+ }
}
diff --git a/lib/declarative_content.dart b/lib/declarative_content.dart
index fcc5453..93b0315 100644
--- a/lib/declarative_content.dart
+++ b/lib/declarative_content.dart
@@ -111,7 +111,8 @@ class PageStateMatcher {
List? css,
/// Matches if the bookmarked state of the page is equal to the specified
- /// value. Requres the [bookmarks permission](declare_permissions).
+ /// value. Requres the [bookmarks
+ /// permission](/docs/extensions/develop/concepts/declare-permissions).
bool? isBookmarked,
required PageStateMatcherInstanceType instanceType,
}) : _wrapped = $js.PageStateMatcher(
@@ -147,7 +148,8 @@ class PageStateMatcher {
}
/// Matches if the bookmarked state of the page is equal to the specified
- /// value. Requres the [bookmarks permission](declare_permissions).
+ /// value. Requres the [bookmarks
+ /// permission](/docs/extensions/develop/concepts/declare-permissions).
bool? get isBookmarked => _wrapped.isBookmarked;
set isBookmarked(bool? v) {
diff --git a/lib/declarative_net_request.dart b/lib/declarative_net_request.dart
index 81968aa..5f8e3ca 100644
--- a/lib/declarative_net_request.dart
+++ b/lib/declarative_net_request.dart
@@ -212,15 +212,28 @@ class ChromeDeclarativeNetRequest {
int get guaranteedMinimumStaticRules =>
$js.chrome.declarativeNetRequest.GUARANTEED_MINIMUM_STATIC_RULES;
- /// The maximum number of dynamic rules that an extension can add.
- int get maxNumberOfDynamicRules =>
- $js.chrome.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_RULES;
-
/// The maximum number of combined dynamic and session scoped rules an
/// extension can add.
int get maxNumberOfDynamicAndSessionRules =>
$js.chrome.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES;
+ /// The maximum number of dynamic rules that an extension can add.
+ int get maxNumberOfDynamicRules =>
+ $js.chrome.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_RULES;
+
+ /// The maximum number of "unsafe" dynamic rules that an extension can add.
+ int get maxNumberOfUnsafeDynamicRules =>
+ $js.chrome.declarativeNetRequest.MAX_NUMBER_OF_UNSAFE_DYNAMIC_RULES;
+
+ /// The maximum number of session scoped rules that an extension can add.
+ int get maxNumberOfSessionRules =>
+ $js.chrome.declarativeNetRequest.MAX_NUMBER_OF_SESSION_RULES;
+
+ /// The maximum number of "unsafe" session scoped rules that an extension can
+ /// add.
+ int get maxNumberOfUnsafeSessionRules =>
+ $js.chrome.declarativeNetRequest.MAX_NUMBER_OF_UNSAFE_SESSION_RULES;
+
/// Time interval within which `MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL
/// getMatchedRules` calls can be made, specified in minutes.
/// Additional calls will fail immediately and set [runtime.lastError].
@@ -715,6 +728,57 @@ class Redirect {
}
}
+class HeaderInfo {
+ HeaderInfo.fromJS(this._wrapped);
+
+ HeaderInfo({
+ /// The name of the header.
+ required String header,
+
+ /// If specified, match this rule if the header's value contains at least
+ /// one
+ /// element in this list.
+ List? values,
+
+ /// If specified, the rule is not matched if the header exists but its value
+ /// contains at least one element in this list.
+ List? excludedValues,
+ }) : _wrapped = $js.HeaderInfo(
+ header: header,
+ values: values?.toJSArray((e) => e),
+ excludedValues: excludedValues?.toJSArray((e) => e),
+ );
+
+ final $js.HeaderInfo _wrapped;
+
+ $js.HeaderInfo get toJS => _wrapped;
+
+ /// The name of the header.
+ String get header => _wrapped.header;
+
+ set header(String v) {
+ _wrapped.header = v;
+ }
+
+ /// If specified, match this rule if the header's value contains at least one
+ /// element in this list.
+ List? get values =>
+ _wrapped.values?.toDart.cast().map((e) => e).toList();
+
+ set values(List? v) {
+ _wrapped.values = v?.toJSArray((e) => e);
+ }
+
+ /// If specified, the rule is not matched if the header exists but its value
+ /// contains at least one element in this list.
+ List? get excludedValues =>
+ _wrapped.excludedValues?.toDart.cast().map((e) => e).toList();
+
+ set excludedValues(List? v) {
+ _wrapped.excludedValues = v?.toJSArray((e) => e);
+ }
+}
+
class RuleCondition {
RuleCondition.fromJS(this._wrapped);
@@ -771,7 +835,7 @@ class RuleCondition {
String? regexFilter,
/// Whether the `urlFilter` or `regexFilter`
- /// (whichever is specified) is case sensitive. Default is true.
+ /// (whichever is specified) is case sensitive. Default is false.
bool? isUrlFilterCaseSensitive,
/// The rule will only match network requests originating from the list of
@@ -887,6 +951,15 @@ class RuleCondition {
/// [tabs.TAB_ID_NONE] excludes requests which don't originate from a
/// tab. Only supported for session-scoped rules.
List? excludedTabIds,
+
+ /// Rule matches if the request matches any response header in this list (if
+ /// specified).
+ /// TODO(crbug,com/1141166): Add documentation once feature is complete.
+ List? responseHeaders,
+
+ /// Rule does not match if the request has any of the specified headers.
+ /// TODO(crbug,com/1141166): Add documentation once feature is complete.
+ List? excludedResponseHeaders,
}) : _wrapped = $js.RuleCondition(
urlFilter: urlFilter,
regexFilter: regexFilter,
@@ -907,6 +980,8 @@ class RuleCondition {
domainType: domainType?.toJS,
tabIds: tabIds?.toJSArray((e) => e),
excludedTabIds: excludedTabIds?.toJSArray((e) => e),
+ responseHeaders: responseHeaders?.toJSArray((e) => e.toJS),
+ excludedResponseHeaders: excludedResponseHeaders?.toJSArray((e) => e),
);
final $js.RuleCondition _wrapped;
@@ -970,7 +1045,7 @@ class RuleCondition {
}
/// Whether the `urlFilter` or `regexFilter`
- /// (whichever is specified) is case sensitive. Default is true.
+ /// (whichever is specified) is case sensitive. Default is false.
bool? get isUrlFilterCaseSensitive => _wrapped.isUrlFilterCaseSensitive;
set isUrlFilterCaseSensitive(bool? v) {
@@ -1169,6 +1244,30 @@ class RuleCondition {
set excludedTabIds(List? v) {
_wrapped.excludedTabIds = v?.toJSArray((e) => e);
}
+
+ /// Rule matches if the request matches any response header in this list (if
+ /// specified).
+ /// TODO(crbug,com/1141166): Add documentation once feature is complete.
+ List? get responseHeaders => _wrapped.responseHeaders?.toDart
+ .cast<$js.HeaderInfo>()
+ .map((e) => HeaderInfo.fromJS(e))
+ .toList();
+
+ set responseHeaders(List? v) {
+ _wrapped.responseHeaders = v?.toJSArray((e) => e.toJS);
+ }
+
+ /// Rule does not match if the request has any of the specified headers.
+ /// TODO(crbug,com/1141166): Add documentation once feature is complete.
+ List? get excludedResponseHeaders =>
+ _wrapped.excludedResponseHeaders?.toDart
+ .cast()
+ .map((e) => e)
+ .toList();
+
+ set excludedResponseHeaders(List? v) {
+ _wrapped.excludedResponseHeaders = v?.toJSArray((e) => e);
+ }
}
class ModifyHeaderInfo {
diff --git a/lib/document_scan.dart b/lib/document_scan.dart
index 094646d..74b919a 100644
--- a/lib/document_scan.dart
+++ b/lib/document_scan.dart
@@ -3,6 +3,7 @@
library;
import 'dart:js_util';
+import 'dart:typed_data';
import 'src/internal_helpers.dart';
import 'src/js/document_scan.dart' as $js;
@@ -30,6 +31,336 @@ class ChromeDocumentScan {
$js.chrome.documentScan.scan(options.toJS));
return ScanResults.fromJS($res);
}
+
+ /// Gets the list of available scanners. On success, the list will be
+ /// sent to the callback.
+ /// |filter| : `DeviceFilter` indicating which types of scanners
+ /// should be returned.
+ /// |callback| : Called with the result and list of scanners.
+ Future getScannerList(DeviceFilter filter) async {
+ var $res = await promiseToFuture<$js.GetScannerListResponse>(
+ $js.chrome.documentScan.getScannerList(filter.toJS));
+ return GetScannerListResponse.fromJS($res);
+ }
+
+ /// Opens a scanner for exclusive access. On success, the response containing
+ /// a scanner handle and configuration will be sent to the callback.
+ /// |scannerId| : Scanner id previously returned from `getScannerList`
+ /// indicating which scanner should be opened.
+ /// |callback| : Called with the result.
+ Future openScanner(String scannerId) async {
+ var $res = await promiseToFuture<$js.OpenScannerResponse>(
+ $js.chrome.documentScan.openScanner(scannerId));
+ return OpenScannerResponse.fromJS($res);
+ }
+
+ /// Gets the group names and member options from a scanner handle previously
+ /// opened by `openScanner`.
+ /// |scannerHandle| : Open scanner handle previously returned from
+ /// `openScanner`.
+ /// |callback| : Called with the result.
+ Future getOptionGroups(String scannerHandle) async {
+ var $res = await promiseToFuture<$js.GetOptionGroupsResponse>(
+ $js.chrome.documentScan.getOptionGroups(scannerHandle));
+ return GetOptionGroupsResponse.fromJS($res);
+ }
+
+ /// Closes a previously opened scanner handle. A response indicating the
+ /// outcome will be sent to the callback. Even if the response is not a
+ /// success, the supplied handle will become invalid and should not be used
+ /// for further operations.
+ /// |scannerHandle| : Open scanner handle previously returned from
+ /// `openScanner`.
+ /// |callback| : Called with the result.
+ Future closeScanner(String scannerHandle) async {
+ var $res = await promiseToFuture<$js.CloseScannerResponse>(
+ $js.chrome.documentScan.closeScanner(scannerHandle));
+ return CloseScannerResponse.fromJS($res);
+ }
+
+ /// Sends the list of new option values in `options` as a bundle
+ /// to be set on `scannerHandle`. Each option will be set by the
+ /// backend the order specified. Returns a backend response indicating the
+ /// result of each option setting and a new set of final option values after
+ /// all options have been updated.
+ /// |scannerHandle| : Open scanner handle previously returned from
+ /// `openScanner`.
+ /// |options| : A list of `OptionSetting`s that will be applied to
+ /// `scannerHandle`.
+ /// |callback| : Called with the result.
+ Future setOptions(
+ String scannerHandle,
+ List options,
+ ) async {
+ var $res = await promiseToFuture<$js.SetOptionsResponse>(
+ $js.chrome.documentScan.setOptions(
+ scannerHandle,
+ options.toJSArray((e) => e.toJS),
+ ));
+ return SetOptionsResponse.fromJS($res);
+ }
+
+ /// Starts a scan using a previously opened scanner handle. A response
+ /// indicating the outcome will be sent to the callback. If successful, the
+ /// response will include a job handle that can be used in subsequent calls
+ /// to read scan data or cancel a scan.
+ /// |scannerHandle| : Open scanner handle previously returned from
+ /// `openScanner`.
+ /// |options| : `StartScanOptions` indicating what options are to
+ /// be used for the scan. `StartScanOptions.format` must match
+ /// one of the entries returned in the scanner's `ScannerInfo`.
+ /// |callback| : Called with the result.
+ Future startScan(
+ String scannerHandle,
+ StartScanOptions options,
+ ) async {
+ var $res = await promiseToFuture<$js.StartScanResponse>(
+ $js.chrome.documentScan.startScan(
+ scannerHandle,
+ options.toJS,
+ ));
+ return StartScanResponse.fromJS($res);
+ }
+
+ /// Cancels a scan that was previously started using `startScan`.
+ /// The response is sent to the callback.
+ /// |job| : An active scan job previously returned from
+ /// `startScan`.
+ /// |callback| : Called with the result.
+ Future cancelScan(String job) async {
+ var $res = await promiseToFuture<$js.CancelScanResponse>(
+ $js.chrome.documentScan.cancelScan(job));
+ return CancelScanResponse.fromJS($res);
+ }
+
+ /// Reads the next chunk of available image data from an active job handle.
+ /// A response indicating the outcome will be sent to the callback.
+ ///
+ /// It is valid for a response to have result
+ /// `OperationResult.SUCCESS` with a zero-length
+ /// `data` member. This means the scanner is still working but
+ /// does not yet have additional data ready. The caller should wait a short
+ /// time and try again.
+ ///
+ /// When the scan job completes, the response will have the result
+ /// `OperationResult.EOF`. This response may contain a final
+ /// non-zero `data` member.
+ /// |job| : Active job handle previously returned from
+ /// `startScan`.
+ /// |callback| : Called with the result.
+ Future readScanData(String job) async {
+ var $res = await promiseToFuture<$js.ReadScanDataResponse>(
+ $js.chrome.documentScan.readScanData(job));
+ return ReadScanDataResponse.fromJS($res);
+ }
+}
+
+/// OperationResult is an enum that indicates the result of each operation
+/// performed by the backend. It contains the same causes as SANE_Status plus
+/// additional statuses that come from the IPC layers and image conversion
+/// stages.
+enum OperationResult {
+ /// An unknown or generic failure occurred.
+ unknown('UNKNOWN'),
+
+ /// Operation succeeded.
+ success('SUCCESS'),
+
+ /// The operation is not supported.
+ unsupported('UNSUPPORTED'),
+
+ /// The operation was cancelled.
+ cancelled('CANCELLED'),
+
+ /// The device is busy.
+ deviceBusy('DEVICE_BUSY'),
+
+ /// Data or argument is invalid.
+ invalid('INVALID'),
+
+ /// Value is the wrong type for the underlying option.
+ wrongType('WRONG_TYPE'),
+
+ /// No more data is available.
+ eof('EOF'),
+
+ /// The document feeder is jammed.
+ adfJammed('ADF_JAMMED'),
+
+ /// The document feeder is empty.
+ adfEmpty('ADF_EMPTY'),
+
+ /// The flatbed cover is open.
+ coverOpen('COVER_OPEN'),
+
+ /// An error occurred while communicating with the device.
+ ioError('IO_ERROR'),
+
+ /// The device requires authentication.
+ accessDenied('ACCESS_DENIED'),
+
+ /// Not enough memory was available to complete the operation.
+ noMemory('NO_MEMORY'),
+
+ /// The device was not reachable.
+ unreachable('UNREACHABLE'),
+
+ /// The device was disconnected.
+ missing('MISSING'),
+
+ /// An internal error occurred.
+ internalError('INTERNAL_ERROR');
+
+ const OperationResult(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static OperationResult fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
+/// How the scanner is connected to the computer.
+enum ConnectionType {
+ unspecified('UNSPECIFIED'),
+ usb('USB'),
+ network('NETWORK');
+
+ const ConnectionType(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static ConnectionType fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
+/// The type of an option. This is the same set of types as SANE_Value_Type.
+enum OptionType {
+ /// Unknown option type. `value` will be unset.
+ unknown('UNKNOWN'),
+
+ /// true/false only. `value` will be a boolean.
+ bool('BOOL'),
+
+ /// Signed 32-bit integer. `value` will be long or long[],
+ /// depending on whether the option takes more than one value.
+ int('INT'),
+
+ /// Double in the range -32768-32767.9999 with a resolution of 1/65535.
+ /// `value` will be double or double[] depending on whether the
+ /// option takes more than one value.
+ fixed('FIXED'),
+
+ /// A sequence of any bytes except NUL ('\0'). `value` will be a
+ /// DOMString.
+ string('STRING'),
+
+ /// Hardware button or toggle. No value.
+ button('BUTTON'),
+
+ /// Grouping option. No value. This is included for compatibility, but
+ /// will not normally be returned in `ScannerOption` values. Use
+ /// `getOptionGroups()` to retrieve the list of groups with their
+ /// member options.
+ group('GROUP');
+
+ const OptionType(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static OptionType fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
+/// The unit of measurement for an option. This is the same set of units as
+/// SANE_Unit.
+enum OptionUnit {
+ /// Value is a unitless number, e.g. threshold.
+ unitless('UNITLESS'),
+
+ /// Value is a number of pixels, e.g., scan dimensions.
+ pixel('PIXEL'),
+
+ /// Value is the number of bits, e.g., color depth.
+ bit('BIT'),
+
+ /// Value is measured in millimeters, e.g., scan dimensions.
+ mm('MM'),
+
+ /// Value is measured in dots per inch, e.g., resolution.
+ dpi('DPI'),
+
+ /// Value is a percent, e.g., brightness.
+ percent('PERCENT'),
+
+ /// Value is measured in microseconds, e.g., exposure time.
+ microsecond('MICROSECOND');
+
+ const OptionUnit(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static OptionUnit fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
+/// The type of constraint represented by an OptionConstraint.
+enum ConstraintType {
+ /// Constraint represents a range of `OptionType.INT` values.
+ /// `min`, `max`, and `quant` will be
+ /// `long`, and `list` will be unset.
+ intRange('INT_RANGE'),
+
+ /// Constraint represents a range of `OptionType.FIXED` values.
+ /// `min`, `max`, and `quant` will be
+ /// `double`, and `list` will be unset.
+ fixedRange('FIXED_RANGE'),
+
+ /// Constraint represents a specific list of `OptionType.INT`
+ /// values. `list` will contain `long` values, and
+ /// the other fields will be unset.
+ intList('INT_LIST'),
+
+ /// Constraint represents a specific list of `OptionType.FIXED`
+ /// values. `list` will contain `double` values, and
+ /// the other fields will be unset.
+ fixedList('FIXED_LIST'),
+
+ /// Constraint represents a specific list of `OptionType.STRING`
+ /// values. `list` will contain `DOMString` values,
+ /// and the other fields will be unset.
+ stringList('STRING_LIST');
+
+ const ConstraintType(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static ConstraintType fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
+}
+
+/// How an option can be changed.
+enum Configurability {
+ /// Option is read-only and cannot be changed.
+ notConfigurable('NOT_CONFIGURABLE'),
+
+ /// Option can be set in software.
+ softwareConfigurable('SOFTWARE_CONFIGURABLE'),
+
+ /// Option can be set by the user toggling/pushing a hardware button.
+ hardwareConfigurable('HARDWARE_CONFIGURABLE');
+
+ const Configurability(this.value);
+
+ final String value;
+
+ String get toJS => value;
+ static Configurability fromJS(String value) =>
+ values.firstWhere((e) => e.value == value);
}
class ScanOptions {
@@ -101,3 +432,1013 @@ class ScanResults {
_wrapped.mimeType = v;
}
}
+
+class ScannerInfo {
+ ScannerInfo.fromJS(this._wrapped);
+
+ ScannerInfo({
+ /// For connecting with `openScanner`.
+ required String scannerId,
+
+ /// Printable name for displaying in the UI.
+ required String name,
+
+ /// Scanner manufacturer.
+ required String manufacturer,
+
+ /// Scanner model if available, or a generic description.
+ required String model,
+
+ /// For matching against other `ScannerInfo` entries that point
+ /// to the same physical device.
+ required String deviceUuid,
+
+ /// How the scanner is connected to the computer.
+ required ConnectionType connectionType,
+
+ /// If true, the scanner connection's transport cannot be intercepted by a
+ /// passive listener, such as TLS or USB.
+ required bool secure,
+
+ /// MIME types that can be requested for returned scans.
+ required List imageFormats,
+ }) : _wrapped = $js.ScannerInfo(
+ scannerId: scannerId,
+ name: name,
+ manufacturer: manufacturer,
+ model: model,
+ deviceUuid: deviceUuid,
+ connectionType: connectionType.toJS,
+ secure: secure,
+ imageFormats: imageFormats.toJSArray((e) => e),
+ );
+
+ final $js.ScannerInfo _wrapped;
+
+ $js.ScannerInfo get toJS => _wrapped;
+
+ /// For connecting with `openScanner`.
+ String get scannerId => _wrapped.scannerId;
+
+ set scannerId(String v) {
+ _wrapped.scannerId = v;
+ }
+
+ /// Printable name for displaying in the UI.
+ String get name => _wrapped.name;
+
+ set name(String v) {
+ _wrapped.name = v;
+ }
+
+ /// Scanner manufacturer.
+ String get manufacturer => _wrapped.manufacturer;
+
+ set manufacturer(String v) {
+ _wrapped.manufacturer = v;
+ }
+
+ /// Scanner model if available, or a generic description.
+ String get model => _wrapped.model;
+
+ set model(String v) {
+ _wrapped.model = v;
+ }
+
+ /// For matching against other `ScannerInfo` entries that point
+ /// to the same physical device.
+ String get deviceUuid => _wrapped.deviceUuid;
+
+ set deviceUuid(String v) {
+ _wrapped.deviceUuid = v;
+ }
+
+ /// How the scanner is connected to the computer.
+ ConnectionType get connectionType =>
+ ConnectionType.fromJS(_wrapped.connectionType);
+
+ set connectionType(ConnectionType v) {
+ _wrapped.connectionType = v.toJS;
+ }
+
+ /// If true, the scanner connection's transport cannot be intercepted by a
+ /// passive listener, such as TLS or USB.
+ bool get secure => _wrapped.secure;
+
+ set secure(bool v) {
+ _wrapped.secure = v;
+ }
+
+ /// MIME types that can be requested for returned scans.
+ List get imageFormats =>
+ _wrapped.imageFormats.toDart.cast().map((e) => e).toList();
+
+ set imageFormats(List v) {
+ _wrapped.imageFormats = v.toJSArray((e) => e);
+ }
+}
+
+class OptionConstraint {
+ OptionConstraint.fromJS(this._wrapped);
+
+ OptionConstraint({
+ required ConstraintType type,
+ Object? min,
+ Object? max,
+ Object? quant,
+ Object? list,
+ }) : _wrapped = $js.OptionConstraint(
+ type: type.toJS,
+ min: switch (min) {
+ int() => min.jsify()!,
+ double() => min.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${min.runtimeType}. Supported types are: int, double')
+ },
+ max: switch (max) {
+ int() => max.jsify()!,
+ double() => max.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${max.runtimeType}. Supported types are: int, double')
+ },
+ quant: switch (quant) {
+ int() => quant.jsify()!,
+ double() => quant.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${quant.runtimeType}. Supported types are: int, double')
+ },
+ list: switch (list) {
+ List() => list.toJSArray((e) => e),
+ List() => list.toJSArray((e) => e),
+ List() => list.toJSArrayString(),
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${list.runtimeType}. Supported types are: List, List, List')
+ },
+ );
+
+ final $js.OptionConstraint _wrapped;
+
+ $js.OptionConstraint get toJS => _wrapped;
+
+ ConstraintType get type => ConstraintType.fromJS(_wrapped.type);
+
+ set type(ConstraintType v) {
+ _wrapped.type = v.toJS;
+ }
+
+ Object? get min => _wrapped.min?.when(
+ isInt: (v) => v,
+ isDouble: (v) => v,
+ );
+
+ set min(Object? v) {
+ _wrapped.min = switch (v) {
+ int() => v.jsify()!,
+ double() => v.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: int, double')
+ };
+ }
+
+ Object? get max => _wrapped.max?.when(
+ isInt: (v) => v,
+ isDouble: (v) => v,
+ );
+
+ set max(Object? v) {
+ _wrapped.max = switch (v) {
+ int() => v.jsify()!,
+ double() => v.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: int, double')
+ };
+ }
+
+ Object? get quant => _wrapped.quant?.when(
+ isInt: (v) => v,
+ isDouble: (v) => v,
+ );
+
+ set quant(Object? v) {
+ _wrapped.quant = switch (v) {
+ int() => v.jsify()!,
+ double() => v.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: int, double')
+ };
+ }
+
+ Object? get list => _wrapped.list?.when(
+ isArray: (v) => v.toDart.cast().map((e) => e).toList(),
+ );
+
+ set list(Object? v) {
+ _wrapped.list = switch (v) {
+ List() => v.toJSArray((e) => e),
+ List() => v.toJSArray((e) => e),
+ List() => v.toJSArrayString(),
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: List, List, List')
+ };
+ }
+}
+
+class ScannerOption {
+ ScannerOption.fromJS(this._wrapped);
+
+ ScannerOption({
+ /// Option name using lowercase a-z, numbers, and dashes.
+ required String name,
+
+ /// Printable one-line title.
+ required String title,
+
+ /// Longer description of the option.
+ required String description,
+
+ /// The type that `value` will contain and that is needed for
+ /// setting this option.
+ required OptionType type,
+
+ /// Unit of measurement for this option.
+ required OptionUnit unit,
+
+ /// Current value of the option if relevant. Note the type passed here must
+ /// match the type specified in `type`.
+ Object? value,
+
+ /// Constraint on possible values.
+ OptionConstraint? constraint,
+
+ /// Can be detected from software.
+ required bool isDetectable,
+
+ /// Whether/how the option can be changed.
+ required Configurability configurability,
+
+ /// Can be automatically set by the backend.
+ required bool isAutoSettable,
+
+ /// Emulated by the backend if true.
+ required bool isEmulated,
+
+ /// Option is active and can be set/retrieved. If false, the
+ /// `value` field will not be set.
+ required bool isActive,
+
+ /// UI should not display this option by default.
+ required bool isAdvanced,
+
+ /// Option is used for internal configuration and should never be displayed
+ /// in the UI.
+ required bool isInternal,
+ }) : _wrapped = $js.ScannerOption(
+ name: name,
+ title: title,
+ description: description,
+ type: type.toJS,
+ unit: unit.toJS,
+ value: switch (value) {
+ bool() => value.jsify()!,
+ double() => value.jsify()!,
+ List() => value.toJSArray((e) => e),
+ int() => value.jsify()!,
+ List() => value.toJSArray((e) => e),
+ String() => value.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${value.runtimeType}. Supported types are: bool, double, List, int, List, String')
+ },
+ constraint: constraint?.toJS,
+ isDetectable: isDetectable,
+ configurability: configurability.toJS,
+ isAutoSettable: isAutoSettable,
+ isEmulated: isEmulated,
+ isActive: isActive,
+ isAdvanced: isAdvanced,
+ isInternal: isInternal,
+ );
+
+ final $js.ScannerOption _wrapped;
+
+ $js.ScannerOption get toJS => _wrapped;
+
+ /// Option name using lowercase a-z, numbers, and dashes.
+ String get name => _wrapped.name;
+
+ set name(String v) {
+ _wrapped.name = v;
+ }
+
+ /// Printable one-line title.
+ String get title => _wrapped.title;
+
+ set title(String v) {
+ _wrapped.title = v;
+ }
+
+ /// Longer description of the option.
+ String get description => _wrapped.description;
+
+ set description(String v) {
+ _wrapped.description = v;
+ }
+
+ /// The type that `value` will contain and that is needed for
+ /// setting this option.
+ OptionType get type => OptionType.fromJS(_wrapped.type);
+
+ set type(OptionType v) {
+ _wrapped.type = v.toJS;
+ }
+
+ /// Unit of measurement for this option.
+ OptionUnit get unit => OptionUnit.fromJS(_wrapped.unit);
+
+ set unit(OptionUnit v) {
+ _wrapped.unit = v.toJS;
+ }
+
+ /// Current value of the option if relevant. Note the type passed here must
+ /// match the type specified in `type`.
+ Object? get value => _wrapped.value?.when(
+ isBool: (v) => v,
+ isDouble: (v) => v,
+ isArray: (v) => v.toDart.cast().map((e) => e).toList(),
+ isInt: (v) => v,
+ isString: (v) => v,
+ );
+
+ set value(Object? v) {
+ _wrapped.value = switch (v) {
+ bool() => v.jsify()!,
+ double() => v.jsify()!,
+ List() => v.toJSArray((e) => e),
+ int() => v.jsify()!,
+ List() => v.toJSArray((e) => e),
+ String() => v.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: bool, double, List, int, List, String')
+ };
+ }
+
+ /// Constraint on possible values.
+ OptionConstraint? get constraint =>
+ _wrapped.constraint?.let(OptionConstraint.fromJS);
+
+ set constraint(OptionConstraint? v) {
+ _wrapped.constraint = v?.toJS;
+ }
+
+ /// Can be detected from software.
+ bool get isDetectable => _wrapped.isDetectable;
+
+ set isDetectable(bool v) {
+ _wrapped.isDetectable = v;
+ }
+
+ /// Whether/how the option can be changed.
+ Configurability get configurability =>
+ Configurability.fromJS(_wrapped.configurability);
+
+ set configurability(Configurability v) {
+ _wrapped.configurability = v.toJS;
+ }
+
+ /// Can be automatically set by the backend.
+ bool get isAutoSettable => _wrapped.isAutoSettable;
+
+ set isAutoSettable(bool v) {
+ _wrapped.isAutoSettable = v;
+ }
+
+ /// Emulated by the backend if true.
+ bool get isEmulated => _wrapped.isEmulated;
+
+ set isEmulated(bool v) {
+ _wrapped.isEmulated = v;
+ }
+
+ /// Option is active and can be set/retrieved. If false, the
+ /// `value` field will not be set.
+ bool get isActive => _wrapped.isActive;
+
+ set isActive(bool v) {
+ _wrapped.isActive = v;
+ }
+
+ /// UI should not display this option by default.
+ bool get isAdvanced => _wrapped.isAdvanced;
+
+ set isAdvanced(bool v) {
+ _wrapped.isAdvanced = v;
+ }
+
+ /// Option is used for internal configuration and should never be displayed
+ /// in the UI.
+ bool get isInternal => _wrapped.isInternal;
+
+ set isInternal(bool v) {
+ _wrapped.isInternal = v;
+ }
+}
+
+class DeviceFilter {
+ DeviceFilter.fromJS(this._wrapped);
+
+ DeviceFilter({
+ /// Only return scanners that are directly attached to the computer.
+ bool? local,
+
+ /// Only return scanners that use a secure transport, such as USB or TLS.
+ bool? secure,
+ }) : _wrapped = $js.DeviceFilter(
+ local: local,
+ secure: secure,
+ );
+
+ final $js.DeviceFilter _wrapped;
+
+ $js.DeviceFilter get toJS => _wrapped;
+
+ /// Only return scanners that are directly attached to the computer.
+ bool? get local => _wrapped.local;
+
+ set local(bool? v) {
+ _wrapped.local = v;
+ }
+
+ /// Only return scanners that use a secure transport, such as USB or TLS.
+ bool? get secure => _wrapped.secure;
+
+ set secure(bool? v) {
+ _wrapped.secure = v;
+ }
+}
+
+class OptionGroup {
+ OptionGroup.fromJS(this._wrapped);
+
+ OptionGroup({
+ /// Printable title, e.g. "Geometry options".
+ required String title,
+
+ /// Names of contained options, in backend-provided order.
+ required List members,
+ }) : _wrapped = $js.OptionGroup(
+ title: title,
+ members: members.toJSArray((e) => e),
+ );
+
+ final $js.OptionGroup _wrapped;
+
+ $js.OptionGroup get toJS => _wrapped;
+
+ /// Printable title, e.g. "Geometry options".
+ String get title => _wrapped.title;
+
+ set title(String v) {
+ _wrapped.title = v;
+ }
+
+ /// Names of contained options, in backend-provided order.
+ List get members =>
+ _wrapped.members.toDart.cast().map((e) => e).toList();
+
+ set members(List v) {
+ _wrapped.members = v.toJSArray((e) => e);
+ }
+}
+
+class GetScannerListResponse {
+ GetScannerListResponse.fromJS(this._wrapped);
+
+ GetScannerListResponse({
+ /// The backend's enumeration result. Note that partial results could be
+ /// returned even if this indicates an error.
+ required OperationResult result,
+
+ /// A possibly-empty list of scanners that match the provided
+ /// `DeviceFilter`.
+ required List scanners,
+ }) : _wrapped = $js.GetScannerListResponse(
+ result: result.toJS,
+ scanners: scanners.toJSArray((e) => e.toJS),
+ );
+
+ final $js.GetScannerListResponse _wrapped;
+
+ $js.GetScannerListResponse get toJS => _wrapped;
+
+ /// The backend's enumeration result. Note that partial results could be
+ /// returned even if this indicates an error.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+
+ /// A possibly-empty list of scanners that match the provided
+ /// `DeviceFilter`.
+ List get scanners => _wrapped.scanners.toDart
+ .cast<$js.ScannerInfo>()
+ .map((e) => ScannerInfo.fromJS(e))
+ .toList();
+
+ set scanners(List v) {
+ _wrapped.scanners = v.toJSArray((e) => e.toJS);
+ }
+}
+
+class OpenScannerResponse {
+ OpenScannerResponse.fromJS(this._wrapped);
+
+ OpenScannerResponse({
+ /// Same scanner ID passed to `openScanner()`.
+ required String scannerId,
+
+ /// Backend result of opening the scanner.
+ required OperationResult result,
+
+ /// If `result` is `OperationResult.SUCCESS`, a handle
+ /// to the scanner that can be used for further operations.
+ String? scannerHandle,
+
+ /// If `result` is `OperationResult.SUCCESS`, a
+ /// key-value mapping from option names to `ScannerOption`.
+ Map? options,
+ }) : _wrapped = $js.OpenScannerResponse(
+ scannerId: scannerId,
+ result: result.toJS,
+ scannerHandle: scannerHandle,
+ options: options?.jsify(),
+ );
+
+ final $js.OpenScannerResponse _wrapped;
+
+ $js.OpenScannerResponse get toJS => _wrapped;
+
+ /// Same scanner ID passed to `openScanner()`.
+ String get scannerId => _wrapped.scannerId;
+
+ set scannerId(String v) {
+ _wrapped.scannerId = v;
+ }
+
+ /// Backend result of opening the scanner.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+
+ /// If `result` is `OperationResult.SUCCESS`, a handle
+ /// to the scanner that can be used for further operations.
+ String? get scannerHandle => _wrapped.scannerHandle;
+
+ set scannerHandle(String? v) {
+ _wrapped.scannerHandle = v;
+ }
+
+ /// If `result` is `OperationResult.SUCCESS`, a
+ /// key-value mapping from option names to `ScannerOption`.
+ Map? get options => _wrapped.options?.toDartMap();
+
+ set options(Map? v) {
+ _wrapped.options = v?.jsify();
+ }
+}
+
+class GetOptionGroupsResponse {
+ GetOptionGroupsResponse.fromJS(this._wrapped);
+
+ GetOptionGroupsResponse({
+ /// Same scanner handle passed to `getOptionGroups()`.
+ required String scannerHandle,
+
+ /// The backend's result of getting the option groups.
+ required OperationResult result,
+
+ /// If `result` is `OperationResult.SUCCESS`, a list of
+ /// option groups in the order supplied by the backend.
+ List? groups,
+ }) : _wrapped = $js.GetOptionGroupsResponse(
+ scannerHandle: scannerHandle,
+ result: result.toJS,
+ groups: groups?.toJSArray((e) => e.toJS),
+ );
+
+ final $js.GetOptionGroupsResponse _wrapped;
+
+ $js.GetOptionGroupsResponse get toJS => _wrapped;
+
+ /// Same scanner handle passed to `getOptionGroups()`.
+ String get scannerHandle => _wrapped.scannerHandle;
+
+ set scannerHandle(String v) {
+ _wrapped.scannerHandle = v;
+ }
+
+ /// The backend's result of getting the option groups.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+
+ /// If `result` is `OperationResult.SUCCESS`, a list of
+ /// option groups in the order supplied by the backend.
+ List? get groups => _wrapped.groups?.toDart
+ .cast<$js.OptionGroup>()
+ .map((e) => OptionGroup.fromJS(e))
+ .toList();
+
+ set groups(List? v) {
+ _wrapped.groups = v?.toJSArray((e) => e.toJS);
+ }
+}
+
+class CloseScannerResponse {
+ CloseScannerResponse.fromJS(this._wrapped);
+
+ CloseScannerResponse({
+ /// Same scanner handle passed to `closeScanner()`.
+ required String scannerHandle,
+
+ /// Backend result of closing the scanner. Even if this value is not
+ /// `OperationResult.SUCCESS`, the handle will be invalid and
+ /// should not be used for any further operations.
+ required OperationResult result,
+ }) : _wrapped = $js.CloseScannerResponse(
+ scannerHandle: scannerHandle,
+ result: result.toJS,
+ );
+
+ final $js.CloseScannerResponse _wrapped;
+
+ $js.CloseScannerResponse get toJS => _wrapped;
+
+ /// Same scanner handle passed to `closeScanner()`.
+ String get scannerHandle => _wrapped.scannerHandle;
+
+ set scannerHandle(String v) {
+ _wrapped.scannerHandle = v;
+ }
+
+ /// Backend result of closing the scanner. Even if this value is not
+ /// `OperationResult.SUCCESS`, the handle will be invalid and
+ /// should not be used for any further operations.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+}
+
+class OptionSetting {
+ OptionSetting.fromJS(this._wrapped);
+
+ OptionSetting({
+ /// Name of the option to set.
+ required String name,
+
+ /// Type of the option. The requested type must match the real type of the
+ /// underlying option.
+ required OptionType type,
+
+ /// Value to set. Leave unset to request automatic setting for options that
+ /// have `autoSettable` enabled. The type supplied for
+ /// `value` must match `type`.
+ Object? value,
+ }) : _wrapped = $js.OptionSetting(
+ name: name,
+ type: type.toJS,
+ value: switch (value) {
+ bool() => value.jsify()!,
+ double() => value.jsify()!,
+ List() => value.toJSArray((e) => e),
+ int() => value.jsify()!,
+ List() => value.toJSArray((e) => e),
+ String() => value.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${value.runtimeType}. Supported types are: bool, double, List, int, List, String')
+ },
+ );
+
+ final $js.OptionSetting _wrapped;
+
+ $js.OptionSetting get toJS => _wrapped;
+
+ /// Name of the option to set.
+ String get name => _wrapped.name;
+
+ set name(String v) {
+ _wrapped.name = v;
+ }
+
+ /// Type of the option. The requested type must match the real type of the
+ /// underlying option.
+ OptionType get type => OptionType.fromJS(_wrapped.type);
+
+ set type(OptionType v) {
+ _wrapped.type = v.toJS;
+ }
+
+ /// Value to set. Leave unset to request automatic setting for options that
+ /// have `autoSettable` enabled. The type supplied for
+ /// `value` must match `type`.
+ Object? get value => _wrapped.value?.when(
+ isBool: (v) => v,
+ isDouble: (v) => v,
+ isArray: (v) => v.toDart.cast().map((e) => e).toList(),
+ isInt: (v) => v,
+ isString: (v) => v,
+ );
+
+ set value(Object? v) {
+ _wrapped.value = switch (v) {
+ bool() => v.jsify()!,
+ double() => v.jsify()!,
+ List() => v.toJSArray((e) => e),
+ int() => v.jsify()!,
+ List() => v.toJSArray((e) => e),
+ String() => v.jsify()!,
+ null => null,
+ _ => throw UnsupportedError(
+ 'Received type: ${v.runtimeType}. Supported types are: bool, double, List, int, List, String')
+ };
+ }
+}
+
+class SetOptionResult {
+ SetOptionResult.fromJS(this._wrapped);
+
+ SetOptionResult({
+ /// Name of the option that was set.
+ required String name,
+
+ /// Backend result of setting the option.
+ required OperationResult result,
+ }) : _wrapped = $js.SetOptionResult(
+ name: name,
+ result: result.toJS,
+ );
+
+ final $js.SetOptionResult _wrapped;
+
+ $js.SetOptionResult get toJS => _wrapped;
+
+ /// Name of the option that was set.
+ String get name => _wrapped.name;
+
+ set name(String v) {
+ _wrapped.name = v;
+ }
+
+ /// Backend result of setting the option.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+}
+
+class SetOptionsResponse {
+ SetOptionsResponse.fromJS(this._wrapped);
+
+ SetOptionsResponse({
+ /// The same scanner handle passed to `setOptions()`.
+ required String scannerHandle,
+
+ /// One result per passed-in `OptionSetting`.
+ required List results,
+
+ /// Updated key-value mapping from option names to
+ /// `ScannerOption` containing the new configuration after
+ /// attempting to set all supplied options. This has the same structure as
+ /// the `options` field in `OpenScannerResponse`.
+ ///
+ /// This field will be set even if some options were not set successfully,
+ /// but will be unset if retrieving the updated configuration fails (e.g.,
+ /// if the scanner is disconnected in the middle).
+ Map? options,
+ }) : _wrapped = $js.SetOptionsResponse(
+ scannerHandle: scannerHandle,
+ results: results.toJSArray((e) => e.toJS),
+ options: options?.jsify(),
+ );
+
+ final $js.SetOptionsResponse _wrapped;
+
+ $js.SetOptionsResponse get toJS => _wrapped;
+
+ /// The same scanner handle passed to `setOptions()`.
+ String get scannerHandle => _wrapped.scannerHandle;
+
+ set scannerHandle(String v) {
+ _wrapped.scannerHandle = v;
+ }
+
+ /// One result per passed-in `OptionSetting`.
+ List get results => _wrapped.results.toDart
+ .cast<$js.SetOptionResult>()
+ .map((e) => SetOptionResult.fromJS(e))
+ .toList();
+
+ set results(List v) {
+ _wrapped.results = v.toJSArray((e) => e.toJS);
+ }
+
+ /// Updated key-value mapping from option names to
+ /// `ScannerOption` containing the new configuration after
+ /// attempting to set all supplied options. This has the same structure as
+ /// the `options` field in `OpenScannerResponse`.
+ ///
+ /// This field will be set even if some options were not set successfully,
+ /// but will be unset if retrieving the updated configuration fails (e.g.,
+ /// if the scanner is disconnected in the middle).
+ Map? get options => _wrapped.options?.toDartMap();
+
+ set options(Map? v) {
+ _wrapped.options = v?.jsify();
+ }
+}
+
+class StartScanOptions {
+ StartScanOptions.fromJS(this._wrapped);
+
+ StartScanOptions(
+ {
+ /// MIME type to return scanned data in.
+ required String format})
+ : _wrapped = $js.StartScanOptions(format: format);
+
+ final $js.StartScanOptions _wrapped;
+
+ $js.StartScanOptions get toJS => _wrapped;
+
+ /// MIME type to return scanned data in.
+ String get format => _wrapped.format;
+
+ set format(String v) {
+ _wrapped.format = v;
+ }
+}
+
+class StartScanResponse {
+ StartScanResponse.fromJS(this._wrapped);
+
+ StartScanResponse({
+ /// The same scanner handle that was passed to `startScan()`.
+ required String scannerHandle,
+
+ /// The backend's start scan result.
+ required OperationResult result,
+
+ /// If `result` is `OperationResult.SUCCESS`, a handle
+ /// that can be used to read scan data or cancel the job.
+ String? job,
+ }) : _wrapped = $js.StartScanResponse(
+ scannerHandle: scannerHandle,
+ result: result.toJS,
+ job: job,
+ );
+
+ final $js.StartScanResponse _wrapped;
+
+ $js.StartScanResponse get toJS => _wrapped;
+
+ /// The same scanner handle that was passed to `startScan()`.
+ String get scannerHandle => _wrapped.scannerHandle;
+
+ set scannerHandle(String v) {
+ _wrapped.scannerHandle = v;
+ }
+
+ /// The backend's start scan result.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+
+ /// If `result` is `OperationResult.SUCCESS`, a handle
+ /// that can be used to read scan data or cancel the job.
+ String? get job => _wrapped.job;
+
+ set job(String? v) {
+ _wrapped.job = v;
+ }
+}
+
+class CancelScanResponse {
+ CancelScanResponse.fromJS(this._wrapped);
+
+ CancelScanResponse({
+ /// The same job handle that was passed to `cancelScan()`.
+ required String job,
+
+ /// The backend's cancel scan result.
+ required OperationResult result,
+ }) : _wrapped = $js.CancelScanResponse(
+ job: job,
+ result: result.toJS,
+ );
+
+ final $js.CancelScanResponse _wrapped;
+
+ $js.CancelScanResponse get toJS => _wrapped;
+
+ /// The same job handle that was passed to `cancelScan()`.
+ String get job => _wrapped.job;
+
+ set job(String v) {
+ _wrapped.job = v;
+ }
+
+ /// The backend's cancel scan result.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+}
+
+class ReadScanDataResponse {
+ ReadScanDataResponse.fromJS(this._wrapped);
+
+ ReadScanDataResponse({
+ /// Same job handle passed to `readScanData()`.
+ required String job,
+
+ /// The backend result of reading data. If this is
+ /// `OperationResult.SUCCESS`, `data` will contain the
+ /// next (possibly zero-length) chunk of image data that was ready for
+ /// reading. If this is `OperationResult.EOF`, `data`
+ /// will contain the final chunk of image data.
+ required OperationResult result,
+
+ /// If result is `OperationResult.SUCCESS`, the next chunk of
+ /// scanned image data.
+ ByteBuffer? data,
+
+ /// If result is `OperationResult.SUCCESS`, an estimate of how
+ /// much of the total scan data has been delivered so far, in the range
+ /// 0-100.
+ int? estimatedCompletion,
+ }) : _wrapped = $js.ReadScanDataResponse(
+ job: job,
+ result: result.toJS,
+ data: data?.toJS,
+ estimatedCompletion: estimatedCompletion,
+ );
+
+ final $js.ReadScanDataResponse _wrapped;
+
+ $js.ReadScanDataResponse get toJS => _wrapped;
+
+ /// Same job handle passed to `readScanData()`.
+ String get job => _wrapped.job;
+
+ set job(String v) {
+ _wrapped.job = v;
+ }
+
+ /// The backend result of reading data. If this is
+ /// `OperationResult.SUCCESS`, `data` will contain the
+ /// next (possibly zero-length) chunk of image data that was ready for
+ /// reading. If this is `OperationResult.EOF`, `data`
+ /// will contain the final chunk of image data.
+ OperationResult get result => OperationResult.fromJS(_wrapped.result);
+
+ set result(OperationResult v) {
+ _wrapped.result = v.toJS;
+ }
+
+ /// If result is `OperationResult.SUCCESS`, the next chunk of
+ /// scanned image data.
+ ByteBuffer? get data => _wrapped.data?.toDart;
+
+ set data(ByteBuffer? v) {
+ _wrapped.data = v?.toJS;
+ }
+
+ /// If result is `OperationResult.SUCCESS`, an estimate of how
+ /// much of the total scan data has been delivered so far, in the range
+ /// 0-100.
+ int? get estimatedCompletion => _wrapped.estimatedCompletion;
+
+ set estimatedCompletion(int? v) {
+ _wrapped.estimatedCompletion = v;
+ }
+}
diff --git a/lib/downloads.dart b/lib/downloads.dart
index 18ae408..c4ab3d4 100644
--- a/lib/downloads.dart
+++ b/lib/downloads.dart
@@ -103,11 +103,12 @@ class ChromeDownloads {
return $res;
}
- /// Open the downloaded file now if the [DownloadItem] is complete;
- /// otherwise returns an error through [runtime.lastError]. Requires the
- /// `"downloads.open"` permission in addition to the
- /// `"downloads"` permission. An [onChanged] event will fire
- /// when the item is opened for the first time.
+ /// Opens the downloaded file now if the [DownloadItem] is complete;
+ /// otherwise returns an error through [runtime.lastError]. This method
+ /// requires the `"downloads.open"` permission in addition to the
+ /// `"downloads"` permission. An [onChanged] event fires
+ /// when the item is opened for the first time. This method can only be called
+ /// in response to a user gesture.
/// |downloadId|: The identifier for the downloaded file.
void open(int downloadId) {
$js.chrome.downloads.open(downloadId);
@@ -160,6 +161,7 @@ class ChromeDownloads {
/// one other extension has disabled it will return an error through
/// [runtime.lastError]. Requires the `"downloads.shelf"`
/// permission in addition to the `"downloads"` permission.
+ @Deprecated(r'Use $(ref:setUiOptions) instead.')
void setShelfEnabled(bool enabled) {
$js.chrome.downloads.setShelfEnabled(enabled);
}
@@ -345,6 +347,7 @@ enum DangerType {
accepted('accepted'),
allowlistedByPolicy('allowlistedByPolicy'),
asyncScanning('asyncScanning'),
+ asyncLocalPasswordScanning('asyncLocalPasswordScanning'),
passwordProtected('passwordProtected'),
blockedTooLarge('blockedTooLarge'),
sensitiveContentWarning('sensitiveContentWarning'),
@@ -353,7 +356,8 @@ enum DangerType {
deepScannedFailed('deepScannedFailed'),
deepScannedSafe('deepScannedSafe'),
deepScannedOpenedDangerous('deepScannedOpenedDangerous'),
- promptForScaning('promptForScaning'),
+ promptForScanning('promptForScanning'),
+ promptForLocalPasswordScanning('promptForLocalPasswordScanning'),
accountCompromise('accountCompromise');
const DangerType(this.value);
diff --git a/lib/extension_types.dart b/lib/extension_types.dart
index 82909dd..b72a455 100644
--- a/lib/extension_types.dart
+++ b/lib/extension_types.dart
@@ -98,11 +98,13 @@ enum DocumentLifecycle {
}
/// The JavaScript world for a script to execute within. Can either be an
-/// isolated world, unique to this extension, or the main world of the DOM which
-/// is shared with the page's JavaScript.
+/// isolated world unique to this extension, the main world of the DOM which is
+/// shared with the page's JavaScript, or a user scripts world that is only
+/// available for scripts registered with the User Scripts API.
enum ExecutionWorld {
isolated('ISOLATED'),
- main('MAIN');
+ main('MAIN'),
+ userScript('USER_SCRIPT');
const ExecutionWorld(this.value);
diff --git a/lib/file_system_provider.dart b/lib/file_system_provider.dart
index 3af0c27..9b3d669 100644
--- a/lib/file_system_provider.dart
+++ b/lib/file_system_provider.dart
@@ -72,7 +72,7 @@ class ChromeFileSystemProvider {
/// Notifies about changes in the watched directory at
/// `observedPath` in `recursive` mode. If the file
- /// system is mounted with `supportsNofityTag`, then
+ /// system is mounted with `supportsNotifyTag`, then
/// `tag` must be provided, and all changes since the last
/// notification always reported, even if the system was shutdown. The last
/// tag can be obtained with [getAll].
@@ -664,6 +664,39 @@ typedef FileDataCallback = void Function(
bool,
);
+class CloudIdentifier {
+ CloudIdentifier.fromJS(this._wrapped);
+
+ CloudIdentifier({
+ /// Identifier for the cloud storage provider (e.g. 'drive.google.com').
+ required String providerName,
+
+ /// The provider's identifier for the given file/directory.
+ required String id,
+ }) : _wrapped = $js.CloudIdentifier(
+ providerName: providerName,
+ id: id,
+ );
+
+ final $js.CloudIdentifier _wrapped;
+
+ $js.CloudIdentifier get toJS => _wrapped;
+
+ /// Identifier for the cloud storage provider (e.g. 'drive.google.com').
+ String get providerName => _wrapped.providerName;
+
+ set providerName(String v) {
+ _wrapped.providerName = v;
+ }
+
+ /// The provider's identifier for the given file/directory.
+ String get id => _wrapped.id;
+
+ set id(String v) {
+ _wrapped.id = v;
+ }
+}
+
class EntryMetadata {
EntryMetadata.fromJS(this._wrapped);
@@ -693,6 +726,13 @@ class EntryMetadata {
/// 32 KB in size. Optional, but can be provided only when explicitly
/// requested by the [onGetMetadataRequested] event.
String? thumbnail,
+
+ /// Cloud storage representation of this entry. Must be provided if
+ /// requested
+ /// in `options` and the file is backed by cloud storage. For
+ /// local files not backed by cloud storage, it should be undefined when
+ /// requested.
+ CloudIdentifier? cloudIdentifier,
}) : _wrapped = $js.EntryMetadata(
isDirectory: isDirectory,
name: name,
@@ -700,6 +740,7 @@ class EntryMetadata {
modificationTime: modificationTime,
mimeType: mimeType,
thumbnail: thumbnail,
+ cloudIdentifier: cloudIdentifier?.toJS,
);
final $js.EntryMetadata _wrapped;
@@ -754,6 +795,17 @@ class EntryMetadata {
set thumbnail(String? v) {
_wrapped.thumbnail = v;
}
+
+ /// Cloud storage representation of this entry. Must be provided if requested
+ /// in `options` and the file is backed by cloud storage. For
+ /// local files not backed by cloud storage, it should be undefined when
+ /// requested.
+ CloudIdentifier? get cloudIdentifier =>
+ _wrapped.cloudIdentifier?.let(CloudIdentifier.fromJS);
+
+ set cloudIdentifier(CloudIdentifier? v) {
+ _wrapped.cloudIdentifier = v?.toJS;
+ }
}
class Watcher {
@@ -1117,8 +1169,12 @@ class GetMetadataRequestedOptions {
/// Set to `true` if `mimeType` value is requested.
required bool mimeType,
- /// Set to `true` if the thumbnail is requested.
+ /// Set to `true` if `thumbnail` value is requested.
required bool thumbnail,
+
+ /// Set to `true` if `cloudIdentifier` value is
+ /// requested.
+ required bool cloudIdentifier,
}) : _wrapped = $js.GetMetadataRequestedOptions(
fileSystemId: fileSystemId,
requestId: requestId,
@@ -1129,6 +1185,7 @@ class GetMetadataRequestedOptions {
modificationTime: modificationTime,
mimeType: mimeType,
thumbnail: thumbnail,
+ cloudIdentifier: cloudIdentifier,
);
final $js.GetMetadataRequestedOptions _wrapped;
@@ -1192,12 +1249,20 @@ class GetMetadataRequestedOptions {
_wrapped.mimeType = v;
}
- /// Set to `true` if the thumbnail is requested.
+ /// Set to `true` if `thumbnail` value is requested.
bool get thumbnail => _wrapped.thumbnail;
set thumbnail(bool v) {
_wrapped.thumbnail = v;
}
+
+ /// Set to `true` if `cloudIdentifier` value is
+ /// requested.
+ bool get cloudIdentifier => _wrapped.cloudIdentifier;
+
+ set cloudIdentifier(bool v) {
+ _wrapped.cloudIdentifier = v;
+ }
}
class GetActionsRequestedOptions {
@@ -1274,7 +1339,7 @@ class ReadDirectoryRequestedOptions {
/// Set to `true` if `mimeType` value is requested.
required bool mimeType,
- /// Set to `true` if the thumbnail is requested.
+ /// Set to `true` if `thumbnail` value is requested.
required bool thumbnail,
}) : _wrapped = $js.ReadDirectoryRequestedOptions(
fileSystemId: fileSystemId,
@@ -1349,7 +1414,7 @@ class ReadDirectoryRequestedOptions {
_wrapped.mimeType = v;
}
- /// Set to `true` if the thumbnail is requested.
+ /// Set to `true` if `thumbnail` value is requested.
bool get thumbnail => _wrapped.thumbnail;
set thumbnail(bool v) {
diff --git a/lib/history.dart b/lib/history.dart
index 3afc1fc..51f754b 100644
--- a/lib/history.dart
+++ b/lib/history.dart
@@ -14,7 +14,7 @@ extension ChromeHistoryExtension on Chrome {
/// Use the `chrome.history` API to interact with the browser's record of
/// visited pages. You can add, remove, and query for URLs in the browser's
/// history. To override the history page with your own version, see [Override
- /// Pages](override).
+ /// Pages](develop/ui/override-chrome-pages).
ChromeHistory get history => _history;
}
diff --git a/lib/i18n.dart b/lib/i18n.dart
index 1d34e02..415062d 100644
--- a/lib/i18n.dart
+++ b/lib/i18n.dart
@@ -35,7 +35,7 @@ class ChromeI18n {
/// or the _substitutions_ array has more than 9 elements - this method
/// returns `undefined`.
/// [messageName] The name of the message, as specified in the `messages.json` file.
+ /// href='how-to/ui/localization-message-formats'>`messages.json` file.
/// [substitutions] Up to 9 substitution strings, if the message requires
/// any.
/// [returns] Message localized for current locale.
diff --git a/lib/identity.dart b/lib/identity.dart
index 3fda82c..5c5bb9f 100644
--- a/lib/identity.dart
+++ b/lib/identity.dart
@@ -35,7 +35,7 @@ class ChromeIdentity {
/// Gets an OAuth2 access token using the client ID and scopes
/// specified in the `oauth2`
+ /// href="/docs/apps/app_identity#update_manifest">`oauth2`
/// section of manifest.json.
///
/// The Identity API caches access tokens in memory, so it's ok to
@@ -159,10 +159,10 @@ class ChromeIdentity {
}
enum AccountStatus {
- /// Sync is enabled for the primary account.
+ /// Specifies that Sync is enabled for the primary account.
sync('SYNC'),
- /// Any primary account, if exists.
+ /// Specifies the existence of a primary account, if any.
any('ANY');
const AccountStatus(this.value);
diff --git a/lib/login_state.dart b/lib/login_state.dart
index 2a9ac37..d512e07 100644
--- a/lib/login_state.dart
+++ b/lib/login_state.dart
@@ -45,10 +45,10 @@ class ChromeLoginState {
}
enum ProfileType {
- /// The extension is in the signin profile.
+ /// Specifies that the extension is in the signin profile.
signinProfile('SIGNIN_PROFILE'),
- /// The extension is in the user profile.
+ /// Specifies that the extension is in the user profile.
userProfile('USER_PROFILE');
const ProfileType(this.value);
@@ -61,22 +61,22 @@ enum ProfileType {
}
enum SessionState {
- /// The session state is unknown.
+ /// Specifies that the session state is unknown.
unknown('UNKNOWN'),
- /// The user is in the out-of-box-experience screen.
+ /// Specifies that the user is in the out-of-box-experience screen.
inOobeScreen('IN_OOBE_SCREEN'),
- /// The user is in the login screen.
+ /// Specifies that the user is in the login screen.
inLoginScreen('IN_LOGIN_SCREEN'),
- /// The user is in the session.
+ /// Specifies that the user is in the session.
inSession('IN_SESSION'),
- /// The user is in the lock screen.
+ /// Specifies that the user is in the lock screen.
inLockScreen('IN_LOCK_SCREEN'),
- /// The device is in RMA mode, finalizing repairs.
+ /// Specifies that the device is in RMA mode, finalizing repairs.
inRmaScreen('IN_RMA_SCREEN');
const SessionState(this.value);
diff --git a/lib/management.dart b/lib/management.dart
index 3673619..24043aa 100644
--- a/lib/management.dart
+++ b/lib/management.dart
@@ -13,7 +13,8 @@ final _management = ChromeManagement._();
extension ChromeManagementExtension on Chrome {
/// The `chrome.management` API provides ways to manage the list of
/// extensions/apps that are installed and running. It is particularly useful
- /// for extensions that [override](override) the built-in New Tab page.
+ /// for extensions that [override](develop/ui/override-chrome-pages) the
+ /// built-in New Tab page.
ChromeManagement get management => _management;
}
@@ -49,8 +50,9 @@ class ChromeManagement {
return ExtensionInfo.fromJS($res);
}
- /// Returns a list of [permission warnings](permission_warnings) for the given
- /// extension id.
+ /// Returns a list of [permission
+ /// warnings](develop/concepts/permission-warnings) for the given extension
+ /// id.
/// [id] The ID of an already installed extension.
Future> getPermissionWarningsById(String id) async {
var $res = await promiseToFuture(
@@ -58,9 +60,10 @@ class ChromeManagement {
return $res.toDart.cast().map((e) => e).toList();
}
- /// Returns a list of [permission warnings](permission_warnings) for the given
- /// extension manifest string. Note: This function can be used without
- /// requesting the 'management' permission in the manifest.
+ /// Returns a list of [permission
+ /// warnings](develop/concepts/permission-warnings) for the given extension
+ /// manifest string. Note: This function can be used without requesting the
+ /// 'management' permission in the manifest.
/// [manifestStr] Extension manifest JSON string.
Future> getPermissionWarningsByManifest(
String manifestStr) async {
@@ -156,23 +159,6 @@ class ChromeManagement {
return ExtensionInfo.fromJS($res);
}
- /// Checks if the replacement android app can be installed. Errors generated
- /// by this API are reported by setting [runtime.lastError] and executing the
- /// function's regular callback.
- Future canInstallReplacementAndroidApp() async {
- var $res = await promiseToFuture(
- $js.chrome.management.canInstallReplacementAndroidApp());
- return $res;
- }
-
- /// Prompts the user to install the replacement Android app from the manifest.
- /// Errors generated by this API are reported by setting [runtime.lastError]
- /// and executing the function's regular callback.
- Future installReplacementAndroidApp() async {
- await promiseToFuture(
- $js.chrome.management.installReplacementAndroidApp());
- }
-
/// Launches the replacement_web_app specified in the manifest. Prompts the
/// user to install if not already installed.
Future installReplacementWebApp() async {
@@ -331,11 +317,12 @@ class ExtensionInfo {
/// The description of this extension, app, or theme.
required String description,
- /// The [version](manifest/version) of this extension, app, or theme.
+ /// The [version](reference/manifest/version) of this extension, app, or
+ /// theme.
required String version,
- /// The [version name](manifest/version#version_name) of this extension,
- /// app, or theme if the manifest specified one.
+ /// The [version name](reference/manifest/version#version_name) of this
+ /// extension, app, or theme if the manifest specified one.
String? versionName,
/// Whether this extension can be disabled or uninstalled by the user.
@@ -376,7 +363,8 @@ class ExtensionInfo {
/// declared in the manifest, and the actual image at that url may be larger
/// or smaller than what was declared, so you might consider using explicit
/// width and height attributes on img tags referencing these images. See
- /// the [manifest documentation on icons](manifest/icons) for more details.
+ /// the [manifest documentation on icons](reference/manifest/icons) for more
+ /// details.
List? icons,
/// Returns a list of API based permissions.
@@ -451,15 +439,16 @@ class ExtensionInfo {
_wrapped.description = v;
}
- /// The [version](manifest/version) of this extension, app, or theme.
+ /// The [version](reference/manifest/version) of this extension, app, or
+ /// theme.
String get version => _wrapped.version;
set version(String v) {
_wrapped.version = v;
}
- /// The [version name](manifest/version#version_name) of this extension, app,
- /// or theme if the manifest specified one.
+ /// The [version name](reference/manifest/version#version_name) of this
+ /// extension, app, or theme if the manifest specified one.
String? get versionName => _wrapped.versionName;
set versionName(String? v) {
@@ -549,7 +538,7 @@ class ExtensionInfo {
/// in the manifest, and the actual image at that url may be larger or smaller
/// than what was declared, so you might consider using explicit width and
/// height attributes on img tags referencing these images. See the [manifest
- /// documentation on icons](manifest/icons) for more details.
+ /// documentation on icons](reference/manifest/icons) for more details.
List? get icons => _wrapped.icons?.toDart
.cast<$js.IconInfo>()
.map((e) => IconInfo.fromJS(e))
diff --git a/lib/notifications.dart b/lib/notifications.dart
index f9b9ccf..e76e382 100644
--- a/lib/notifications.dart
+++ b/lib/notifications.dart
@@ -141,17 +141,19 @@ class ChromeNotifications {
}
enum TemplateType {
- /// icon, title, message, expandedMessage, up to two buttons
+ /// Contains an icon, title, message, expandedMessage, and up to two
+ /// buttons.
basic('basic'),
- /// icon, title, message, expandedMessage, image, up to two buttons
+ /// Contains an icon, title, message, expandedMessage, image, and up
+ /// to two buttons.
image('image'),
- /// icon, title, message, items, up to two buttons. Users on Mac OS X only
- /// see the first item.
+ /// Contains an icon, title, message, items, and up to two buttons.
+ /// Users on Mac OS X only see the first item.
list('list'),
- /// icon, title, message, progress, up to two buttons
+ /// Contains an icon, title, message, progress, and up to two buttons.
progress('progress');
const TemplateType(this.value);
@@ -164,11 +166,12 @@ enum TemplateType {
}
enum PermissionLevel {
- /// User has elected to show notifications from the app or extension.
- /// This is the default at install time.
+ /// Specifies that the user has elected to show notifications
+ /// from the app or extension. This is the default at install time.
granted('granted'),
- /// User has elected not to show notifications from the app or extension.
+ /// Specifies that the user has elected not to show notifications
+ /// from the app or extension.
denied('denied');
const PermissionLevel(this.value);
diff --git a/lib/offscreen.dart b/lib/offscreen.dart
index 2a64853..6234878 100644
--- a/lib/offscreen.dart
+++ b/lib/offscreen.dart
@@ -52,48 +52,67 @@ enum Reason {
/// A reason used for testing purposes only.
testing('TESTING'),
- /// The offscreen document is responsible for playing audio.
+ /// Specifies that the offscreen document is responsible for playing audio.
audioPlayback('AUDIO_PLAYBACK'),
- /// The offscreen document needs to embed and script an iframe in order to
- /// modify the iframe's content.
+ /// Specifies that the offscreen document needs to embed and script an
+ /// iframe in order to modify the iframe's content.
iframeScripting('IFRAME_SCRIPTING'),
- /// The offscreen document needs to embed an iframe and scrape its DOM to
- /// extract information.
+ /// Specifies that the offscreen document needs to embed an iframe and
+ /// scrape its DOM to extract information.
domScraping('DOM_SCRAPING'),
- /// The offscreen document needs to interact with Blob objects (including
- /// `URL.createObjectURL()`).
+ /// Specifies that the offscreen document needs to interact with Blob
+ /// objects (including `URL.createObjectURL()`).
blobs('BLOBS'),
- /// The offscreen document needs to use the `DOMParser` API.
+ /// Specifies that the offscreen document needs to use the
+ /// WebRTC
+ /// APIs.
webRtc('WEB_RTC'),
- /// The offscreen document needs to interact with the clipboard APIs
- /// (e.g. `Navigator.clipboard`).
+ /// Specifies that the offscreen document needs to interact with the
+ /// navigator.geolocation
+ /// Specifies that the offscreen document needs to use
+ /// navigator.getBattery.
+ batteryStatus('BATTERY_STATUS'),
+
+ /// Specifies that the offscreen document needs to use
+ /// window.matchMedia.
+ matchMedia('MATCH_MEDIA'),
+
+ /// Specifies that the offscreen document needs to use
+ /// navigator.geolocation.
geolocation('GEOLOCATION');
const Reason(this.value);
diff --git a/lib/permissions.dart b/lib/permissions.dart
index 42c35e0..f651d95 100644
--- a/lib/permissions.dart
+++ b/lib/permissions.dart
@@ -12,9 +12,9 @@ final _permissions = ChromePermissions._();
extension ChromePermissionsExtension on Chrome {
/// Use the `chrome.permissions` API to request [declared optional
- /// permissions](permissions#manifest) at run time rather than install time,
- /// so users understand why the permissions are needed and grant only those
- /// that are necessary.
+ /// permissions](/docs/extensions/mv3/declare_permissions/) at run time rather
+ /// than install time, so users understand why the permissions are needed and
+ /// grant only those that are necessary.
ChromePermissions get permissions => _permissions;
}
diff --git a/lib/power.dart b/lib/power.dart
index 320f413..6918fb5 100644
--- a/lib/power.dart
+++ b/lib/power.dart
@@ -43,10 +43,10 @@ class ChromePower {
}
enum Level {
- /// Prevent the system from sleeping in response to user inactivity.
+ /// Prevents the system from sleeping in response to user inactivity.
system('system'),
- /// Prevent the display from being turned off or dimmed or the system
+ /// Prevents the display from being turned off or dimmed, or the system
/// from sleeping in response to user inactivity.
display('display');
diff --git a/lib/printer_provider.dart b/lib/printer_provider.dart
index 6273178..ec62e30 100644
--- a/lib/printer_provider.dart
+++ b/lib/printer_provider.dart
@@ -104,19 +104,19 @@ class ChromePrinterProvider {
/// Error codes returned in response to [onPrintRequested] event.
enum PrintError {
- /// Operation completed successfully.
+ /// Specifies that the operation was completed successfully.
ok('OK'),
- /// General failure.
+ /// Specifies that a general failure occured.
failed('FAILED'),
- /// Print ticket is invalid. For example, ticket is inconsistent with
- /// capabilities or extension is not able to handle all settings from the
- /// ticket.
+ /// Specifies that the print ticket is invalid. For example, the ticket is
+ /// inconsistent with some capabilities, or the extension is not able to
+ /// handle all settings from the ticket.
invalidTicket('INVALID_TICKET'),
- /// Document is invalid. For example, data may be corrupted or the format is
- /// incompatible with the extension.
+ /// Specifies that the document is invalid. For example, data may be
+ /// corrupted or the format is incompatible with the extension.
invalidData('INVALID_DATA');
const PrintError(this.value);
@@ -196,6 +196,12 @@ class PrintJob {
/// Print ticket in
///
/// CJT format.
+ ///
required Map ticket,
/// The document content type. Supported formats are
@@ -234,6 +240,12 @@ class PrintJob {
/// Print ticket in
///
/// CJT format.
+ ///
Map get ticket => _wrapped.ticket.toDartMap();
set ticket(Map v) {
diff --git a/lib/printing.dart b/lib/printing.dart
index 36f4ad1..2de47e4 100644
--- a/lib/printing.dart
+++ b/lib/printing.dart
@@ -22,9 +22,12 @@ class ChromePrinting {
bool get isAvailable => $js.chrome.printingNullable != null && alwaysTrue;
- /// Submits the job for print.
- /// If the extension is not listed in PrintingAPIExtensionsAllowlist policy,
- /// the user will be prompted to accept the print job.
+ /// Submits the job for printing. If the extension is not listed in
+ /// the
+ /// `PrintingAPIExtensionsAllowlist` policy,
+ /// the user is prompted to accept the print job.
+ /// Before Chrome 120, this function did not return a promise.
Future submitJob(SubmitJobRequest request) async {
var $res = await promiseToFuture<$js.SubmitJobResponse>(
$js.chrome.printing.submitJob(request.toJS));
@@ -194,9 +197,12 @@ class SubmitJobRequest {
SubmitJobRequest({
/// The print job to be submitted.
- /// The only supported content type is "application/pdf", and the CJT ticket
- /// shouldn't include FitToPageTicketItem, PageRangeTicketItem,
- /// ReverseOrderTicketItem and VendorTicketItem fields since they are
+ /// The only supported content type is "application/pdf", and the
+ /// [Cloud Job
+ /// Ticket](https://developers.google.com/cloud-print/docs/cdd#cjt)
+ /// shouldn't include `FitToPageTicketItem`,
+ /// `PageRangeTicketItem`, `ReverseOrderTicketItem`
+ /// and `VendorTicketItem` fields since they are
/// irrelevant for native printing. All other fields must be present.
required PrintJob job,
@@ -213,9 +219,11 @@ class SubmitJobRequest {
$js.SubmitJobRequest get toJS => _wrapped;
/// The print job to be submitted.
- /// The only supported content type is "application/pdf", and the CJT ticket
- /// shouldn't include FitToPageTicketItem, PageRangeTicketItem,
- /// ReverseOrderTicketItem and VendorTicketItem fields since they are
+ /// The only supported content type is "application/pdf", and the
+ /// [Cloud Job Ticket](https://developers.google.com/cloud-print/docs/cdd#cjt)
+ /// shouldn't include `FitToPageTicketItem`,
+ /// `PageRangeTicketItem`, `ReverseOrderTicketItem`
+ /// and `VendorTicketItem` fields since they are
/// irrelevant for native printing. All other fields must be present.
PrintJob get job => PrintJob.fromJS(_wrapped.job);
diff --git a/lib/printing_metrics.dart b/lib/printing_metrics.dart
index 42b3113..ef4e291 100644
--- a/lib/printing_metrics.dart
+++ b/lib/printing_metrics.dart
@@ -44,14 +44,18 @@ class ChromePrintingMetrics {
/// The source of the print job.
enum PrintJobSource {
- /// The job was created from the Print Preview page initiated by the user.
+ /// Specifies that the job was created from the Print Preview page
+ /// initiated by the user.
printPreview('PRINT_PREVIEW'),
- /// The job was created from an Android App.
+ /// Specifies that the job was created from an Android App.
androidApp('ANDROID_APP'),
- /// The job was created by extension via Chrome API.
- extension('EXTENSION');
+ /// Specifies that the job was created by extension via Chrome API.
+ extension('EXTENSION'),
+
+ /// Specifies that the job was created by an Isolated Web App via API.
+ isolatedWebApp('ISOLATED_WEB_APP');
const PrintJobSource(this.value);
@@ -62,15 +66,15 @@ enum PrintJobSource {
values.firstWhere((e) => e.value == value);
}
-/// The final status of the print job.
+/// Specifies the final status of the print job.
enum PrintJobStatus {
- /// Print job was interrupted due to some error.
+ /// Specifies that the print job was interrupted due to some error.
failed('FAILED'),
- /// Print job was canceled by the user or via API.
+ /// Specifies that the print job was canceled by the user or via API.
canceled('CANCELED'),
- /// Print job was printed without any errors.
+ /// Specifies that the print job was printed without any errors.
printed('PRINTED');
const PrintJobStatus(this.value);
@@ -84,10 +88,10 @@ enum PrintJobStatus {
/// The source of the printer.
enum PrinterSource {
- /// Printer was added by user.
+ /// Specifies that the printer was added by user.
user('USER'),
- /// Printer was added via policy.
+ /// Specifies that the printer was added via policy.
policy('POLICY');
const PrinterSource(this.value);
@@ -100,10 +104,10 @@ enum PrinterSource {
}
enum ColorMode {
- /// Black and white mode was used.
+ /// Specifies that black and white mode was used.
blackAndWhite('BLACK_AND_WHITE'),
- /// Color mode was used.
+ /// Specifies that color mode was used.
color('COLOR');
const ColorMode(this.value);
@@ -116,13 +120,13 @@ enum ColorMode {
}
enum DuplexMode {
- /// One-sided printing was used.
+ /// Specifies that one-sided printing was used.
oneSided('ONE_SIDED'),
- /// Two-sided printing was used, flipping on long edge.
+ /// Specifies that two-sided printing was used, flipping on long edge.
twoSidedLongEdge('TWO_SIDED_LONG_EDGE'),
- /// Two-sided printing was used, flipping on short edge.
+ /// Specifies that two-sided printing was used, flipping on short edge.
twoSidedShortEdge('TWO_SIDED_SHORT_EDGE');
const DuplexMode(this.value);
diff --git a/lib/privacy.dart b/lib/privacy.dart
index e06aa24..a026c5f 100644
--- a/lib/privacy.dart
+++ b/lib/privacy.dart
@@ -273,12 +273,6 @@ class PrivacyWebsites {
/// `true`.
required ChromeSetting thirdPartyCookiesAllowed,
- /// If enabled, the experimental [Privacy
- /// Sandbox](https://www.chromium.org/Home/chromium-privacy/privacy-sandbox)
- /// features are active. The value of this preference is of type boolean,
- /// and the default value is `true`.
- required ChromeSetting privacySandboxEnabled,
-
/// If disabled, the [Topics
/// API](https://developer.chrome.com/en/docs/privacy-sandbox/topics/) is
/// deactivated. The value of this preference is of type boolean, and the
@@ -325,9 +319,16 @@ class PrivacyWebsites {
/// unique ID to plugins in order to run protected content. The value of
/// this preference is of type boolean, and the default value is `true`.
ChromeSetting? protectedContentEnabled,
+
+ /// If disabled, [Related Website
+ /// Sets](https://developer.chrome.com/docs/privacy-sandbox/related-website-sets/)
+ /// is deactivated. The value of this preference is of type boolean, and the
+ /// default value is `true`. Extensions may only disable this API by setting
+ /// the value to `false`. If you try setting this API to `true`, it will
+ /// throw an error.
+ required ChromeSetting relatedWebsiteSetsEnabled,
}) : _wrapped = $js.PrivacyWebsites(
thirdPartyCookiesAllowed: thirdPartyCookiesAllowed.toJS,
- privacySandboxEnabled: privacySandboxEnabled.toJS,
topicsEnabled: topicsEnabled.toJS,
fledgeEnabled: fledgeEnabled.toJS,
adMeasurementEnabled: adMeasurementEnabled.toJS,
@@ -335,6 +336,7 @@ class PrivacyWebsites {
referrersEnabled: referrersEnabled.toJS,
doNotTrackEnabled: doNotTrackEnabled.toJS,
protectedContentEnabled: protectedContentEnabled?.toJS,
+ relatedWebsiteSetsEnabled: relatedWebsiteSetsEnabled.toJS,
);
final $js.PrivacyWebsites _wrapped;
@@ -351,17 +353,6 @@ class PrivacyWebsites {
_wrapped.thirdPartyCookiesAllowed = v.toJS;
}
- /// If enabled, the experimental [Privacy
- /// Sandbox](https://www.chromium.org/Home/chromium-privacy/privacy-sandbox)
- /// features are active. The value of this preference is of type boolean, and
- /// the default value is `true`.
- ChromeSetting get privacySandboxEnabled =>
- ChromeSetting.fromJS(_wrapped.privacySandboxEnabled);
-
- set privacySandboxEnabled(ChromeSetting v) {
- _wrapped.privacySandboxEnabled = v.toJS;
- }
-
/// If disabled, the [Topics
/// API](https://developer.chrome.com/en/docs/privacy-sandbox/topics/) is
/// deactivated. The value of this preference is of type boolean, and the
@@ -443,4 +434,17 @@ class PrivacyWebsites {
set protectedContentEnabled(ChromeSetting? v) {
_wrapped.protectedContentEnabled = v?.toJS;
}
+
+ /// If disabled, [Related Website
+ /// Sets](https://developer.chrome.com/docs/privacy-sandbox/related-website-sets/)
+ /// is deactivated. The value of this preference is of type boolean, and the
+ /// default value is `true`. Extensions may only disable this API by setting
+ /// the value to `false`. If you try setting this API to `true`, it will throw
+ /// an error.
+ ChromeSetting get relatedWebsiteSetsEnabled =>
+ ChromeSetting.fromJS(_wrapped.relatedWebsiteSetsEnabled);
+
+ set relatedWebsiteSetsEnabled(ChromeSetting v) {
+ _wrapped.relatedWebsiteSetsEnabled = v.toJS;
+ }
}
diff --git a/lib/proxy.dart b/lib/proxy.dart
index b77ee0b..5f2fd5c 100644
--- a/lib/proxy.dart
+++ b/lib/proxy.dart
@@ -13,7 +13,8 @@ final _proxy = ChromeProxy._();
extension ChromeProxyExtension on Chrome {
/// Use the `chrome.proxy` API to manage Chrome's proxy settings. This API
/// relies on the [ChromeSetting prototype of the type
- /// API](types#ChromeSetting) for getting and setting the proxy configuration.
+ /// API](reference/api/types#type-ChromeSetting) for getting and setting the
+ /// proxy configuration.
ChromeProxy get proxy => _proxy;
}
diff --git a/lib/runtime.dart b/lib/runtime.dart
index f3a5000..23637e1 100644
--- a/lib/runtime.dart
+++ b/lib/runtime.dart
@@ -12,7 +12,7 @@ export 'src/chrome.dart' show chrome;
final _runtime = ChromeRuntime._();
extension ChromeRuntimeExtension on Chrome {
- /// Use the `chrome.runtime` API to retrieve the background page, return
+ /// Use the `chrome.runtime` API to retrieve the service worker, return
/// details about the manifest, and listen for and respond to events in the
/// app or extension lifecycle. You can also use this API to convert the
/// relative path of URLs to fully-qualified URLs.
@@ -49,7 +49,8 @@ class ChromeRuntime {
}
/// Returns details about the app or extension from the manifest. The object
- /// returned is a serialization of the full [manifest file](manifest.html).
+ /// returned is a serialization of the full [manifest
+ /// file](reference/manifest).
/// [returns] The manifest details.
Map getManifest() {
return $js.chrome.runtime.getManifest().toDartMap();
@@ -127,14 +128,14 @@ class ChromeRuntime {
/// Attempts to connect listeners within an extension/app (such as the
/// background page), or other extensions/apps. This is useful for content
/// scripts connecting to their extension processes, inter-app/extension
- /// communication, and [web messaging](manifest/externally_connectable.html).
- /// Note that this does not connect to any listeners in a content script.
- /// Extensions may connect to content scripts embedded in tabs via
- /// [tabs.connect].
+ /// communication, and [web
+ /// messaging](/docs/extensions/manifest/externally_connectable). Note that
+ /// this does not connect to any listeners in a content script. Extensions may
+ /// connect to content scripts embedded in tabs via [tabs.connect].
/// [extensionId] The ID of the extension or app to connect to. If omitted,
/// a connection will be attempted with your own extension. Required if
/// sending messages from a web page for [web
- /// messaging](manifest/externally_connectable.html).
+ /// messaging](/docs/extensions/reference/manifest/externally-connectable).
/// [returns] Port through which messages can be sent and received. The
/// port's $(ref:Port onDisconnect) event is fired if the extension/app does
/// not exist.
@@ -149,7 +150,7 @@ class ChromeRuntime {
}
/// Connects to a native application in the host machine. See [Native
- /// Messaging](nativeMessaging) for more information.
+ /// Messaging](develop/concepts/native-messaging) for more information.
/// [application] The name of the registered application to connect to.
/// [returns] Port through which messages can be sent and received with the
/// application
@@ -168,7 +169,7 @@ class ChromeRuntime {
/// [extensionId] The ID of the extension/app to send the message to. If
/// omitted, the message will be sent to your own extension/app. Required if
/// sending messages from a web page for [web
- /// messaging](manifest/externally_connectable.html).
+ /// messaging](/docs/extensions/manifest/externally_connectable).
/// [message] The message to send. This message should be a JSON-ifiable
/// object.
Future