diff --git a/app/demo/demo.dart b/app/demo/demo.dart index 7fcd1dde..e1e3ca54 100644 --- a/app/demo/demo.dart +++ b/app/demo/demo.dart @@ -20,6 +20,11 @@ void main() { action("getInfo()", handleAudioGetInfo); br(); + label('browser'); + action('available', handleBrowserAvailable); + action('openTab()', handleBrowserOpenTab); + br(); + label('bluetooth'); action('available', handleBluetoothAvailable); action('getAdapterState()', handleBluetoothGetAdapterState); @@ -475,6 +480,15 @@ void handleFileDelete() { summaryFuture(f); } +void handleBrowserAvailable() { + summary("available = ${chrome.browser.available}"); +} + +void handleBrowserOpenTab() { + summaryFuture(chrome.browser.openTab( + new chrome.OpenTabOptions(url: 'http://www.google.com'))); +} + void handleBluetoothAvailable() { summary("available = ${chrome.bluetooth.available}"); } diff --git a/app/demo/manifest.json b/app/demo/manifest.json index cf08f360..b9aa93f3 100644 --- a/app/demo/manifest.json +++ b/app/demo/manifest.json @@ -14,6 +14,7 @@ "permissions": [ "alarms", + "browser", { "fileSystem": ["write", "retainEntries", "directory"] }, "idle", "identity", @@ -25,7 +26,7 @@ { "socket" : ["tcp-connect", "tcp-listen"] }, "tts" ], - + "oauth2": { // client_id below is specifc to the application key. Follow the // documentation to obtain one for your app. diff --git a/idl/_api_features.json b/idl/_api_features.json index 04e624b1..dbe950e7 100644 --- a/idl/_api_features.json +++ b/idl/_api_features.json @@ -4,8 +4,20 @@ // See c/c/e/features/* to understand this file, in particular feature.h, // simple_feature.h, and base_feature_provider.h. +// +// Note that specifying "web_page", "blessed_web_page", or "all" as a context +// type will require manually updating chrome/renderer/resources/dispatcher.cc. { + "accessibilityFeatures": [{ + "platforms": ["chromeos"], + "dependencies": ["permission:accessibilityFeatures.modify"], + "contexts": ["blessed_extension"] + }, { + "platforms": ["chromeos"], + "dependencies": ["permission:accessibilityFeatures.read"], + "contexts": ["blessed_extension"] + }], "activityLogPrivate": { "dependencies": ["permission:activityLogPrivate"], "contexts": ["blessed_extension"] @@ -22,7 +34,11 @@ "channel": "stable", "extension_types": ["hosted_app", "extension", "legacy_packaged_app"], "contexts": [ - "blessed_extension", "unblessed_extension", "content_script", "web_page" + "blessed_extension", + "unblessed_extension", + "content_script", + "web_page", + "blessed_web_page" ], "matches": [ "http://*/*", "https://*/*", "chrome-extension://*/*", "file://*/*" @@ -46,9 +62,9 @@ "channel": "stable", "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, - "app.currentWindowInternal.setAlwaysOnTop": { - "channel": "dev", - "contexts": ["blessed_extension", "unblessed_extension", "content_script"] + "app.currentWindowInternal.setShape": { + "dependencies": ["permission:app.window.shape"], + "contexts": ["blessed_extension"] }, "app.getDetails": { "contexts": ["blessed_extension", "unblessed_extension", "content_script"], @@ -74,12 +90,21 @@ "dependencies": ["permission:audio"], "contexts": ["blessed_extension"] }, + "automationInternal": { + "internal": true, + "dependencies": ["permission:automation"], + "contexts": ["blessed_extension"] + }, + "automation": { + "dependencies": ["permission:automation"], + "contexts": ["blessed_extension"] + }, "autotestPrivate": { "dependencies": ["permission:autotestPrivate"], "contexts": ["blessed_extension"] }, "bluetooth": { - "dependencies": ["permission:bluetooth"], + "dependencies": ["manifest:bluetooth"], "contexts": ["blessed_extension"] }, "bookmarkManagerPrivate": { @@ -134,6 +159,18 @@ "dependencies": ["permission:cast"], "contexts": ["blessed_extension"] }, + "cast.streaming.rtpStream": { + "dependencies": ["permission:cast.streaming"], + "contexts": ["blessed_extension"] + }, + "cast.streaming.session": { + "dependencies": ["permission:cast.streaming"], + "contexts": ["blessed_extension"] + }, + "cast.streaming.udpTransport": { + "dependencies": ["permission:cast.streaming"], + "contexts": ["blessed_extension"] + }, "chromeosInfoPrivate": { "platforms": ["chromeos"], "dependencies": ["permission:chromeosInfoPrivate"], @@ -159,6 +196,11 @@ "dependencies": ["permission:contextMenus"], "contexts": ["blessed_extension"] }, + "contextMenusInternal": { + "internal": true, + "channel": "stable", + "contexts": ["blessed_extension"] + }, "cookies": { "dependencies": ["permission:cookies"], "contexts": ["blessed_extension"] @@ -231,9 +273,7 @@ "internal": true, "channel": "stable", "extension_types": ["platform_app", "extension"], - "contexts": [ - "blessed_extension", "unblessed_extension", "content_script", "web_page" - ], + "contexts": "all", "matches": [""] }, "experimental.accessibility": { @@ -250,18 +290,6 @@ "extension_types": ["platform_app"], "contexts": ["blessed_extension"] }, - "experimental.discovery": { - "dependencies": ["permission:experimental"], - "contexts": ["blessed_extension"] - }, - "experimental.history": { - "dependencies": ["permission:history", "permission:experimental"], - "contexts": ["blessed_extension"] - }, - "experimental.identity": { - "dependencies": ["permission:experimental"], - "contexts": ["blessed_extension"] - }, "extension": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], @@ -270,6 +298,22 @@ "extension.getURL": { "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, + "extension.getViews": [ + { + "channel": "stable", + "contexts": ["blessed_extension"], + "extension_types": ["extension", "legacy_packaged_app"] + }, + { + // TODO(yoz): Eliminate this usage. + "channel": "stable", + "contexts": ["blessed_extension"], + "extension_types": ["platform_app"], + "whitelist": [ + "A948368FC53BE437A55FEB414106E207925482F5" // File manager + ] + } + ], "extension.inIncognitoContext": { "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, @@ -300,6 +344,12 @@ "channel": "stable", "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, + "screenlockPrivate": { + "platforms": ["chromeos"], + "dependencies": ["permission:screenlockPrivate"], + "extension_types": ["platform_app"], + "contexts": ["blessed_extension", "unblessed_extension"] + }, "fileBrowserPrivate": { "platforms": ["chromeos"], "dependencies": ["permission:fileBrowserPrivate"], @@ -309,10 +359,23 @@ "dependencies": ["permission:fileSystem"], "contexts": ["blessed_extension"] }, + "fileSystemProvider": { + "dependencies": ["permission:fileSystemProvider"], + "contexts": ["blessed_extension"] + }, + "firstRunPrivate": { + "platforms": ["chromeos"], + "dependencies": ["permission:firstRunPrivate"], + "contexts": ["blessed_extension"] + }, "fontSettings": { "dependencies": ["permission:fontSettings"], "contexts": ["blessed_extension"] }, + "gcm": { + "dependencies": ["permission:gcm"], + "contexts": ["blessed_extension"] + }, "hangoutsPrivate": { "channel": "stable", "contexts": ["blessed_extension"], @@ -324,10 +387,18 @@ "eggnbpckecmjlblplehfpjjdhhidfdoj" ] }, + "hid": { + "dependencies": ["permission:hid"], + "contexts": ["blessed_extension"] + }, "history": { "dependencies": ["permission:history"], "contexts": ["blessed_extension"] }, + "hotwordPrivate": { + "dependencies": ["permission:hotwordPrivate"], + "contexts": ["blessed_extension"] + }, "i18n": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], @@ -337,11 +408,6 @@ "dependencies": ["permission:identity"], "contexts": ["blessed_extension"] }, - "identity.onSignInChanged": { - "channel": "dev", - "dependencies": ["permission:identity"], - "contexts": ["blessed_extension"] - }, "identityPrivate": { "dependencies": ["permission:identityPrivate"], "contexts": ["blessed_extension"] @@ -402,6 +468,11 @@ "dependencies": ["permission:mediaGalleries"], "contexts": ["blessed_extension"] }, + "mediaGalleries.getMetadata": { + "channel": "dev", + "dependencies": ["permission:mediaGalleries"], + "contexts": ["blessed_extension"] + }, "mediaGalleriesPrivate": { "dependencies": ["permission:mediaGalleriesPrivate"], "contexts": ["blessed_extension"] @@ -424,7 +495,7 @@ "contexts": ["blessed_extension"] }, "networkingPrivate": { - "platforms": ["chromeos"], + "platforms": ["chromeos", "mac", "win"], "dependencies": ["permission:networkingPrivate"], "contexts": ["blessed_extension"] }, @@ -451,8 +522,7 @@ "permissions": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], - "contexts": "all", - "matches": [""] + "contexts": ["blessed_extension"] }, "power": { "dependencies": ["permission:power"], @@ -487,6 +557,10 @@ "extension_types": ["platform_app"], "contexts": ["blessed_extension"] }, + "readingListPrivate": { + "dependencies": ["permission:readingListPrivate"], + "contexts": ["blessed_extension"] + }, "rtcPrivate": { "dependencies": ["permission:rtcPrivate"], "contexts": ["blessed_extension"] @@ -511,6 +585,7 @@ }, "runtime.lastError": { "contexts": "all", + "extension_types": "all", "matches": [""] }, "runtime.onConnect": { @@ -529,7 +604,7 @@ "contexts": "all", "matches": [""] }, - "runtime.setUninstallUrl": { + "runtime.setUninstallURL": { "channel": "dev", "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, @@ -555,17 +630,14 @@ }, "sockets.tcp": { "dependencies": ["manifest:sockets"], - "channel": "dev", "contexts": ["blessed_extension"] }, "sockets.tcpServer": { "dependencies": ["manifest:sockets"], - "channel": "dev", "contexts": ["blessed_extension"] }, "sockets.udp": { "dependencies": ["manifest:sockets"], - "channel": "dev", "contexts": ["blessed_extension"] }, "storage": { @@ -596,6 +668,10 @@ "dependencies": ["permission:system.memory"], "contexts": ["blessed_extension"] }, + "system.network": { + "dependencies": ["permission:system.network"], + "contexts": ["blessed_extension"] + }, "system.storage": { "dependencies": ["permission:system.storage"], "contexts": ["blessed_extension"] @@ -622,6 +698,7 @@ "contexts": ["blessed_extension"] }, "test": { + "internal": true, "channel": "stable", "extension_types": "all", "contexts": ["blessed_extension", "unblessed_extension", "content_script"] @@ -692,7 +769,7 @@ // Hosted apps can use the webstore API from within a blessed context. "channel": "stable", "extension_types": ["hosted_app"], - "contexts": ["blessed_extension", "web_page"], + "contexts": ["blessed_web_page", "web_page"], // Any webpage can use the webstore API. "matches": ["http://*/*", "https://*/*"] }, @@ -700,19 +777,15 @@ "dependencies": ["permission:webstorePrivate"], "contexts": ["blessed_extension"] }, - "webrtc.castSendTransport": { - "dependencies": ["permission:webrtc"], - "contexts": ["blessed_extension"] - }, - "webrtc.castUdpTransport": { - "dependencies": ["permission:webrtc"], - "contexts": ["blessed_extension"] - }, "webview": { "internal": true, "dependencies": ["permission:webview"], "contexts": ["blessed_extension", "unblessed_extension"] }, + "webViewRequest": { + "dependencies": ["permission:webview"], + "contexts": ["blessed_extension", "unblessed_extension"] + }, "webviewTag": { "internal": true, "channel": "stable", diff --git a/idl/_manifest_features.json b/idl/_manifest_features.json index 10045628..670bed0e 100644 --- a/idl/_manifest_features.json +++ b/idl/_manifest_features.json @@ -42,6 +42,10 @@ "channel": "stable", "extension_types": ["legacy_packaged_app", "hosted_app"] }, + "app.service_worker": { + "channel": "trunk", // When changing update tests: http://crbug.com/353209 + "extension_types": ["platform_app"] + }, "author": { "channel": "stable", "extension_types": "all" @@ -67,28 +71,61 @@ ], "max_manifest_version": 1 }, + "bluetooth": { + "channel": "dev", + "extension_types": ["platform_app"] + }, "browser_action": { "channel": "stable", "extension_types": ["extension"] }, - "chrome_settings_overrides": { + "chrome_settings_overrides": [{ "channel": "dev", - "extension_types": ["extension"] - }, - "chrome_url_overrides": { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"] - }, - "commands": { + "extension_types": ["extension"], + "platforms": ["win"] + }, { // TODO(wittman): remove this section for M37. "channel": "stable", "extension_types": ["extension"], - "min_manifest_version": 2 - }, - "commands.global": { + "whitelist": [ + "CB2E4E7174A398FCB3AFA6840500C2E1D22DA7B2", // Bookmark Manager + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444 + ] + }], + "chrome_ui_overrides": [{ "channel": "dev", + "extension_types": ["extension"] + }, { + "channel": "stable", "extension_types": ["extension"], - "min_manifest_version": 2 + "whitelist": [ + "CB2E4E7174A398FCB3AFA6840500C2E1D22DA7B2", // Bookmark Manager + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444 + ] + }], + "chrome_url_overrides": { + "channel": "stable", + "extension_types": ["extension", "legacy_packaged_app"] }, + "commands": [ + { + "channel": "dev", + "extension_types": ["platform_app"], + "min_manifest_version": 2 + }, { + "channel": "stable", + "extension_types": ["extension"], + "min_manifest_version": 2 + } + ], + "commands.global": [ + { + "channel": "dev", + "extension_types": ["extension", "platform_app"], + "min_manifest_version": 2 + } + ], "content_pack": { "channel": "dev", "extension_types": ["extension"] @@ -130,7 +167,7 @@ "display_in_launcher": [ { "channel": "stable", - "extension_types": ["legacy_packaged_app", "platform_app"], + "extension_types": ["legacy_packaged_app", "platform_app", "hosted_app"], "location": "component" }, { @@ -144,7 +181,7 @@ "display_in_new_tab_page": [ { "channel": "stable", - "extension_types": ["legacy_packaged_app", "platform_app"], + "extension_types": ["legacy_packaged_app", "platform_app", "hosted_app"], "location": "component" }, { @@ -161,7 +198,12 @@ "extension_types": ["shared_module"], "whitelist": [ "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", - "4EB74897CB187C7633357C2FE832E0AD6A44883A" + "4EB74897CB187C7633357C2FE832E0AD6A44883A", + // Next four: http://crbug.com/357213 + "mafeflapfdfljijmlienjedomfjfmhpd", + "ajchadodoajkaojdidnbblnfcdipbple", + "47F838F58D2A3B585DE50F29E3585D94999921D1", + "8EBAFB8DEB647EA2FC887A5E01EBD9BDC0FDC536" ] }, { @@ -175,10 +217,17 @@ "extension", "hosted_app", "legacy_packaged_app", "platform_app" ] }, - "file_browser_handlers": { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"] - }, + "file_browser_handlers": [ + { + "channel": "stable", + "extension_types": ["extension", "legacy_packaged_app"] + }, + { + "channel": "stable", + "extension_types": ["platform_app"], + "location": "component" + } + ], "file_handlers": { "channel": "stable", "extension_types": ["platform_app"] @@ -195,10 +244,17 @@ "channel": "stable", "extension_types": "all" }, - "incognito": { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"] - }, + "incognito": [ + { + "channel": "stable", + "extension_types": ["extension", "legacy_packaged_app"] + }, + { + "channel": "stable", + "extension_types": ["platform_app"], + "location": "component" + } + ], "input_components": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] @@ -235,7 +291,8 @@ "gbkeegbaiigmenfmjfclcdgdpimamgkj", // QuickOffice "ionpfmkccalenbmnddpbmocokhaknphg", // QuickOffice Dev "bpmcpldpdmajfigpchkicefoigmkfalc", // Quickoffice component extension - "ehibbfinohgbchlgdbfpikodjaojhccn" // Editor + "ehibbfinohgbchlgdbfpikodjaojhccn", // Editor + "mhjfbmdgcfjbbpaeojofohoefgiehjai" // PDF ] }, "minimum_chrome_version": { @@ -268,19 +325,11 @@ "whitelist": [ "mdbihdcgjmagbcapkhhkjbbdlkflmbfo", // unit_tests "pafkbggdmjlpgkdkcbjmhmfcdpncadgh", // Google Now - "hkhhlkdconhgemhegnplaldnmnmkaemd", // Get Started App "nmmhkkegccagdldgiimedpiccmgmieda", // In-app payments support app. "4B1D0E19C6C43C008C44A8278C8B5BFE15ABEB3C", "F7FA7ABC1ECB89BA8EE6656847EFABBF43BB9BCA", "1A26E32DE447A17CBE5E9750CDBA78F58539B39C", // TODO(rockot): Kill these. - "E61F841D8210B6A9891E5384CB665FBED31FCD7B", // http://crbug.com/281715 - // ------------------------- - "0F42756099D914A026DADFA182871C015735DD95", // These 6 IDs are for - "E7E2461CE072DF036CF9592740196159E2D7C089", // http://crbug.com/300087 - "A74A4D44C7CFCD8844830E6140C8D763E12DD8F3", - "312745D9BF916161191143F6490085EEA0434997", - "53041A2FA309EECED01FFC751E7399186E860B2C", - "2D22CDB6583FD0A13758AEBE8B15E45208B4E9A7" + "E61F841D8210B6A9891E5384CB665FBED31FCD7B" // http://crbug.com/281715 ] }, "offline_enabled": { @@ -354,7 +403,7 @@ "extension_types": "all" }, "sockets": { - "channel": "dev", + "channel": "stable", "extension_types": ["platform_app"] }, "spellcheck": { @@ -362,12 +411,7 @@ "extension_types": ["extension"] }, "storage": { - "channel": "dev", - "extension_types": ["extension", "legacy_packaged_app", "platform_app"], - "min_manifest_version": 2 - }, - "storage.managed_schema": { - "channel": "dev", + "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "min_manifest_version": 2 }, @@ -388,21 +432,28 @@ "extension_types": "all" }, "url_handlers": { - "channel": "dev", + "channel": "stable", "extension_types": ["platform_app"] }, "version": { "channel": "stable", "extension_types": "all" }, - "web_accessible_resources": { - "channel": "stable", - "extension_types": [ - "extension", "legacy_packaged_app", "hosted_app" - ] - }, + "web_accessible_resources": [ + { + "channel": "stable", + "extension_types": [ + "extension", "legacy_packaged_app", "hosted_app" + ] + }, + { + "channel": "stable", + "extension_types": ["platform_app"], + "location": "component" + } + ], "webview": { - "channel": "dev", + "channel": "stable", "extension_types": ["platform_app"], "min_manifest_version": 2 } diff --git a/idl/_permission_features.json b/idl/_permission_features.json index ca2ee0c1..751b945c 100644 --- a/idl/_permission_features.json +++ b/idl/_permission_features.json @@ -5,7 +5,24 @@ // See c/c/e/features/* to understand this file, in particular feature.h, // simple_feature.h, and base_feature_provider.h. +// To add a new whitelisted ID, SHA-1 it and force it to uppercase. In Bash: +// +// $ echo -n "aaaabbbbccccddddeeeeffffgggghhhh" | \ +// sha1sum | tr '[:lower:]' '[:upper:]' +// 9A0417016F345C934A1A88F55CA17C05014EEEBA - +// +// Google employees: please update http://go/chrome-api-whitelist to map +// hashes back to ids. + { + "accessibilityFeatures.modify": { + "channel": "dev", + "extension_types": ["extension", "platform_app"] + }, + "accessibilityFeatures.read": { + "channel": "dev", + "extension_types": ["extension", "platform_app"] + }, "activeTab": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], @@ -15,9 +32,11 @@ "channel": "stable", "extension_types": ["extension", "platform_app"], "whitelist": [ - "abjoigjokfeibfhiahiijggogladbmfm", // Watchdog Release - "hhcnncjlpehbepkbgccanfpkneoejnpb", // Watchdog Testing - "acldcpdepobcjbdanifkmfndkjoilgba" // Obsolete key + "EE17C698905F7F2E6DDC87C9C30F11E164C829F4", // Watchdog release + "90113DA9516526D24DAF156C629CC41C049E8882", // Watchdog testing + "A9EFD71948A480C87D3B7C758FD938215F445F00", // Obsolete + "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT. + "5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool Dev. ] }, "adview": { @@ -29,6 +48,22 @@ "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "min_manifest_version": 2 }, + "app.window.alwaysOnTop": { + "channel": "stable", + "extension_types": ["platform_app"] + }, + "app.window.fullscreen": { + "channel": "stable", + "extension_types": ["platform_app"] + }, + "app.window.fullscreen.overrideEsc": { + "channel": "stable", + "extension_types": ["platform_app"] + }, + "app.window.shape": { + "channel": "dev", + "extension_types": ["platform_app"] + }, "audio": [ { "channel": "dev", @@ -39,10 +74,17 @@ "extension_types": ["platform_app"], "whitelist": [ "8C3741E3AF0B93B6E8E0DDD499BB0B74839EA578", - "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" + "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB", + "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/335729 + "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/335729 + "307E96539209F95A1A8740C713E6998A73657D96" // http://crbug.com/335729 ] } ], + "automation": { + "channel": "trunk", + "extension_types": ["extension", "legacy_packaged_app", "platform_app"] + }, "autotestPrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], @@ -58,8 +100,10 @@ "extension_types": ["extension"], "whitelist": [ // http://crbug.com/292856 - "mppnpdlheglhdfmldimlhpnegondlapf", - "bepbmhgboaologfdajaanbcjmnhjmhfn" + "3F50C3A83839D9C76334BCE81CDEC06174F266AF", + "09FDCB5851B8F3378DB630D06E316076E89C95A6", + "39BE69F11F68E4EED080DA3DC2394F7885B7AFF9", + "FF78670081967CE21DB86A04AD94A0498F01E20A" ] } ], @@ -76,22 +120,21 @@ "whitelist": [ "5B5DA6D054D10DB917AF7D9EAE3C56044D1B0B03", // http://crbug.com/286542 "2843C1E82A9B6C6FB49308FDDF4E157B6B44BC2B", // http://crbug.com/286542 - "3F596D221126DCDFD115CFAA2E5A3141806358AD" // http://crbug.com/286542 + "3F596D221126DCDFD115CFAA2E5A3141806358AD", // http://crbug.com/286542 + "F7FA7ABC1ECB89BA8EE6656847EFABBF43BB9BCA", // http://crbug.com/320952 + "4B1D0E19C6C43C008C44A8278C8B5BFE15ABEB3C", // http://crbug.com/320952 + "4FE45FA56EF6A25FDE8C302C44045CA9CE8A605A" // http://crbug.com/320952 ] } ], - "bluetooth": { - "channel": "dev", - "extension_types": ["platform_app"] - }, - "bluetoothDevices": { - "channel": "dev", - "extension_types": ["platform_app"] - }, "bookmarkManagerPrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], - "location": "component" + "whitelist": [ + "CB2E4E7174A398FCB3AFA6840500C2E1D22DA7B2", // Bookmark Manager + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444 + ] }, "bookmarks": { "channel": "stable", @@ -110,21 +153,25 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "whitelist": [ - "enhhojjnijigcajfphajepfemndkmdlo", // Dev - "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Trusted Tester - "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging - "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary + "63ED55E43214C211F82122ED56407FF1A807F2A3", // Dev + "226CF815E39A363090A1E547D53063472B8279FA", // Trusted Tester + "FA01E0B81978950F2BC5A50512FD769725F57510", // Staging + "B11A93E7E5B541F8010245EBDE2C74647D6C14B9", // Canary "F155646B5D1CA545F7E1E4E20D573DFDD44C2540", // Trusted Tester (public) "16CA7A47AAE4BE49B1E75A6B960C3875E945B264" // Release ] }, + "cast.streaming": { + "channel": "dev", + "extension_types": ["extension"] + }, "chromePrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], "whitelist": [ - "haiffjcadagjlijoggckpgfnoeiflnem", // Citrix Receiver - "gnedhmakppccajfpfiihfcdlnpgomkcf", // Citrix Receiver Beta - "fjcibdnjlbfnbfdjneajpipnlcppleek" // Citrix Receiver Dev + "2462D64ACB971A7E708757159C2B17761D4FF54A", // Citrix Receiver + "3010EF507AFEF487EEA9CDE2930EC94867C60936", // Citrix Receiver Beta + "ABAABC5F49E022A76CBB12972A53B58354C04AC6" // Citrix Receiver Dev ] }, "chromeosInfoPrivate": { @@ -134,7 +181,18 @@ "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/293683 "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/293683 "8C3741E3AF0B93B6E8E0DDD499BB0B74839EA578", // http://crbug.com/234235 - "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" // http://crbug.com/234235 + "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB", // http://crbug.com/234235 + "307E96539209F95A1A8740C713E6998A73657D96", // http://crbug.com/329690 + "A291B26E088FA6BA53FFD72F0916F06EBA7C585A", // http://crbug.com/341258 + "D7986543275120831B39EF28D1327552FC343960", // http://crbug.com/329088 + // TODO(tbarzic): Remove the following six when http://crbug.com/346572 + // gets fixed. + "63ED55E43214C211F82122ED56407FF1A807F2A3", // http://crbug.com/343701 + "226CF815E39A363090A1E547D53063472B8279FA", // http://crbug.com/343701 + "FA01E0B81978950F2BC5A50512FD769725F57510", // http://crbug.com/343701 + "B11A93E7E5B541F8010245EBDE2C74647D6C14B9", // http://crbug.com/343701 + "F155646B5D1CA545F7E1E4E20D573DFDD44C2540", // http://crbug.com/343701 + "16CA7A47AAE4BE49B1E75A6B960C3875E945B264" // http://crbug.com/343701 ] }, "clipboardRead": { @@ -151,9 +209,9 @@ }, "cloudPrintPrivate": { "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], + "extension_types": ["extension", "legacy_packaged_app", "hosted_app"], // CloudPrint - "whitelist": ["mfehgcgbbipciphmccgaenjidiccnmng"] + "whitelist": ["99060B01DE911EB85FD630C8BA6320C9186CA3AB"] }, "commandLinePrivate": { "channel": "stable", @@ -181,26 +239,39 @@ "channel": "stable", "extension_types": ["platform_app"], "whitelist": [ - "mlocfejafidcakdddnndjdngfmncfbeg", // CCD Development - "ganomidahfnpdchomfgdoppjmmedlhia", // CCD Testing - "eemlkeanncmjljgehlbplemhmdmalhdc" // CCD Release + "7AE714FFD394E073F0294CFA134C9F91DB5FBAA4", // CCD Development + "C7DA3A55C2355F994D3FDDAD120B426A0DF63843", // CCD Testing + "75E3CFFFC530582C583E4690EF97C70B9C8423B7" // CCD Release + ] + } + ], + "debugger": [ + { + "channel": "stable", + "extension_types": ["extension", "legacy_packaged_app"] + }, + { + "channel": "stable", + "extension_types": ["platform_app"], + "whitelist": [ + "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT. + // TODO(grv): clean up once Apps developer tool is published. + "5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool. ] } ], - "debugger": { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"] - }, "developerPrivate": { "channel": "stable", "extension_types": ["platform_app"], "whitelist": [ - "ohmmkhmmmpcnpikjeljgnaoabkaalbgc", // Published Apps developer tool. + "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT. // TODO(grv): clean up once Apps developer tool is published. - "lphgohfeebnhcpiohjndkgbhhkoapkjc", // Apps Developer tool. - "gonnpeheodhmhdjiimoiheniambmdcco", // Apps Editor old. + "5107DE9024C329EEA9C9A72D94C16723790C6422", // Apps Developer Tool. + "8C0B1873FFFB65E4D0F4D772879F7304CEF125C2", // Apps Editor old. // TODO(grv) : clean up once after publish. - "cbelnpbjogfbjamhpbofhlnklecjpido" // Apps Editor published. + "FA0501B579070BB9CBD4FCAEC8CB0EDF22BA2F04", // Apps Editor published. + "4A4EA121622FCA3D78ED2AB534197F43D7189EE0", // Spark nightly build + "9FDE6E7F06FCFA11D9A05041C7FF6D8AE662F5D1" // Spark release ] }, "devtools": { @@ -208,36 +279,19 @@ "extension_types": ["extension", "legacy_packaged_app"] }, "declarativeContent": { - "channel": "trunk", + "channel": "stable", "extension_types": ["extension"] }, "declarativeWebRequest": [ { "channel": "beta", "extension_types": ["extension", "legacy_packaged_app"] - }, - { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], - // Legacy Browser Support (remove once this API hits stable). - "whitelist": ["heildphpnddilhkemkielfhnkaagiabh"] - } - ], - "desktopCapture": [ - { - "channel": "dev", - "extension_types": ["extension", "platform_app"] - }, - { - "channel": "stable", - "extension_types": ["extension", "platform_app"], - "whitelist": [ - "80B9DC58E5210749F052F5B4DB239C50CF72AEB6", - // Hangout Services component extension. - "nkeimhogjdpnpccoofpliimaahmaaome" - ] } ], + "desktopCapture": { + "channel": "stable", + "extension_types": ["extension", "platform_app"] + }, "dns": [ { "channel": "dev", @@ -247,12 +301,22 @@ "channel": "stable", "extension_types": ["extension", "platform_app"], "whitelist": [ - "mlocfejafidcakdddnndjdngfmncfbeg", // CCD Development - "ganomidahfnpdchomfgdoppjmmedlhia", // CCD Testing - "eemlkeanncmjljgehlbplemhmdmalhdc" // CCD Release + "7AE714FFD394E073F0294CFA134C9F91DB5FBAA4", // CCD Development + "C7DA3A55C2355F994D3FDDAD120B426A0DF63843", // CCD Testing + "75E3CFFFC530582C583E4690EF97C70B9C8423B7" // CCD Release ] } ], + "screenlockPrivate": { + "channel": "stable", + "extension_types":["platform_app"], + "whitelist": [ + "lkegkdgachcnekllcdfkijonogckdnjo", // API test + "190C131D270994E7330E9A3CD48224061CB10E2D", // dogfood 1 + "7FDDD1C0CB0052596657FDEC92841D509DC8D404", // dogfood 2 + "E13990DC5440B6E270503DA27A35762F423725C3" // dogfood 3 + ] + }, "downloads": { "channel": "stable", "extension_types": ["extension"] @@ -269,9 +333,9 @@ "channel": "stable", "extension_types": ["extension"], "whitelist": [ - "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Trusted Tester - "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging - "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary + "226CF815E39A363090A1E547D53063472B8279FA", // Trusted Tester + "FA01E0B81978950F2BC5A50512FD769725F57510", // Staging + "B11A93E7E5B541F8010245EBDE2C74647D6C14B9", // Canary "F155646B5D1CA545F7E1E4E20D573DFDD44C2540", // Trusted Tester (public) "16CA7A47AAE4BE49B1E75A6B960C3875E945B264" // Release ] @@ -280,8 +344,8 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], "whitelist": [ - "inmdanhiiibfpdlljnjjbchhjgelojnn", // Dogfood - "cbpmgnfekbgbgpkmokfppmldaccjcbnb" // Test + "657FEC7E77355CA205B0E226586621F86B33F611", // Dogfood + "5894126C625EF31852F215ED301A5FF1F9B7D026" // Test ] }, "experimental": { @@ -298,7 +362,8 @@ "1C93BD3CF875F4A73C0B2A163BB8FBDA8B8B3D80", // http://crbug.com/293683 "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/293683 "8C3741E3AF0B93B6E8E0DDD499BB0B74839EA578", // http://crbug.com/234235 - "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB" // http://crbug.com/234235 + "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB", // http://crbug.com/234235 + "307E96539209F95A1A8740C713E6998A73657D96" // http://crbug.com/329690 ] }, "fileBrowserHandler": { @@ -307,7 +372,7 @@ }, "fileBrowserPrivate": { "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], + "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "location": "component" }, "fileSystem": [{ @@ -316,7 +381,11 @@ },{ "channel": "stable", "extension_types": ["extension"], - "whitelist": [ "2FC374607C2DF285634B67C64A2E356C607091C3" ] + "whitelist": [ + "2FC374607C2DF285634B67C64A2E356C607091C3", // Quickoffice + "3727DD3E564B6055387425027AD74C58784ACC15", // Quickoffice internal + "12E618C3C6E97495AAECF2AC12DEB082353241C6" // QO component extension + ] }], "fileSystem.directory": [{ "channel": "stable", @@ -332,15 +401,28 @@ },{ "channel": "stable", "extension_types": ["extension"], - "whitelist": [ "2FC374607C2DF285634B67C64A2E356C607091C3" ] + "whitelist": [ + "2FC374607C2DF285634B67C64A2E356C607091C3", // Quickoffice + "3727DD3E564B6055387425027AD74C58784ACC15", // Quickoffice internal + "12E618C3C6E97495AAECF2AC12DEB082353241C6" // QO component extension + ] }], + "fileSystemProvider": { + "channel": "trunk", + "extension_types": ["platform_app"] + }, + "firstRunPrivate": { + "channel": "stable", + "extension_types": ["platform_app"], + "location": "component" + }, "fontSettings": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] }, - "fullscreen": { - "channel": "stable", - "extension_types": ["platform_app"] + "gcm": { + "channel": "dev", + "extension_types": ["extension", "platform_app"] }, "geolocation": { "channel": "stable", @@ -348,10 +430,22 @@ "extension", "legacy_packaged_app", "hosted_app", "platform_app" ] }, + "hid": { + "channel": "dev", + "extension_types": ["platform_app"] + }, "history": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] }, + "hotwordPrivate": { + "channel": "stable", + "extension_types": ["extension"], + "whitelist": [ + "8CE39F175D076AD6BDF7CBF418F2409558B367E3", // hotword_helper + "09FDCB5851B8F3378DB630D06E316076E89C95A6" // hotword nacl + ] + }, "identity": { "channel": "stable", "extension_types": ["extension", "platform_app"] @@ -359,7 +453,7 @@ "identityPrivate": { "channel": "stable", "extension_types": [ - "legacy_packaged_app" + "legacy_packaged_app", "platform_app" ], "location": "component" }, @@ -384,11 +478,11 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "whitelist": [ - "haiffjcadagjlijoggckpgfnoeiflnem", // Citrix Receiver - "gnedhmakppccajfpfiihfcdlnpgomkcf", // Citrix Receiver Beta - "fjcibdnjlbfnbfdjneajpipnlcppleek", // Citrix Receiver Dev - "pnhechapfaindjhompbnflcldabbghjo", // HTerm - "okddffdblfhhnmhodogpojmfkjmhinfp" // HTerm dev + "2462D64ACB971A7E708757159C2B17761D4FF54A", // Citrix Receiver + "3010EF507AFEF487EEA9CDE2930EC94867C60936", // Citrix Receiver Beta + "ABAABC5F49E022A76CBB12972A53B58354C04AC6", // Citrix Receiver Dev + "0EA6B717932AD64C469C1CCB6911457733295907", // HTerm + "58B0C2968C335964D5433E89CA4D86628A0E3D4B" // HTerm dev ] },{ "channel": "stable", @@ -424,13 +518,22 @@ "channel": "stable", "extension_types": ["platform_app"], "whitelist": [ - "ohmmkhmmmpcnpikjeljgnaoabkaalbgc", // Published Apps developer tool. - // TODO(grv): clean up once Apps developer tool is published. - "lphgohfeebnhcpiohjndkgbhhkoapkjc", // Apps Developer tool. - "gonnpeheodhmhdjiimoiheniambmdcco", // Apps Editor old. - "cbelnpbjogfbjamhpbofhlnklecjpido", // Apps Editor published. - "abjoigjokfeibfhiahiijggogladbmfm", // Watchdog (Activity Log) - "hhcnncjlpehbepkbgccanfpkneoejnpb" // Watchdog Test Version + "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT + // TODO(grv): clean up once Apps developer tool is published. + "5107DE9024C329EEA9C9A72D94C16723790C6422", // Apps Developer Tool. + "8C0B1873FFFB65E4D0F4D772879F7304CEF125C2", // Apps Editor old. + "FA0501B579070BB9CBD4FCAEC8CB0EDF22BA2F04", // Apps Editor published. + "EE17C698905F7F2E6DDC87C9C30F11E164C829F4", // Watchdog (Activity Log) + "90113DA9516526D24DAF156C629CC41C049E8882", // Watchdog Test Version + "4A4EA121622FCA3D78ED2AB534197F43D7189EE0", // Spark nightly build + "9FDE6E7F06FCFA11D9A05041C7FF6D8AE662F5D1" // Spark release + ] + }, + { + "channel": "stable", + "extension_types": ["hosted_app"], + "whitelist": [ + "B44D08FD98F1523ED5837D78D0A606EA9D6206E5" // Web Store ] } ], @@ -442,6 +545,10 @@ "channel": "stable", "extension_types": [ "platform_app" ] }, + "mediaGalleries.scan": { + "channel": "dev", + "extension_types": [ "platform_app" ] + }, "mediaGalleries.read": { "channel": "stable", "extension_types": [ "platform_app" ] @@ -450,22 +557,23 @@ "channel": "stable", "extension_types": [ "platform_app" ] }, - // TODO(thestig) Remove this as part of http://crbug.com/144496 + "mediaGalleries.delete": { + "channel": "stable", + "extension_types": [ "platform_app" ] + }, + // TODO(thestig) Remove this as part of http://crbug.com/166950 "mediaGalleriesPrivate": { "channel": "stable", "extension_types": [ "platform_app" ], "whitelist": [ - "dhgjflpimlbndbpamnkoepaacagejgda", - "5B5DA6D054D10DB917AF7D9EAE3C56044D1B0B03", // http://crbug.com/286542 - "2843C1E82A9B6C6FB49308FDDF4E157B6B44BC2B", // http://crbug.com/286542 - "3F596D221126DCDFD115CFAA2E5A3141806358AD", // http://crbug.com/286542 + "4B1D0E19C6C43C008C44A8278C8B5BFE15ABEB3C", "F7FA7ABC1ECB89BA8EE6656847EFABBF43BB9BCA", "4FE45FA56EF6A25FDE8C302C44045CA9CE8A605A" ] }, "mediaPlayerPrivate": { "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], + "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "location": "component" }, "metricsPrivate": { @@ -477,26 +585,28 @@ // whitelist. // Adding it to this whitelist documents their dependency, however, and // also doesn't hurt anything. - "hhaomjibdihmijegdhdafkllkbggdgoj", // File manager - "gbkeegbaiigmenfmjfclcdgdpimamgkj", // Quickoffice - "ionpfmkccalenbmnddpbmocokhaknphg", // Quickoffice dev - "bpmcpldpdmajfigpchkicefoigmkfalc", // Quickoffice component extension - "ehibbfinohgbchlgdbfpikodjaojhccn", // Editor - "pafkbggdmjlpgkdkcbjmhmfcdpncadgh", // Google Now - "khopmbdjffemhegeeobelklnbglcdgfh", // RU-NTP - "mlocfejafidcakdddnndjdngfmncfbeg", // CCD Development - "ganomidahfnpdchomfgdoppjmmedlhia", // CCD Testing - "eemlkeanncmjljgehlbplemhmdmalhdc" // CCD Release + "A948368FC53BE437A55FEB414106E207925482F5", // File manager + "2FC374607C2DF285634B67C64A2E356C607091C3", // Quickoffice + "3727DD3E564B6055387425027AD74C58784ACC15", // Quickoffice internal + "12E618C3C6E97495AAECF2AC12DEB082353241C6", // QO component extension + "3727DD3E564B6055387425027AD74C58784ACC15", // Editor + "C41AD9DCD670210295614257EF8C9945AD68D86E", // Google Now + "6EEEA7775E79C735E4BA1F24DBB191BDACB1262C", // RU-NTP + "7AE714FFD394E073F0294CFA134C9F91DB5FBAA4", // CCD Development + "C7DA3A55C2355F994D3FDDAD120B426A0DF63843", // CCD Testing + "75E3CFFFC530582C583E4690EF97C70B9C8423B7", // CCD Release + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900. + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444. ] }, "mdns": { "channel": "stable", "extension_types": ["extension"], "whitelist": [ - "enhhojjnijigcajfphajepfemndkmdlo", // Dev - "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Trusted Tester - "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging - "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary + "63ED55E43214C211F82122ED56407FF1A807F2A3", // Dev + "226CF815E39A363090A1E547D53063472B8279FA", // Trusted Tester + "FA01E0B81978950F2BC5A50512FD769725F57510", // Staging + "B11A93E7E5B541F8010245EBDE2C74647D6C14B9", // Canary "F155646B5D1CA545F7E1E4E20D573DFDD44C2540", // Trusted Tester (public) "16CA7A47AAE4BE49B1E75A6B960C3875E945B264" // Release ] @@ -525,14 +635,15 @@ "A3BC37E2148AC4E99BE4B16AF9D42DD1E592BBBE", // http://crbug.com/293683 "8C3741E3AF0B93B6E8E0DDD499BB0B74839EA578", // http://crbug.com/234235 "E703483CEF33DEC18B4B6DD84B5C776FB9182BDB", // http://crbug.com/234235 - "pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Trusted Tester - "fmfcbgogabcbclcofgocippekhfcmgfj", // Staging - "hfaagokkkhdbgiakmmlclaapfelnkoah", // Canary + "307E96539209F95A1A8740C713E6998A73657D96", // http://crbug.com/329690 + "226CF815E39A363090A1E547D53063472B8279FA", // Trusted Tester + "FA01E0B81978950F2BC5A50512FD769725F57510", // Staging + "B11A93E7E5B541F8010245EBDE2C74647D6C14B9", // Canary "F155646B5D1CA545F7E1E4E20D573DFDD44C2540", // Trusted Tester (public) "16CA7A47AAE4BE49B1E75A6B960C3875E945B264", // Release - "mlocfejafidcakdddnndjdngfmncfbeg", // CCD Development - "ganomidahfnpdchomfgdoppjmmedlhia", // CCD Testing - "eemlkeanncmjljgehlbplemhmdmalhdc" // CCD Release + "7AE714FFD394E073F0294CFA134C9F91DB5FBAA4", // CCD Development + "C7DA3A55C2355F994D3FDDAD120B426A0DF63843", // CCD Testing + "75E3CFFFC530582C583E4690EF97C70B9C8423B7" // CCD Release ] }, "notifications": { @@ -549,7 +660,7 @@ }, "echoPrivate": { "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], + "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "location": "component" }, "pageCapture": { @@ -575,13 +686,17 @@ "extension_types": [ "extension" ], - "location": "component" + "whitelist": [ + "C41AD9DCD670210295614257EF8C9945AD68D86E", // Google Now + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444 + ] }, "principalsPrivate": { "channel": "stable", "extension_types": ["extension"], "whitelist": [ - "dofmkfphhdaddeofjngcjphcegkbbooh" // Chrome Login Proxy (prototype) + "2779FA8B45841D61A37207CCFAC9CB393964FE5B" // Login Proxy (prototype) ] }, "privacy": { @@ -604,18 +719,26 @@ "channel": "stable", "extension_types": ["platform_app"], "whitelist": [ - "jobolcahaebjkjhdedcfcnfkgpjcmkcg", // Dev version - "D7986543275120831B39EF28D1327552FC343960" // Release version + "A291B26E088FA6BA53FFD72F0916F06EBA7C585A", // http://crbug.com/329088 + "D7986543275120831B39EF28D1327552FC343960" // http://crbug.com/329088 + ] + }, + "readingListPrivate": { + "channel": "stable", + "extension_types": ["extension"], + "whitelist": [ + "D5736E4B5CF695CB93A2FB57E4FDC6E5AFAB6FE2", // http://crbug.com/312900 + "D57DE394F36DC1C3220E7604C575D29C51A6C495" // http://crbug.com/319444 ] }, "rtcPrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], "whitelist": [ - "nckgahadagoaajjgafhacjanaoiihapd", // Google Talk prod - "eggnbpckecmjlblplehfpjjdhhidfdoj", // Google Talk beta - "ppleadejekpmccmnpjdimmlfljlkdfej", // Google Talk alpha - "ljclpkphhpbpinifbeabbhlfddcpfdde" // Google Talk debug + "53041A2FA309EECED01FFC751E7399186E860B2C", // Google Talk prod + "A74A4D44C7CFCD8844830E6140C8D763E12DD8F3", // Google Talk beta + "E7E2461CE072DF036CF9592740196159E2D7C089", // Google Talk alpha + "312745D9BF916161191143F6490085EEA0434997" // Google Talk debug ] }, // Note: runtime is not actually a permission, but some systems check these @@ -644,11 +767,12 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "whitelist": [ - "oickdpebdnfbgkcaoklfcdhjniefkcji", // browser_tests - "gbkeegbaiigmenfmjfclcdgdpimamgkj", // QuickOffice - "ionpfmkccalenbmnddpbmocokhaknphg", // QuickOffice Dev - "bpmcpldpdmajfigpchkicefoigmkfalc", // Quickoffice component extension - "ehibbfinohgbchlgdbfpikodjaojhccn" // Editor + "787000072C6FBB934AF5A42275CDE73FC977D995", // browser_tests + "2FC374607C2DF285634B67C64A2E356C607091C3", // QuickOffice + "5D3851BEFF680AB6D954B76678EFCCE834465C23", // QuickOffice Dev + "12E618C3C6E97495AAECF2AC12DEB082353241C6", // QO component extension + "3727DD3E564B6055387425027AD74C58784ACC15", // Editor + "CBCC42ABED43A4B58FE3810E62AFFA010EB0349F" // PDF ] }, "socket": [{ @@ -661,13 +785,9 @@ // The connectivity diagnostic utility is a component extension that is // used to try to provide suggestions on how to fix connection issues. It // should be the only non-app allowed to use the socket API. - "kodldpbjkkmmnilagfdheibampofhaom" + "32A1BA997F8AB8DE29ED1BA94AAF00CF2A3FEFA7" ] }], - "sockets.udp": { - "channel": "dev", - "extension_types": ["platform_app"] - }, "syncFileSystem": { "channel": "stable", "extension_types": ["platform_app"] @@ -689,6 +809,10 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"] }, + "system.network": { + "channel": "stable", + "extension_types": ["platform_app"] + }, "system.storage": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"] @@ -702,10 +826,21 @@ "extension_types": ["extension", "legacy_packaged_app"], "location": "component" }, - "tabs": { - "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"] - }, + "tabs": [ + { + "channel": "stable", + "extension_types": ["extension", "legacy_packaged_app"] + }, + { + "channel": "stable", + "extension_types": ["platform_app"], + "whitelist": [ + "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT. + // TODO(grv): clean up once Apps developer tool is published. + "5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool. + ] + } + ], "tabCapture": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] @@ -714,8 +849,8 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "whitelist": [ - "pnhechapfaindjhompbnflcldabbghjo", // HTerm - "okddffdblfhhnmhodogpojmfkjmhinfp" // HTerm dev + "0EA6B717932AD64C469C1CCB6911457733295907", // HTerm + "58B0C2968C335964D5433E89CA4D86628A0E3D4B" // HTerm dev ] }, "topSites": { @@ -754,15 +889,16 @@ "extension_types": ["extension"], "whitelist": [ // http://crbug.com/292856 - "mppnpdlheglhdfmldimlhpnegondlapf", - "bepbmhgboaologfdajaanbcjmnhjmhfn" + "3F50C3A83839D9C76334BCE81CDEC06174F266AF", + "09FDCB5851B8F3378DB630D06E316076E89C95A6", + "A434B90223C3C52F2B69DB494736B63C612C774D" ] } ], "virtualKeyboardPrivate": { "channel": "stable", "whitelist": [ - "mppnpdlheglhdfmldimlhpnegondlapf" // System-level virtual keyboard. + "3F50C3A83839D9C76334BCE81CDEC06174F266AF" // System-level virtual kbd ], "extension_types": ["extension"] }, @@ -779,19 +915,15 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] }, - "webrtc": { - "channel": "dev", - "extension_types": ["extension"] - }, "webrtcAudioPrivate": { "channel": "stable", "extension_types": ["extension"], "whitelist": [ "80B9DC58E5210749F052F5B4DB239C50CF72AEB6", // Hangout Services component extension. - "nkeimhogjdpnpccoofpliimaahmaaome", + "DF84F03F9B960409CCDE0D895B9650EBE81C0A8E", // Extension used for API test. - "knldjmfmopnpolahpmmgbagdohdnhkik" + "ADFA45434ABA2F1A4647E673F53FF37F8F6047A3" ] }, "webrtcLoggingPrivate": { @@ -800,16 +932,16 @@ "whitelist": [ "80B9DC58E5210749F052F5B4DB239C50CF72AEB6", // Hangout Services component extension. - "nkeimhogjdpnpccoofpliimaahmaaome" + "DF84F03F9B960409CCDE0D895B9650EBE81C0A8E" ] }, "webstorePrivate": { "channel": "stable", - "extension_types": ["extension", "legacy_packaged_app"], + "extension_types": ["extension", "legacy_packaged_app", "hosted_app"], "whitelist": [ - "ahfgeienlihckogmohjhadlkjgocpleb", // Web Store - "afchcafgojfnemjkcbhfekplkmjaldaa", // Enterprise Web Store - "dofmkfphhdaddeofjngcjphcegkbbooh" // Chrome Login Proxy (prototype) + "B44D08FD98F1523ED5837D78D0A606EA9D6206E5", // Web Store + "2653F6F6C39BC6EEBD36A09AFB92A19782FF7EB4", // Enterprise Web Store + "2779FA8B45841D61A37207CCFAC9CB393964FE5B" // Login Proxy (prototype) ] }, "webRequest": { @@ -831,7 +963,7 @@ "extension_types": ["extension"], "location": "component", "whitelist": [ - "mfffpogegjflfpflabcdkioaeobkgjik" // GAIA Component Extension + "D519188F86D9ACCEE0412007B227D9936EB9676B" // GAIA Component Extension ] }] } diff --git a/idl/accessibility_features.json b/idl/accessibility_features.json new file mode 100644 index 00000000..495a0fbc --- /dev/null +++ b/idl/accessibility_features.json @@ -0,0 +1,48 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[ + { + "namespace": "accessibilityFeatures", + "platforms": ["chromeos"], + "description": "Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission.", + "properties": { + "spokenFeedback": { + "$ref": "types.ChromeSetting", + "description": "Spoken feedback (text-to-speech). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["spokenFeedback", {"type": "boolean"}] + }, + "largeCursor": { + "$ref": "types.ChromeSetting", + "description": "Enlarged cursor. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["largeCursor", {"type": "boolean"}] + }, + "stickyKeys": { + "$ref": "types.ChromeSetting", + "description": "Sticky modifier keys (like shift or alt). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["stickyKeys", {"type": "boolean"}] + }, + "highContrast": { + "$ref": "types.ChromeSetting", + "description": "High contrast rendering mode. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["highContrast", {"type": "boolean"}] + }, + "screenMagnifier": { + "$ref": "types.ChromeSetting", + "description": "Full screen magnification. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["screenMagnifier", {"type": "boolean"}] + }, + "autoclick": { + "$ref": "types.ChromeSetting", + "description":"Auto mouse click after mouse stops moving. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["autoclick", {"type": "boolean"}] + }, + "virtualKeyboard": { + "$ref": "types.ChromeSetting", + "description": "Virtual on-screen keyboard. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.", + "value": ["virtualKeyboard", {"type": "boolean"}] + } + } + } +] diff --git a/idl/activity_log_private.json b/idl/activity_log_private.json index e912874b..39b30868 100644 --- a/idl/activity_log_private.json +++ b/idl/activity_log_private.json @@ -12,6 +12,7 @@ "type": "object", "description": "This corresponds to a row from the ActivityLog database. Fields will be blank if they were specified precisely in a lookup filter.", "properties": { + "activityId": {"type": "string", "optional": true, "description": "An ID of a row in the ActivityLog database that corresponds to the activity. ID is set only on activities retrieved from the database."}, "extensionId": {"type": "string", "optional": true}, "activityType": {"type": "string", "enum": ["api_call", "api_event", "content_script", "dom_access", "dom_event", "web_request"]}, "time": {"type": "number", "optional": true}, @@ -78,6 +79,19 @@ } ] }, + { + "name": "deleteActivities", + "type": "function", + "description": "Deletes activities in the ActivityLog database specified in the array of activity IDs.", + "parameters": [ + { + "name": "activityIds", + "type": "array", + "items": { "type": "string" }, + "description": "Erases only the activities which IDs are listed in the array." + } + ] + }, { "name": "deleteDatabase", "type": "function", diff --git a/idl/alarms.idl b/idl/alarms.idl index 3b218e0f..55349be1 100644 --- a/idl/alarms.idl +++ b/idl/alarms.idl @@ -42,6 +42,7 @@ namespace alarms { callback AlarmCallback = void (Alarm alarm); callback AlarmListCallback = void (Alarm[] alarms); + callback ClearCallback = void (boolean wasCleared); interface Functions { // Creates an alarm. Near the time(s) specified by alarmInfo, @@ -81,10 +82,10 @@ namespace alarms { // Clears the alarm with the given name. // |name|: The name of the alarm to clear. Defaults to the empty string. - static void clear(optional DOMString name); + static void clear(optional DOMString name, optional ClearCallback callback); // Clears all alarms. - static void clearAll(); + static void clearAll(optional ClearCallback callback); }; interface Events { diff --git a/idl/api.gyp b/idl/api.gyp index 2fbab8f3..fdfc3e74 100644 --- a/idl/api.gyp +++ b/idl/api.gyp @@ -5,7 +5,7 @@ { 'targets': [ { - 'target_name': 'api', + 'target_name': 'chrome_api', 'type': 'static_library', 'sources': [ '<@(schema_files)', @@ -29,7 +29,6 @@ 'infobars.json', 'media_player_private.json', 'music_manager_private.idl', - 'preferences_private.json', 'principals_private.idl', 'top_sites.json', ], @@ -42,6 +41,8 @@ 'app_runtime.idl', 'app_window.idl', 'audio.idl', + 'automation_internal.idl', + 'automation.idl', 'autotest_private.idl', 'bluetooth.idl', 'bookmark_manager_private.json', @@ -52,27 +53,28 @@ 'command_line_private.json', 'content_settings.json', 'context_menus.json', + 'context_menus_internal.json', 'cookies.json', 'debugger.json', 'desktop_capture.json', 'developer_private.idl', 'dial.idl', - 'dns.idl', 'downloads.idl', 'downloads_internal.idl', 'echo_private.json', 'enterprise_platform_keys_private.json', 'events.json', 'experimental_accessibility.json', - 'experimental_discovery.idl', - 'experimental_history.json', - 'experimental_identity.idl', 'feedback_private.idl', - 'file_browser_private.json', + 'file_browser_private.idl', 'file_system.idl', + 'file_system_provider.idl', 'font_settings.json', + 'gcm.json', 'hangouts_private.idl', + 'hid.idl', 'history.json', + 'hotword_private.idl', 'i18n.json', 'identity.idl', 'identity_private.idl', @@ -91,28 +93,28 @@ 'omnibox.json', 'page_capture.json', 'permissions.json', + 'preferences_private.json', 'power.idl', 'push_messaging.idl', + 'reading_list_private.json', 'runtime.json', 'serial.idl', 'sessions.json', 'signed_in_devices.idl', - 'socket.idl', - 'sockets_tcp.idl', - 'sockets_tcp_server.idl', - 'sockets_udp.idl', - 'storage.json', + 'streams_private.idl', 'sync_file_system.idl', 'system_cpu.idl', 'system_display.idl', 'system_indicator.idl', 'system_memory.idl', + 'system_network.idl', 'system_private.json', 'system_storage.idl', 'tab_capture.idl', 'tabs.json', 'terminal_private.json', 'test.json', + 'types.json', 'usb.idl', 'virtual_keyboard_private.json', 'web_navigation.json', @@ -121,6 +123,7 @@ # WebRTC-specific bits and as such does not belong in # the enable_webrtc=0 section below. 'webrtc_audio_private.idl', + 'webrtc_logging_private.idl', 'webstore_private.json', 'webview.json', 'windows.json', @@ -141,10 +144,11 @@ 'omnibox.json', 'permissions.json', 'runtime.json', - 'storage.json', 'sync_file_system.idl', 'tab_capture.idl', 'tabs.json', + 'types.json', + 'webview.json', 'web_navigation.json', 'web_request.json', 'windows.json', @@ -152,18 +156,21 @@ }], ['chromeos==1', { 'schema_files': [ + 'accessibility_features.json', 'diagnostics.idl', 'file_browser_handler_internal.json', + 'first_run_private.json', 'log_private.idl', + 'screenlock_private.idl', 'wallpaper.json', 'wallpaper_private.json', ], }], ['enable_webrtc==1', { 'schema_files': [ - 'webrtc_cast_send_transport.idl', - 'webrtc_cast_udp_transport.idl', - 'webrtc_logging_private.idl', + 'cast_streaming_rtp_stream.idl', + 'cast_streaming_session.idl', + 'cast_streaming_udp_transport.idl', ], }], ], @@ -171,6 +178,7 @@ 'root_namespace': 'extensions::api', }, 'dependencies': [ + '<(DEPTH)/content/content.gyp:content_browser', '<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/sync/sync.gyp:sync', ], diff --git a/idl/app_current_window_internal.idl b/idl/app_current_window_internal.idl index 69996360..e8e14f49 100644 --- a/idl/app_current_window_internal.idl +++ b/idl/app_current_window_internal.idl @@ -6,9 +6,7 @@ // the shell window. [nodoc] namespace app.currentWindowInternal { - // TODO(asargent) - We need to add support for referencing types in - // other namespaces (crbug.com/158654). For now just duplicate this - // dictionary from app.window. + // Null or undefined indicates that a value should not change. dictionary Bounds { long? left; long? top; @@ -16,6 +14,15 @@ long? height; }; + // Null or undefined indicates that a value should not change. A value of 0 + // will clear the constraints. + dictionary SizeConstraints { + long? minWidth; + long? minHeight; + long? maxWidth; + long? maxHeight; + }; + dictionary RegionRect { long left; long top; @@ -35,11 +42,15 @@ static void restore(); static void drawAttention(); static void clearAttention(); - static void show(); + static void show(optional boolean focused); static void hide(); - static void setBounds(Bounds bounds); + static void setBounds(DOMString boundsType, Bounds bounds); + static void setSizeConstraints(DOMString boundsType, + SizeConstraints constraints); static void setIcon(DOMString icon_url); - static void setInputRegion(Region region); + static void setBadgeIcon(DOMString icon_url); + static void clearBadge(); + static void setShape(Region region); static void setAlwaysOnTop(boolean always_on_top); }; diff --git a/idl/app_window.idl b/idl/app_window.idl index 65f34f85..a3f638ab 100644 --- a/idl/app_window.idl +++ b/idl/app_window.idl @@ -6,11 +6,108 @@ // have an optional frame with title bar and size controls. They are not // associated with any Chrome browser windows. namespace app.window { - dictionary Bounds { + + // Previously named Bounds. + dictionary ContentBounds { + long? left; + long? top; + long? width; + long? height; + }; + + dictionary BoundsSpecification { + // The X coordinate of the content or window. long? left; + + // The Y coordinate of the content or window. long? top; + + // The width of the content or window. long? width; + + // The height of the content or window. long? height; + + // The minimum width of the content or window. + long? minWidth; + + // The minimum height of the content or window. + long? minHeight; + + // The maximum width of the content or window. + long? maxWidth; + + // The maximum height of the content or window. + long? maxHeight; + }; + + dictionary Bounds { + // This property can be used to read or write the current X coordinate of + // the content or window. + long left; + + // This property can be used to read or write the current Y coordinate of + // the content or window. + long top; + + // This property can be used to read or write the current width of the + // content or window. + long width; + + // This property can be used to read or write the current height of the + // content or window. + long height; + + // This property can be used to read or write the current minimum width of + // the content or window. A value of null indicates + // 'unspecified'. + long? minWidth; + + // This property can be used to read or write the current minimum height of + // the content or window. A value of null indicates + // 'unspecified'. + long? minHeight; + + // This property can be used to read or write the current maximum width of + // the content or window. A value of null indicates + // 'unspecified'. + long? maxWidth; + + // This property can be used to read or write the current maximum height of + // the content or window. A value of null indicates + // 'unspecified'. + long? maxHeight; + + // Set the left and top position of the content or window. + static void setPosition(long left, long top); + + // Set the width and height of the content or window. + static void setSize(long width, long height); + + // Set the minimum size constraints of the content or window. The minimum + // width or height can be set to null to remove the constraint. + // A value of undefined will leave a constraint unchanged. + static void setMinimumSize(long minWidth, long minHeight); + + // Set the maximum size constraints of the content or window. The maximum + // width or height can be set to null to remove the constraint. + // A value of undefined will leave a constraint unchanged. + static void setMaximumSize(long maxWidth, long maxHeight); + }; + + dictionary FrameOptions { + // Frame type: none or chrome (defaults to + // chrome).
+ // For none, the -webkit-app-region CSS property + // can be used to apply draggability to the app's window. + // -webkit-app-region: drag can be used to mark regions + // draggable. no-drag can be used to disable this style on + // nested elements.
+ DOMString? type; + // Allows the frame color to be set. Frame coloring is only available if the + // frame type is chrome. + // Frame coloring is experimental and only available in dev channel. + DOMString? color; }; // State of a window: normal, fullscreen, maximized, minimized. @@ -24,46 +121,73 @@ namespace app.window { // Id to identify the window. This will be used to remember the size // and position of the window and restore that geometry when a window // with the same id is later opened. + // If a window with a given id is created while another window with the same + // id already exists, the currently opened window will be focused instead of + // creating a new window. DOMString? id; - // Default width of the window. (Deprecated; regular bounds act like this - // now.) - [nodoc] long? defaultWidth; + // Used to specify the initial position, initial size and constraints of the + // window's content (excluding window decorations). + // If an id is also specified and a window with a matching + // id has been shown before, the remembered bounds will be used + // instead. + // + // Note that the padding between the inner and outer bounds is determined by + // the OS. Therefore setting the same bounds property for both the + // innerBounds and outerBounds will result in an + // error. + // + // Currently only available on the Dev channel from Chrome 35. + BoundsSpecification? innerBounds; + + // Used to specify the initial position, initial size and constraints of the + // window (including window decorations such as the title bar and frame). + // If an id is also specified and a window with a matching + // id has been shown before, the remembered bounds will be used + // instead. + // + // Note that the padding between the inner and outer bounds is determined by + // the OS. Therefore setting the same bounds property for both the + // innerBounds and outerBounds will result in an + // error. + // + // Currently only available on the Dev channel from Chrome 35. + BoundsSpecification? outerBounds; + + // Default width of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultWidth; - // Default height of the window. (Deprecated; regular bounds act like this - // now.) - [nodoc] long? defaultHeight; + // Default height of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultHeight; - // Default X coordinate of the window. (Deprecated; regular bounds act like - // this now.) - [nodoc] long? defaultLeft; + // Default X coordinate of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultLeft; - // Default Y coordinate of the window. (Deprecated; regular bounds act like - // this now.) - [nodoc] long? defaultTop; + // Default Y coordinate of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? defaultTop; - // Width of the window. (Deprecated; use 'bounds'.) - [nodoc] long? width; + // Width of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? width; - // Height of the window. (Deprecated; use 'bounds'.) - [nodoc] long? height; + // Height of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? height; - // X coordinate of the window. (Deprecated; use 'bounds'.) - [nodoc] long? left; + // X coordinate of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? left; - // Y coordinate of the window. (Deprecated; use 'bounds'.) - [nodoc] long? top; + // Y coordinate of the window. + [nodoc, deprecated="Use $(ref:BoundsSpecification)."] long? top; - // Minimum width for the lifetime of the window. + // Minimum width of the window. long? minWidth; - // Minimum height for the lifetime of the window. + // Minimum height of the window. long? minHeight; - // Maximum width for the lifetime of the window. + // Maximum width of the window. long? maxWidth; - // Maximum height for the lifetime of the window. + // Maximum height of the window. long? maxHeight; // Type of window to create. @@ -74,13 +198,14 @@ namespace app.window { // -webkit-app-region CSS property can be used to apply // draggability to the app's window. -webkit-app-region: drag // can be used to mark regions draggable. no-drag can be used - // to disable this style on nested elements. + // to disable this style on nested elements.
+ // Use of FrameOptions is only supported in dev channel. DOMString? frame; // Size and position of the content in the window (excluding the titlebar). // If an id is also specified and a window with a matching id has been shown // before, the remembered bounds of the window will be used instead. - Bounds? bounds; + ContentBounds? bounds; // Enable window background transparency. // Only supported in ash. Requires experimental API permission. @@ -102,31 +227,42 @@ namespace app.window { // window with the same id already exists that window is activated instead. // If you do want to create multiple windows with the same id, you can // set this property to false. - boolean? singleton; + [deprecated="Multiple windows with the same id is no longer supported."] boolean? singleton; // If true, the window will stay above most other windows. If there are // multiple windows of this kind, the currently focused window will be in - // the foreground. Defaults to false. Call setAlwaysOnTop() on - // the window to change this property after creation. - // Currently available in the Dev channel only. + // the foreground. Requires the "app.window.alwaysOnTop" + // permission. Defaults to false.
+ // Call setAlwaysOnTop() on the window to change this property + // after creation.
boolean? alwaysOnTop; + + // If true, the window will be focused when created. Defaults to true. + boolean? focused; }; // Called in the creating window (parent) before the load event is called in // the created window (child). The parent can set fields or functions on the // child usable from onload. E.g. background.js:
- // function(created_window) { created_window.contentWindow.foo = + // function(createdWindow) { createdWindow.contentWindow.foo = // function () { }; }; //
window.js:
// window.onload = function () { foo(); } callback CreateWindowCallback = - void ([instanceOf=AppWindow] object created_window); + void ([instanceOf=AppWindow] object createdWindow); [noinline_doc] dictionary AppWindow { // Focus the window. static void focus(); - // Fullscreens the window. + // Fullscreens the window.
+ // The user will be able to restore the window by pressing ESC. An + // application can prevent the fullscreen state to be left when ESC is + // pressed by requesting the app.window.fullscreen.overrideEsc + // permission and canceling the event by calling .preventDefault(), like + // this:
+ // window.onKeyDown = function(e) { if (e.keyCode == 27 /* ESC */) { + // e.preventDefault(); } }; static void fullscreen(); // Is the window fullscreen? @@ -163,32 +299,57 @@ namespace app.window { static void close(); // Show the window. Does nothing if the window is already visible. - static void show(); + // Focus the window if |focused| is set to true or omitted. + static void show(optional boolean focused); // Hide the window. Does nothing if the window is already hidden. static void hide(); - // Get the window's bounds as a $ref:Bounds object. - [nocompile] static Bounds getBounds(); + // Get the window's inner bounds as a $(ref:ContentBounds) object. + [nocompile] static ContentBounds getBounds(); - // Set the window's bounds. - static void setBounds(Bounds bounds); + // Set the window's inner bounds. + [nocompile] static void setBounds(ContentBounds bounds); // Set the app icon for the window (experimental). // Currently this is only being implemented on Ash. // TODO(stevenjb): Investigate implementing this on Windows and OSX. - [nodoc] static void setIcon(DOMString icon_url); + [nodoc] static void setIcon(DOMString iconUrl); + + // Set a badge icon for the window. + // TODO(benwells): Document this properly before going to stable. + [nodoc] static void setBadgeIcon(DOMString iconUrl); + + // Clear the current for the window. + // TODO(benwells): Document this properly before going to stable. + [nodoc] static void clearBadge(); // Is the window always on top? - // Currently available in the Dev channel only. static boolean isAlwaysOnTop(); - // Set whether the window should stay above most other windows. - // Currently available in the Dev channel only. - static void setAlwaysOnTop(boolean always_on_top); + // Accessors for testing. + [nodoc] boolean hasFrameColor; + [nodoc] long frameColor; + + // Set whether the window should stay above most other windows. Requires the + // "app.window.alwaysOnTop" permission. + static void setAlwaysOnTop(boolean alwaysOnTop); // The JavaScript 'window' object for the created child. [instanceOf=Window] object contentWindow; + + // The id the window was created with. + DOMString id; + + // The position, size and constraints of the window's content, which does + // not include window decorations. + // Currently only available on the Dev channel from Chrome 35. + Bounds innerBounds; + + // The position, size and constraints of the window, which includes window + // decorations, such as the title bar and frame. + // Currently only available on the Dev channel from Chrome 35. + Bounds outerBounds; }; interface Functions { @@ -197,11 +358,11 @@ namespace app.window { // all, in which case a default size and platform dependent position will // be used. // - // Another option is to use the bounds property, which will put the window - // at the specified coordinates with the specified size. If the window has - // a frame, it's total size will be the size given plus the size of the - // frame; that is, the size in bounds is the content size, not the window - // size. + // Another option is to use the bounds property, which will put + // the window at the specified coordinates with the specified size. If the + // window has a frame, it's total size will be the size given plus the size + // of the frame; that is, the size in bounds is the content size, not the + // window size. // // To automatically remember the positions of windows you can give them ids. // If a window has an id, This id is used to remember the size and position @@ -214,12 +375,20 @@ namespace app.window { optional CreateWindowOptions options, optional CreateWindowCallback callback); - // Returns an $ref:AppWindow object for the + // Returns an $(ref:AppWindow) object for the // current script context (ie JavaScript 'window' object). This can also be // called on a handle to a script context for another page, for example: // otherWindow.chrome.app.window.current(). [nocompile] static AppWindow current(); [nocompile, nodoc] static void initializeAppWindow(object state); + + // Gets an array of all currently created app windows. This method is new in + // Chrome 33. + [nocompile] static AppWindow[] getAll(); + + // Gets an $(ref:AppWindow) with the given id. If no window with the given id + // exists null is returned. This method is new in Chrome 33. + [nocompile] static AppWindow get(DOMString id); }; interface Events { diff --git a/idl/automation.idl b/idl/automation.idl index f2a5aa8a..cbcdb2a7 100644 --- a/idl/automation.idl +++ b/idl/automation.idl @@ -3,328 +3,52 @@ // found in the LICENSE file. // The chrome.automation API allows developers to access the -// automation (accessibility) tree for the browser. The tree resembles the DOM -// 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. +// automation (accessibility) tree for the browser. This is a tree +// representation, analogous to the DOM tree, which represents the +// semantic structure of a page, and can be used to programmatically +// interact with a page. [nocompile] namespace automation { - // Keep the following enums in sync with 'ui/accessibility/ax_enums.idl'. - // They are kept here purely for extension docs generation. - - // Possible events fired on an $(ref:automation.AutomationNode). - enum EventType { - activedescendantchanged, - alert, - ariaAttributeChanged, - autocorrectionOccured, - blur, - checkedStateChanged, - childrenChanged, - focus, - hide, - hover, - invalidStatusChanged, - layoutComplete, - liveRegionChanged, - loadComplete, - locationChanged, - menuEnd, - menuListItemSelected, - menuListValueChanged, - menuPopupEnd, - menuPopupStart, - menuStart, - rowCollapsed, - rowCountChanged, - rowExpanded, - scrollPositionChanged, - scrolledToAnchor, - selectedChildrenChanged, - selectedTextChanged, - selectionChanged, - show, - textChanged, - textInserted, - textRemoved, - valueChanged - }; - - // Describes the purpose of an $(ref:automation.AutomationNode). - enum RoleType { - alertDialog, - alert, - annotation, - application, - article, - banner, - browser, - busyIndicator, - button, - buttonDropDown, - canvas, - cell, - checkBox, - client, - colorWell, - columnHeader, - column, - comboBox, - complementary, - contentInfo, - definition, - descriptionListDetail, - descriptionListTerm, - desktop, - dialog, - directory, - disclosureTriangle, - div, - document, - drawer, - editableText, - embeddedObject, - footer, - form, - grid, - group, - growArea, - heading, - helpTag, - horizontalRule, - iframe, - ignored, - imageMapLink, - imageMap, - image, - incrementor, - inlineTextBox, - labelText, - legend, - link, - listBoxOption, - listBox, - listItem, - listMarker, - list, - locationBar, - log, - main, - marquee, - mathElement, - math, - matte, - menuBar, - menuButton, - menuItem, - menuListOption, - menuListPopup, - menu, - navigation, - note, - outline, - pane, - paragraph, - popUpButton, - presentational, - progressIndicator, - radioButton, - radioGroup, - region, - rootWebArea, - rowHeader, - row, - rulerMarker, - ruler, - svgRoot, - scrollArea, - scrollBar, - seamlessWebArea, - search, - sheet, - slider, - sliderThumb, - spinButtonPart, - spinButton, - splitGroup, - splitter, - staticText, - status, - systemWide, - tabGroup, - tabList, - tabPanel, - tab, - tableHeaderContainer, - table, - textArea, - textField, - timer, - titleBar, - toggleButton, - toolbar, - treeGrid, - treeItem, - tree, - unknown, - tooltip, - valueIndicator, - webArea, - window - }; - - // Describes characteristics of an $(ref:automation.AutomationNode). - enum StateType { - busy, - checked, - collapsed, - default, - disabled, // ui/views only - editable, // ui/views only - enabled, // content only - expanded, - focusable, - focused, - haspopup, - hovered, - indeterminate, - invisible, - linked, - multiselectable, - offscreen, - pressed, - protected, - readOnly, - required, - selectable, - selected, - vertical, - visited - }; - - dictionary Rect { - long left; - long top; - long width; - long height; - }; - - // An event in the Automation tree. - [nocompile, noinline_doc] dictionary AutomationEvent { - // The $(ref:automation.AutomationNode) to which the event was targeted. - AutomationNode target; - - // The type of the event. - EventType type; - - // Stops this event from further processing except for any remaining - // listeners on $(ref:AutomationEvent.target). - static void stopPropagation(); - }; - - // A listener for events on an AutomationNode. - callback AutomationListener = void(AutomationEvent event); - - // A single node in an Automation tree. - [nocompile, noinline_doc] dictionary AutomationNode { - // The root node of the tree containing this AutomationNode. - AutomationRootNode root; - - // Whether this AutomationNode is an AutomationRootNode. - boolean isRootNode; - + // A single node in an AutomationTree. + [nocompile] dictionary AutomationNode { // Unique ID to identify this node. long id; - // The role of this node. - automation.RoleType role; + // The role of this node, e.g. button, static text etc. + DOMString role; - // The $(ref:automation.StateType)s describing this node. + // The state of this node, e.g. {pressed": true, "inactive": true} etc. object state; - // The rendered location (as a bounding box) of this node within the frame. - automation.Rect location; + // TODO(aboxhall): Rect location; // A collection of this node's other attributes. + // TODO(aboxhall): Create and use combined list of attributes from + // AXStringAttribute, AXIntAttribute etc. object? attributes; // The index of this node in its parent node's list of children. If this is // the root node, this will be undefined. - long? indexInParent; - - static AutomationNode[] children(); - static AutomationNode parent(); - static AutomationNode firstChild(); - static AutomationNode lastChild(); - static AutomationNode previousSibling(); - static AutomationNode nextSibling(); - - // Does the default action based on this node's role. This is generally - // the same action that would result from clicking the node such as - // expanding a treeitem, toggling a checkbox, selecting a radiobutton, - // or activating a button. - static void doDefault(); - - // Places focus on this node. - static void focus(); - - // Scrolls this node to make it visible. - static void makeVisible(); - - // Sets selection within a text field. - static void setSelection(long startIndex, long endIndex); + long? index_in_parent; - // Adds a listener for the given event type and event phase. - static void addEventListener( - EventType eventType, AutomationListener listener, boolean capture); - - // Removes a listener for the given event type and event phase. - static void removeEventListener( - EventType eventType, AutomationListener listener, boolean capture); + static object[] children(); + static object parent(); + static object firstChild(); + static object lastChild(); + static object previousSibling(); + static object nextSibling(); }; - // Called when the AutomationRootNode for the page is available. - callback RootCallback = void(AutomationRootNode rootNode); - - // The root node of the automation tree for a single frame or desktop. - // This may be: - //
    - //
  • The desktop - //
  • The top frame of a page - //
  • A frame or iframe within a page - //
- // Thus, an AutomationRootNode may be a descendant of one or - // more AutomationRootNodes, and in turn have one or more - // AutomationRootNodes in its descendants. Thus, the - // root property of the AutomationRootNode will be - // the immediate parent AutomationRootNode, or null - // if this is the top-level AutomationRootNode. - // - // Extends $(ref:automation.AutomationNode). - [nocompile, noinline_doc] dictionary AutomationRootNode { - // TODO(aboxhall/dtseng): implement loading. Kept separate to not include - // in generated docs. - - // TODO(dtseng/aboxhall): Implement non-trivial |load| function before going - // to dev. - - // Whether this AutomationRootNode is loaded or not. If false, call load() - // to get the contents. - boolean loaded; - - // Load the accessibility tree for this AutomationRootNode. - static void load(RootCallback callback); + // The automation tree for a single page. + [nocompile] dictionary AutomationTree { + AutomationNode root; }; - 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, RootCallback callback); + // Called when the AutomationTree for the page is available. + callback RootCallback = void(AutomationTree tree); - // 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); + interface Functions { + // Get the automation tree for the current tab, enabling automation if + // necessary. + [nocompile] static void getTree(RootCallback callback); }; }; diff --git a/idl/automation_internal.idl b/idl/automation_internal.idl new file mode 100644 index 00000000..3b018be6 --- /dev/null +++ b/idl/automation_internal.idl @@ -0,0 +1,56 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This is the implementation layer of the chrome.automation API, and is +// essentially a translation of the internal accessibility tree update system +// into an extension API. +namespace automationInternal { + // A compact representation of the accessibility information for a + // single web object, in a form that can be serialized and sent from + // one process to another. + // See ui/accessibility/ax_node_data.h + dictionary AXNodeData { + long id; + DOMString role; + object state; + // TODO(aboxhall): include location data; + object? bool_attributes; + object? float_attributes; + object? html_attributes; + object? int_attributes; + object? intlist_attributes; + object? string_attributes; + long[] child_ids; + }; + + // Data for an accessibility event and/or an atomic change to an accessibility + // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of + // the tree update format. + dictionary AXEventParams { + // The routing id of the web contents that this update is for. + long routing_id; + + // The type of event that this update represents. + DOMString event_type; + + // A vector of nodes to update according to the rules described in + // ui/ax_tree_update.h. + AXNodeData[] nodes; + }; + + // Returns the routing_id of the tab whose accessibility was enabled using + // enable(). + callback EnableCallback = void(long routing_id); + + interface Functions { + // Enable automation of the active tab and retrieves its routing id for use + // in future updates. + static void enableCurrentTab(EnableCallback callback); + }; + + interface Events { + // Fired when an accessibility event occurs + static void onAccessibilityEvent(AXEventParams update); + }; +}; diff --git a/idl/autotest_private.idl b/idl/autotest_private.idl index e33fa17b..578d9d39 100644 --- a/idl/autotest_private.idl +++ b/idl/autotest_private.idl @@ -28,6 +28,31 @@ }; callback LoginStatusCallback = void (LoginStatusDict status); + dictionary ExtensionInfoDict { + DOMString id; + DOMString version; + DOMString name; + DOMString publicKey; + DOMString description; + DOMString backgroundUrl; + DOMString optionsUrl; + + DOMString[] hostPermissions; + DOMString[] effectiveHostPermissions; + DOMString[] apiPermissions; + + boolean isComponent; + boolean isInternal; + boolean isUserInstalled; + boolean isEnabled; + boolean allowedInIncognito; + boolean hasPageAction; + }; + dictionary ExtensionsInfoArray { + ExtensionInfoDict[] extensions; + }; + callback ExtensionsInfoCallback = void (ExtensionsInfoArray info); + interface Functions { // Logout of a user session. static void logout(); @@ -45,6 +70,9 @@ // Locks the screen. static void lockScreen(); + // Get info about installed extensions. + static void getExtensionsInfo(ExtensionsInfoCallback callback); + // Simulates a memory access bug for asan testing. static void simulateAsanMemoryBug(); }; diff --git a/idl/bluetooth.idl b/idl/bluetooth.idl index d1774b7c..e66cda10 100644 --- a/idl/bluetooth.idl +++ b/idl/bluetooth.idl @@ -3,8 +3,16 @@ // found in the LICENSE file. // Use the chrome.bluetooth API to connect to a Bluetooth -// device. +// device. All functions report failures via chrome.runtime.lastError. namespace bluetooth { + // Allocation authorities for Vendor IDs. + enum VendorIdSource {bluetooth, usb}; + + // Common device types recognized by Chrome. + enum DeviceType {computer, phone, modem, audio, carAudio, video, peripheral, + joystick, gamepad, keyboard, mouse, tablet, + keyboardMouseCombo}; + dictionary AdapterState { // The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'. DOMString address; @@ -29,11 +37,34 @@ namespace bluetooth { // The human-readable name of the device. DOMString? name; + // The class of the device, a bit-field defined by + // http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband. + long? deviceClass; + + // The Device ID record of the device, where available. + VendorIdSource? vendorIdSource; + long? vendorId; + long? productId; + long? deviceId; + + // The type of the device, if recognized by Chrome. This is obtained from + // the |deviceClass| field and only represents a small fraction of the + // possible device types. When in doubt you should use the |deviceClass| + // field directly. + DeviceType? type; + // Indicates whether or not the device is paired with the system. boolean? paired; // Indicates whether the device is currently connected to the system. boolean? connected; + + // UUIDs of protocols, profiles and services advertised by the device. + // For classic Bluetooth devices, this list is obtained from EIR data and + // SDP tables. For Low Energy devices, this list is obtained from AD and + // GATT primary services. For dual mode devices this may be obtained from + // both. + DOMString[]? uuids; }; dictionary Profile { @@ -101,43 +132,16 @@ namespace bluetooth { }; callback AdapterStateCallback = void(AdapterState result); - callback AddressCallback = void (DOMString result); - callback BooleanCallback = void (boolean result); - callback DataCallback = void (optional ArrayBuffer result); - callback DeviceCallback = void (Device device); - callback DevicesCallback = void (Device[] result); - callback NameCallback = void (DOMString result); - callback OutOfBandPairingDataCallback = void (OutOfBandPairingData data); - callback ProfilesCallback = void(Profile[] result); - callback ResultCallback = void (); - callback ServicesCallback = void(ServiceRecord[] result); - callback SizeCallback = void (long result); - callback SocketCallback = void (Socket result); - - // Options for the getDevices function. If |profile| is not provided, all - // devices known to the system are returned. - dictionary GetDevicesOptions { - // Only devices providing |profile| will be returned. - Profile? profile; - - // Called for each matching device. Note that a service discovery request - // must be made to each non-matching device before it can be definitively - // excluded. This can take some time. - DeviceCallback deviceCallback; - }; - - // Options for the getProfiles function. - dictionary GetProfilesOptions { - // The remote Bluetooth device to retrieve the exported profiles list from. - Device device; - }; - - // Options for the getServices function. - dictionary GetServicesOptions { - // The address of the device to inquire about. |deviceAddress| should be - // in the format 'XX:XX:XX:XX:XX:XX'. - DOMString deviceAddress; - }; + callback AddressCallback = void(DOMString result); + callback BooleanCallback = void(boolean result); + callback DataCallback = void(optional ArrayBuffer result); + callback DeviceCallback = void(Device result); + callback DevicesCallback = void(Device[] result); + callback NameCallback = void(DOMString result); + callback OutOfBandPairingDataCallback = void(OutOfBandPairingData data); + callback ResultCallback = void(); + callback SizeCallback = void(long result); + callback SocketCallback = void(Socket result); // Options for the connect function. dictionary ConnectOptions { @@ -180,12 +184,6 @@ namespace bluetooth { OutOfBandPairingData? data; }; - // Options for the startDiscovery function. - dictionary StartDiscoveryOptions { - // Called for each device that is discovered. - DeviceCallback deviceCallback; - }; - // These functions all report failures via chrome.runtime.lastError. interface Functions { // Registers the JavaScript application as an implementation for the given @@ -202,24 +200,15 @@ namespace bluetooth { // state. static void getAdapterState(AdapterStateCallback callback); - // Get a bluetooth devices known to the system. Known devices are either - // currently paired, or have been paired in the past. - // |options| : Controls which devices are returned and provides - // |deviceCallback|, which is called for each matching device. + // Get a list of Bluetooth devices known to the system, including paired + // and recently discovered devices. // |callback| : Called when the search is completed. - // |options.deviceCallback| will not be called after - // |callback| has been called. - static void getDevices(GetDevicesOptions options, - ResultCallback callback); - - // Returns the set of exported profiles for the device specified in options. - // This function will not initiate a connection to the remote device. - static void getProfiles(GetProfilesOptions options, - ProfilesCallback callback); + static void getDevices(DevicesCallback callback); - // Get a list of services provided by a device. - static void getServices(GetServicesOptions options, - ServicesCallback callback); + // Get information about a Bluetooth device known to the system. + // |deviceAddress| : Address of device to get. + // |callback| : Called with the Device object describing the device. + static void getDevice(DOMString deviceAddress, DeviceCallback callback); // Connect to a service on a device. // |options| : The options for the connection. @@ -233,9 +222,11 @@ namespace bluetooth { static void disconnect(DisconnectOptions options, optional ResultCallback callback); - // Read data from a Bluetooth connection. + // Read data from a Bluetooth connection. The |callback| will be called + // with the current data in the buffer even if it is empty. This function + // should be polled to read incoming data. // |options| : The options for this function. - // |callback| : Called with the data when it is available. + // |callback| : Called with the data read from the socket buffer. static void read(ReadOptions options, DataCallback callback); @@ -257,14 +248,16 @@ namespace bluetooth { static void setOutOfBandPairingData(SetOutOfBandPairingDataOptions options, optional ResultCallback callback); - // Start discovery. Discovered devices will be returned via the - // |onDeviceDiscovered| callback. Discovery will fail to start if it is - // already in progress. Discovery can be resource intensive: stopDiscovery + // Start discovery. Newly discovered devices will be returned via the + // onDeviceAdded event. Previously discovered devices already known to + // the adapter must be obtained using getDevices and will only be updated + // using the |onDeviceChanged| event if information about them changes. + // + // Discovery will fail to start if this application has already called + // startDiscovery. Discovery can be resource intensive: stopDiscovery // should be called as soon as possible. - // |options| : The options for this function. // |callback| : Called to indicate success or failure. static void startDiscovery( - StartDiscoveryOptions options, optional ResultCallback callback); // Stop discovery. @@ -278,6 +271,17 @@ namespace bluetooth { // |state| : The new state of the adapter. static void onAdapterStateChanged(AdapterState state); + // Fired when information about a new Bluetooth device is available. + static void onDeviceAdded(Device device); + + // Fired when information about a known Bluetooth device has changed. + static void onDeviceChanged(Device device); + + // Fired when a Bluetooth device that was previously discovered has been + // out of range for long enough to be considered unavailable again, and + // when a paired device is removed. + static void onDeviceRemoved(Device device); + // Fired when a connection has been made for a registered profile. // |socket| : The socket for the connection. static void onConnection(Socket socket); diff --git a/idl/bookmark_manager_private.json b/idl/bookmark_manager_private.json index 6643f17f..87cba9f8 100644 --- a/idl/bookmark_manager_private.json +++ b/idl/bookmark_manager_private.json @@ -151,6 +151,11 @@ "type": "array", "items": {"type": "string"}, "minItems": 1 + }, + { + "name": "isFromTouch", + "type": "boolean", + "description": "True if the drag was initiated from touch" } ] }, @@ -243,6 +248,123 @@ "description": "", "nodoc": "true", "parameters": [] + }, + { + "name": "getMetaInfo", + "type": "function", + "description": "Gets a meta info field from a bookmark node", + "nodoc": "true", + "parameters": [ + { + "name": "id", + "description": "The id of the bookmark to retrieve meta info from", + "type": "string" + }, + { + "name": "key", + "description": "The key for the meta info to retrieve", + "type": "string" + }, + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "value", + "description": "The value of the meta info, if present", + "optional": true, + "type": "string" + } + ] + } + ] + }, + { + "name": "setMetaInfo", + "type": "function", + "description": "Sets a meta info value for a bookmark node", + "nodoc": "true", + "parameters": [ + { + "name": "id", + "description": "The id of the bookmark node to set the meta info on", + "type": "string" + }, + { + "name": "key", + "description": "The key of the meta info to set", + "type": "string" + }, + { + "name": "value", + "description": "The meta info to set", + "type": "string" + }, + { + "name": "callback", + "type": "function", + "optional": true, + "parameters": [] + } + ] + }, + { + "name": "undo", + "type": "function", + "description": "Performs an undo of the last change to the bookmark model", + "nodoc": "true", + "parameters": [] + }, + { + "name": "redo", + "type": "function", + "description": "Performs a redo of last undone change to the bookmark model", + "nodoc": "true", + "parameters": [] + }, + { + "name": "getUndoInfo", + "type": "function", + "description": "Gets the information for the undo if available", + "nodoc": "true", + "parameters": [ + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "result", + "type": "object", + "properties": { + "enabled" : {"type": "boolean", "description": "Whether there is an action to undo"}, + "label" : {"type": "string", "description": "The i18n label to use for the undo action"} + } + } + ] + } + ] + }, + { + "name": "getRedoInfo", + "type": "function", + "description": "Gets the information for the redo if available", + "nodoc": "true", + "parameters": [ + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "result", + "type": "object", + "properties": { + "enabled" : {"type": "boolean", "description": "Whether there is an action to redo"}, + "label" : {"type": "string", "description": "The i18n label to use for the redo action"} + } + } + ] + } + ] } ], "events": [ @@ -269,6 +391,14 @@ "parameters": [ {"name": "bookmarkNodeData", "$ref": "BookmarkNodeData"} ] + }, + { + "name": "onMetaInfoChanged", + "type": "function", + "description": "Fired when the meta info of a node changes.", + "parameters": [ + {"name": "id", "type": "string"} + ] } ] } diff --git a/idl/bookmarks.json b/idl/bookmarks.json index e1683629..fc0d1fea 100644 --- a/idl/bookmarks.json +++ b/idl/bookmarks.json @@ -195,11 +195,37 @@ { "name": "search", "type": "function", - "description": "Searches for BookmarkTreeNodes matching the given query.", + "description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.", "parameters": [ { - "type": "string", - "name": "query" + "name": "query", + "choices": [ + { + "type": "string", + "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles." + }, + { + "type": "object", + "description": "An object specifying properties and values to match when searching. Produces bookmarks matching all properties.", + "properties": { + "query": { + "type": "string", + "optional": true, + "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles." + }, + "url": { + "type": "string", + "optional": true, + "description": "The URL of the bookmark; matches verbatim. Note that folders have no URL." + }, + "title": { + "type": "string", + "optional": true, + "description": "The title of the bookmark; matches verbatim." + } + } + } + ] }, { "type": "function", diff --git a/idl/browser_action.json b/idl/browser_action.json index e08851be..d7ff7438 100644 --- a/idl/browser_action.json +++ b/idl/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 also 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 also have a tooltip, a badge, and a popup.", "types": [ { "id": "ColorArray", diff --git a/idl/cast_streaming_rtp_stream.idl b/idl/cast_streaming_rtp_stream.idl deleted file mode 100644 index 55994d36..00000000 --- a/idl/cast_streaming_rtp_stream.idl +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// The chrome.cast.streaming.rtpStream API allows configuration -// of encoding parameters and RTP parameters used in a Cast streaming -// session. -namespace cast.streaming.rtpStream { - // Params for audio and video codec. - dictionary CodecSpecificParams { - DOMString key; - DOMString value; - }; - - // RTP payload param. - dictionary RtpPayloadParams { - long payloadType; - - DOMString codecName; - - // Synchronization source identifier. - long? ssrc; - - long? clockRate; - - long? minBitrate; - - long? maxBitrate; - - // The number of channels. - long? channels; - - // Video width in pixels. - long? width; - - // Video height in pixels. - long? height; - - // A list of codec specific params. - CodecSpecificParams[] codecSpecificParams; - }; - - // Cast RTP capabilities. - dictionary RtpCaps { - // RTP payload params. - RtpPayloadParams[] payloads; - - DOMString[] rtcpFeatures; - }; - - // Cast RTP parameters. - dictionary RtpParams { - // RTP payload params. - RtpPayloadParams[] payloads; - - DOMString[] rtcpFeatures; - }; - - // Callback from the create method. - // |id| : The ID for the RTP stream. - callback CreateCallback = void (long streamId); - - interface Functions { - // Destroys a Cast RTP stream. - // |streamId| : The RTP stream ID. - [nocompile] static void destroy(long streamId); - - // Returns capabilities of the RTP stream. - // |streamId| : The RTP stream ID. - [nocompile] static RtpCaps getCaps(long streamId); - - // Activates the RTP stream by providing the parameters. - // |streamId| : The RTP stream ID. - // |params| : Parameters set for this stream. - [nocompile] static void start(long streamId, RtpParams params); - - // Stops activity on the specified stream. - // |streamId| : The RTP stream ID. - [nocompile] static void stop(long streamId); - }; - - interface Events { - // Event fired when a Cast RTP stream has started. - // |streamId| : The ID of the RTP stream. - static void onStarted(long streamId); - - // Event fired when a Cast RTP stream has stopped. - // |streamId| : The ID of the RTP stream. - static void onStopped(long streamId); - - // Event fired when a Cast RTP stream has error. - // |streamId| : The ID of the RTP stream. - // |errorString| : The error info. - static void onError(long streamId, DOMString errorString); - }; -}; diff --git a/idl/cast_streaming_udp_transport.idl b/idl/cast_streaming_udp_transport.idl index 8c140605..beee4c3b 100644 --- a/idl/cast_streaming_udp_transport.idl +++ b/idl/cast_streaming_udp_transport.idl @@ -8,7 +8,7 @@ // It is used to configure the UDP transport used in Cast session. namespace cast.streaming.udpTransport { // The UDP socket address and port. - dictionary UdpParams { + dictionary IPEndPoint { DOMString address; long port; }; @@ -18,9 +18,11 @@ namespace cast.streaming.udpTransport { // |transportId| : The transport ID. [nocompile] static void destroy(long transportId); - // Starts to use the transport by providing remote UDP info. + // Sets parameters for this UDP transport. This can only be called + // once per transport. // |transportId| : The transport ID. - // |remoteParams| : The address and port to send packets to. - [nocompile] static void start(long transportId, UdpParams remoteParams); + // |destination| : The address and port to send packets to. + [nocompile] static void setDestination(long transportId, + IPEndPoint destination); }; }; diff --git a/idl/chromeos_info_private.json b/idl/chromeos_info_private.json index 095edeec..b7abe397 100644 --- a/idl/chromeos_info_private.json +++ b/idl/chromeos_info_private.json @@ -32,16 +32,61 @@ "type": "object", "description": "Dictionary which contains all requested properties", "properties": { - "hwid": {"type": "string", "optional": "true", "description": "Hardware ID"}, - "homeProvider" : {"type": "string", "optional": "true", "description": "Home provider which is used by the cellular device"}, - "initialLocale" : {"type": "string", "optional": "true", "description": "Initial locale for the device"}, - "board" : {"type": "string", "optional": "true", "description": "Board name"}, - "isOwner" : {"type": "boolean", "optional": "true", "description": "True if current logged in user is device owner"} + "board" : {"type": "string", "optional": true, "description": "Board name"}, + "customizationId": {"type": "string", "optional": true, "description": "Customization ID"}, + "homeProvider" : {"type": "string", "optional": true, "description": "Home provider which is used by the cellular device"}, + "hwid": {"type": "string", "optional": true, "description": "Hardware ID"}, + "initialLocale" : {"type": "string", "optional": true, "description": "Initial locale for the device"}, + "isOwner" : {"type": "boolean", "optional": true, "description": "True if current logged in user is device owner"}, + "timezone" : {"type": "string", "optional": true, "description": "Timezone"}, + "a11yLargeCursorEnabled" : {"type": "boolean", "optional": true, "description": "If true, ChromeOS is showing enlarged cursor."}, + "a11yStickyKeysEnabled" : {"type": "boolean", "optional": true, "description": "If true, sticky keys are turned on."}, + "a11ySpokenFeedbackEnabled" : {"type": "boolean", "optional": true, "description": "If enabled, ChromeOS text-to-speech feature is turned on."}, + "a11yHighContrastEnabled" : {"type": "boolean", "optional": true, "description": "If true, all displays have high contrast mode turned on."}, + "a11yScreenMagnifierEnabled" : {"type": "boolean", "optional": true, "description": "If true, all displays have screen magnifier turned on."}, + "a11yAutoClickEnabled" : {"type": "boolean", "optional": true, "description": "If true, auto mouse click accessibility feature is turned on."}, + "a11yVirtualKeyboardEnabled" : {"type": "boolean", "optional": true, "description": "If true, virtual keyboard will be enabled."}, + "sendFunctionKeys" : {"type": "boolean", "optional": true, "description": "If true, the ChromeOS top row keys send function keys."}, + "supportedTimezones" : { + "type": "array", + "items": { + "type": "array", + "items": {"type": "string"} + }, + "optional": true, + "description": "List of supported timezones definitions." + } } } ] } ] + }, + { + "name": "set", + "description": "Sets values for the given system property.", + "type": "function", + "parameters": [ + { + "name": "propertyName", + "type": "string", + "enum": ["timezone", + "a11yLargeCursorEnabled", + "a11yStickyKeysEnabled", + "a11ySpokenFeedbackEnabled", + "a11yHighContrastEnabled", + "a11yScreenMagnifierEnabled", + "a11yAutoClickEnabled", + "a11yVirtualKeyboardEnabled", + "sendFunctionKeys"], + "description": "Chrome OS system property name" + }, + { + "name": "propertyValue", + "type": "any", + "description": "Chrome OS system property value" + } + ] } ] } diff --git a/idl/content_settings.json b/idl/content_settings.json index 2a0b86a1..9fcfb285 100644 --- a/idl/content_settings.json +++ b/idl/content_settings.json @@ -24,7 +24,7 @@ "description": "A human readable description of the resource." } }, - "description": "The only content type using resource identifiers is $ref:contentSettings.plugins. For more information, see Resource Identifiers." + "description": "The only content type using resource identifiers is $(ref:contentSettings.plugins). For more information, see Resource Identifiers." }, { "id": "ContentSetting", diff --git a/idl/context_menus_internal.json b/idl/context_menus_internal.json new file mode 100644 index 00000000..da2a49f7 --- /dev/null +++ b/idl/context_menus_internal.json @@ -0,0 +1,98 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[ + { + "namespace": "contextMenusInternal", + "description": "Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.", + "types": [ + { + "id": "OnClickData", + "type": "object", + "description": "Information sent when a context menu item is clicked.", + "properties": { + "menuItemId": { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "description": "The ID of the menu item that was clicked." + }, + "parentMenuItemId": { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "optional": true, + "description": "The parent ID, if any, for the item clicked." + }, + "mediaType": { + "type": "string", + "optional": true, + "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements." + }, + "linkUrl": { + "type": "string", + "optional": true, + "description": "If the element is a link, the URL it points to." + }, + "srcUrl": { + "type": "string", + "optional": true, + "description": "Will be present for elements with a 'src' URL." + }, + "pageUrl": { + "type": "string", + "optional": true, + "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu." + }, + "frameUrl": { + "type": "string", + "optional": true, + "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame." + }, + "selectionText": { + "type": "string", + "optional": true, + "description": "The text for the context selection, if any." + }, + "editable": { + "type": "boolean", + "description": "A flag indicating whether the element is editable (text input, textarea, etc.)." + }, + "wasChecked": { + "type": "boolean", + "optional": true, + "description": "A flag indicating the state of a checkbox or radio item before it was clicked." + }, + "checked": { + "type": "boolean", + "optional": true, + "description": "A flag indicating the state of a checkbox or radio item after it is clicked." + } + } + } + ], + "events": [ + { + "name": "onClicked", + "type": "function", + "description": "Fired when a context menu item is clicked.", + "parameters": [ + { + "name": "info", + "$ref": "OnClickData", + "description": "Information about the item clicked and the context where the click happened." + }, + { + "name": "tab", + "$ref": "tabs.Tab", + "description": "The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.", + "optional": true + } + ] + } + ] + } +] diff --git a/idl/debugger.json b/idl/debugger.json index 8b656ef5..2bf6c3f8 100644 --- a/idl/debugger.json +++ b/idl/debugger.json @@ -58,7 +58,7 @@ "name": "callback", "optional": true, "parameters": [], - "description": "Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, $ref:runtime.lastError will be set to the error message." + "description": "Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, $(ref:runtime.lastError) will be set to the error message." } ] }, @@ -77,7 +77,7 @@ "name": "callback", "optional": true, "parameters": [], - "description": "Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, $ref:runtime.lastError will be set to the error message." + "description": "Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, $(ref:runtime.lastError) will be set to the error message." } ] }, @@ -116,7 +116,7 @@ "description": "JSON object with the response. Structure of the response varies depending on the method and is defined by the remote debugging protocol." } ], - "description": "Response body. If an error occurs while posting the message, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message." + "description": "Response body. If an error occurs while posting the message, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." } ] }, diff --git a/idl/declarative_content.json b/idl/declarative_content.json index 06244558..cc74bec3 100644 --- a/idl/declarative_content.json +++ b/idl/declarative_content.json @@ -40,7 +40,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 takes the activeTab permission, a click on the page action will grant access to the active tab.", + "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 takes the activeTab permission, a click on the page action will grant access to the active tab.", "type": "object", "properties": { "instanceType": { diff --git a/idl/declarative_web_request.json b/idl/declarative_web_request.json index 2c37c74e..77bdb1e3 100644 --- a/idl/declarative_web_request.json +++ b/idl/declarative_web_request.json @@ -297,7 +297,7 @@ }, { "id": "declarativeWebRequest.SendMessageToExtension", - "description": "Triggers the $ref:declarativeWebRequest.onMessage event.", + "description": "Triggers the $(ref:declarativeWebRequest.onMessage) event.", "type": "object", "properties": { "instanceType": { @@ -570,7 +570,7 @@ { "name": "onMessage", "type": "function", - "description": "Fired when a message is sent via $ref:declarativeWebRequest.SendMessageToExtension from an action of the declarative web request API.", + "description": "Fired when a message is sent via $(ref:declarativeWebRequest.SendMessageToExtension) from an action of the declarative web request API.", "parameters": [ { "type": "object", diff --git a/idl/developer_private.idl b/idl/developer_private.idl index 57307e37..45899ea9 100644 --- a/idl/developer_private.idl +++ b/idl/developer_private.idl @@ -60,6 +60,8 @@ namespace developerPrivate { DOMString? homepage_url; DOMString? update_url; InstallWarning[] install_warnings; + any[] manifest_errors; + any[] runtime_errors; boolean offline_enabled; // All views of the current extension. @@ -97,7 +99,8 @@ namespace developerPrivate { // New window / view opened. VIEW_REGISTERED, // window / view closed. - VIEW_UNREGISTERED + VIEW_UNREGISTERED, + ERROR_ADDED }; dictionary PackDirectoryResponse { @@ -126,11 +129,11 @@ namespace developerPrivate { callback VoidCallback = void (); callback BooleanCallback = void (boolean result); callback ItemsInfoCallback = void (ItemInfo[] result); - callback GetStringsCallback = void (object result); callback GetProjectsInfoCallback = void (ProjectInfo[] result); callback PathCallback = void (DOMString path); callback PackCallback = void (PackDirectoryResponse response); callback VoidCallback = void(); + callback AnyCallback = void (any result); interface Functions { // Runs auto update for extensions and apps immediately. @@ -175,14 +178,9 @@ namespace developerPrivate { // Load a user selected unpacked item static void loadUnpacked(optional VoidCallback callback); - // Copies the syncfs folder for the extension to local disk. - static void exportSyncfsFolderToLocalfs(DOMString folder_name, - optional VoidCallback callback); - - // Loads the unpacked app / extension. - // |callback| called with itemId of the loaded item. - static void loadProject(DOMString project_name, - PathCallback callback); + // Loads an extension / app from a given |directory| + static void loadDirectory([instanceOf=DirectoryEntry] object directory, + PathCallback callback); // Open Dialog to browse to an entry. // |select_type| : Select a file or a folder. @@ -200,13 +198,42 @@ namespace developerPrivate { long flags, PackCallback callback); - // Gets localized translated strings for apps_debugger. It returns the - // strings as a dictionary mapping from string identifier to the - // translated string to use in the apps_debugger app UI. - static void getStrings(GetStringsCallback callback); - // Returns true if the profile is managed. static void isProfileManaged(BooleanCallback callback); + + // Reads and returns the contents of a file related to an extension which + // caused an error. The expected argument is a dictionary with the + // following entries: + // - pathSuffix: The path of the file, relative to the extension; e.g., + // manifest.json, script.js, or main.html. + // - extensionId: The ID of the extension owning the file. + // - errorMessage: The error message which was thrown as a result of the + // error in the file. + // - manifestKey (required for "manifest.json" file): The key + // in the manifest which caused the error (e.g., "permissions"). + // - manifestSpecific (optional for "manifest.json" file): The specific + // portion of the manifest key which caused the error (e.g., "foo" in + // the "permissions" key). + // - lineNumber (optional for non-manifest files): The line number which + // caused the error. + // The callback is called with a dictionary with three keys: + // - highlight: The region of the code which threw the error, and should + // be highlighted. + // - beforeHighlight: The region before the "highlight" portion. + // - afterHighlight: The region after the "highlight" portion. + // - highlight: The region of the code which threw the error. + // If the region which threw the error was not found, the full contents of + // the file will be in the "beforeHighlight" section. + static void requestFileSource(any dict, AnyCallback callback); + + // Open the developer tools to focus on a particular error. The expected + // argument is a dictionary with the following entries: + // - renderViewId: The ID of the render view in which the error occurred. + // - renderProcessId: The ID of the process in which the error occurred. + // - url (optional): The URL in which the error occurred. + // - lineNumber (optional): The line to focus the devtools at. + // - columnNumber (optional): The column to focus the devtools at. + static void openDevTools(any dict); }; interface Events { diff --git a/idl/devtools/experimental_audits.json b/idl/devtools/experimental_audits.json index d359496f..2864c4c3 100644 --- a/idl/devtools/experimental_audits.json +++ b/idl/devtools/experimental_audits.json @@ -41,7 +41,7 @@ "id": "FormattedValue", "type": "object", "additionalProperties": { "type": "any" }, - "description": "A value returned from one of the formatters (a URL, code snippet etc), to be passed to createResult() or addChild(). See $ref:AuditResults.createSnippet and $ref:AuditResults.createURL." + "description": "A value returned from one of the formatters (a URL, code snippet etc), to be passed to createResult() or addChild(). See $(ref:AuditResults.createSnippet) and $(ref:AuditResults.createURL)." }, { "id": "AuditResults", @@ -134,7 +134,7 @@ "description": "Children of this node." }, "expanded": { - "optional": "true", + "optional": true, "type": "boolean", "description": "Whether the node is expanded by default." } diff --git a/idl/devtools/panels.json b/idl/devtools/panels.json index 31ee936d..0fec13a8 100644 --- a/idl/devtools/panels.json +++ b/idl/devtools/panels.json @@ -99,8 +99,10 @@ "parameters": [ { "name": "window", - "$ref": "windows.Window", - "description": "The window object of panel's page." + "type": "object", + "isInstanceOf": "global", + "additionalProperties": { "type": "any" }, + "description": "The JavaScript window object of panel's page." } ] }, @@ -197,9 +199,10 @@ "parameters": [ { "name": "window", - "$ref": "windows.Window", - "optional": true, - "description": "The window object of the sidebar page, if one was set with the setPage() method." + "type": "object", + "isInstanceOf": "global", + "additionalProperties": { "type": "any" }, + "description": "The JavaScript window object of the sidebar page, if one was set with the setPage() method." } ] }, @@ -305,7 +308,7 @@ { "name": "resource", "$ref": "devtools.inspectedWindow.Resource", - "description": "A $ref:devtools.inspectedWindow.Resource object for the resource that was clicked." + "description": "A $(ref:devtools.inspectedWindow.Resource) object for the resource that was clicked." } ] } diff --git a/idl/dns.idl b/idl/dns.idl deleted file mode 100644 index f2da6b33..00000000 --- a/idl/dns.idl +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Use the chrome.dns API for dns resolution. -namespace dns { - - dictionary ResolveCallbackResolveInfo { - // The result code. Zero indicates success. - long resultCode; - - // A string representing the IP address literal. Supplied only if resultCode - // indicates success. Note that we presently return only IPv4 addresses. - DOMString? address; - }; - - callback ResolveCallback = void (ResolveCallbackResolveInfo resolveInfo); - - interface Functions { - // Resolves the given hostname or IP address literal. - // |hostname| : The hostname to resolve. - // |callback| : Called when the resolution operation completes. - static void resolve(DOMString hostname, - ResolveCallback callback); - }; - -}; diff --git a/idl/downloads.idl b/idl/downloads.idl index e13d3aad..00d05d0f 100644 --- a/idl/downloads.idl +++ b/idl/downloads.idl @@ -25,7 +25,7 @@ namespace downloads { enum FilenameConflictAction {uniquify, overwrite, prompt}; [inline_doc] dictionary FilenameSuggestion { - // The $ref:DownloadItem's new target $ref:DownloadItem.filename, as a path + // The $(ref:DownloadItem)'s new target $(ref:DownloadItem.filename), as a path // relative to the user's default Downloads directory, possibly containing // subdirectories. Absolute paths, empty paths, and paths containing // back-references ".." will be ignored. @@ -52,6 +52,7 @@ namespace downloads { NETWORK_TIMEOUT, NETWORK_DISCONNECTED, NETWORK_SERVER_DOWN, + NETWORK_INVALID_REQUEST, SERVER_FAILED, SERVER_NO_RANGE, SERVER_PRECONDITION, @@ -67,7 +68,7 @@ namespace downloads { // A file path relative to the Downloads directory to contain the downloaded // file, possibly containing subdirectories. Absolute paths, empty paths, // and paths containing back-references ".." will cause an error. - // $ref:onDeterminingFilename allows suggesting a filename after the file's + // $(ref:onDeterminingFilename) allows suggesting a filename after the file's // MIME type and a tentative filename have been determined. DOMString? filename; @@ -189,23 +190,23 @@ namespace downloads { // Number of bytes received so far from the host, without considering file // compression. - long bytesReceived; + double bytesReceived; // Number of bytes in the whole file, without considering file compression, // or -1 if unknown. - long totalBytes; + double totalBytes; // Number of bytes in the whole file post-decompression, or -1 if unknown. - long fileSize; + double fileSize; // Whether the downloaded file still exists. This information may be out of // date because Chrome does not automatically watch for file removal. Call - // $ref:search() in order to trigger the check for file existence. When the + // $(ref:search)() in order to trigger the check for file existence. When the // existence check completes, if the file has been deleted, then an - // $ref:onChanged event will fire. Note that $ref:search() does not wait + // $(ref:onChanged) event will fire. Note that $(ref:search)() does not wait // for the existence check to finish before returning, so results from - // $ref:search() may not accurately reflect the file system. Also, - // $ref:search() may be called as often as necessary, but will not check for + // $(ref:search)() may not accurately reflect the file system. Also, + // $(ref:search)() may be called as often as necessary, but will not check for // file existence any more frequently than once every 10 seconds. boolean exists; @@ -220,57 +221,57 @@ namespace downloads { }; [inline_doc] dictionary DownloadQuery { - // This array of search terms limits results to $ref:DownloadItem whose + // This array of search terms limits results to $(ref:DownloadItem) whose // filename or url contain all of the search terms // that do not begin with a dash '-' and none of the search terms that do // begin with a dash. DOMString[]? query; - // Limits results to $ref:DownloadItem that + // Limits results to $(ref:DownloadItem) that // started before the given ms since the epoch. DOMString? startedBefore; - // Limits results to $ref:DownloadItem that + // Limits results to $(ref:DownloadItem) that // started after the given ms since the epoch. DOMString? startedAfter; - // Limits results to $ref:DownloadItem that ended before the given ms since the + // Limits results to $(ref:DownloadItem) that ended before the given ms since the // epoch. DOMString? endedBefore; - // Limits results to $ref:DownloadItem that ended after the given ms since the + // Limits results to $(ref:DownloadItem) that ended after the given ms since the // epoch. DOMString? endedAfter; - // Limits results to $ref:DownloadItem whose + // Limits results to $(ref:DownloadItem) whose // totalBytes is greater than the given integer. - long? totalBytesGreater; + double? totalBytesGreater; - // Limits results to $ref:DownloadItem whose + // Limits results to $(ref:DownloadItem) whose // totalBytes is less than the given integer. - long? totalBytesLess; + double? totalBytesLess; - // Limits results to $ref:DownloadItem whose + // Limits results to $(ref:DownloadItem) whose // filename matches the given regular expression. DOMString? filenameRegex; - // Limits results to $ref:DownloadItem whose + // Limits results to $(ref:DownloadItem) whose // url matches the given regular expression. DOMString? urlRegex; - // The maximum number of matching $ref:DownloadItem returned. Defaults to - // 1000. Set to 0 in order to return all matching $ref:DownloadItem. See - // $ref:search for how to page through results. + // The maximum number of matching $(ref:DownloadItem) returned. Defaults to + // 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See + // $(ref:search) for how to page through results. long? limit; - // Set elements of this array to $ref:DownloadItem properties in order to + // Set elements of this array to $(ref:DownloadItem) properties in order to // sort search results. For example, setting - // orderBy=['startTime'] sorts the $ref:DownloadItem by their + // orderBy=['startTime'] sorts the $(ref:DownloadItem) by their // start time in ascending order. To specify descending order, prefix with a // hyphen: '-startTime'. DOMString[]? orderBy; - // The id of the $ref:DownloadItem to query. + // The id of the $(ref:DownloadItem) to query. long? id; // Absolute URL. @@ -304,14 +305,14 @@ namespace downloads { // Number of bytes received so far from the host, without considering file // compression. - long? bytesReceived; + double? bytesReceived; // Number of bytes in the whole file, without considering file compression, // or -1 if unknown. - long? totalBytes; + double? totalBytes; // Number of bytes in the whole file post-decompression, or -1 if unknown. - long? fileSize; + double? fileSize; // Whether the downloaded file exists; boolean? exists; @@ -322,9 +323,9 @@ namespace downloads { DOMString? current; }; - dictionary LongDelta { - long? previous; - long? current; + dictionary DoubleDelta { + double? previous; + double? current; }; dictionary BooleanDelta { @@ -334,7 +335,7 @@ namespace downloads { // Encapsulates a change in a DownloadItem. [inline_doc] dictionary DownloadDelta { - // The id of the $ref:DownloadItem + // The id of the $(ref:DownloadItem) // that changed. long id; @@ -369,18 +370,20 @@ namespace downloads { StringDelta? error; // The change in totalBytes, if any. - LongDelta? totalBytes; + DoubleDelta? totalBytes; // The change in fileSize, if any. - LongDelta? fileSize; + DoubleDelta? fileSize; // The change in exists, if any. BooleanDelta? exists; }; [inline_doc] dictionary GetFileIconOptions { - // The size of the icon. The returned icon will be square with dimensions - // size * size pixels. The default size for the icon is 32x32 pixels. + // The size of the returned icon. The icon will be square with dimensions + // size * size pixels. The default and largest size for the icon is 32x32 + // pixels. The only supported sizes are 16 and 32. It is an error to specify + // any other size. [legalValues=(16,32)] long? size; }; @@ -398,19 +401,19 @@ namespace downloads { // filename and saveAs are specified, then the // Save As dialog will be displayed, pre-populated with the specified // filename. If the download started successfully, - // callback will be called with the new $ref:DownloadItem's + // callback will be called with the new $(ref:DownloadItem)'s // downloadId. If there was an error starting the download, // then callback will be called with - // downloadId=undefined and $ref:runtime.lastError will contain + // downloadId=undefined and $(ref:runtime.lastError) will contain // a descriptive string. The error strings are not guaranteed to remain // backwards compatible between releases. Extensions must not parse it. // |options|: What to download and how. - // |callback|: Called with the id of the new $ref:DownloadItem. + // |callback|: Called with the id of the new $(ref:DownloadItem). static void download(DownloadOptions options, optional DownloadCallback callback); - // Find $ref:DownloadItem. Set query to the empty object to get - // all $ref:DownloadItem. To get a specific $ref:DownloadItem, set only the + // Find $(ref:DownloadItem). Set query to the empty object to get + // all $(ref:DownloadItem). To get a specific $(ref:DownloadItem), set only the // id field. To page through a large number of items, set // orderBy: ['-startTime'], set limit to the // number of items per page, and set startedAfter to the @@ -418,14 +421,14 @@ namespace downloads { static void search(DownloadQuery query, SearchCallback callback); // Pause the download. If the request was successful the download is in a - // paused state. Otherwise $ref:runtime.lastError contains an error message. + // paused state. Otherwise $(ref:runtime.lastError) contains an error message. // The request will fail if the download is not active. // |downloadId|: The id of the download to pause. // |callback|: Called when the pause request is completed. static void pause(long downloadId, optional NullCallback callback); // Resume a paused download. If the request was successful the download is - // in progress and unpaused. Otherwise $ref:runtime.lastError contains an + // in progress and unpaused. Otherwise $(ref:runtime.lastError) contains an // error message. The request will fail if the download is not active. // |downloadId|: The id of the download to resume. // |callback|: Called when the resume request is completed. @@ -438,24 +441,24 @@ namespace downloads { static void cancel(long downloadId, optional NullCallback callback); // Retrieve an icon for the specified download. For new downloads, file - // icons are available after the $ref:onCreated event has been received. The + // icons are available after the $(ref:onCreated) event has been received. The // image returned by this function while a download is in progress may be // different from the image returned after the download is complete. Icon // retrieval is done by querying the underlying operating system or toolkit // depending on the platform. The icon that is returned will therefore // depend on a number of factors including state of the download, platform, // registered file types and visual theme. If a file icon cannot be - // determined, $ref:runtime.lastError will contain an error message. + // determined, $(ref:runtime.lastError) will contain an error message. // |downloadId|: The identifier for the download. // |callback|: A URL to an image that represents the download. static void getFileIcon(long downloadId, 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 + // 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 + // "downloads" permission. An $(ref:onChanged) event will fire // when the item is opened for the first time. // |downloadId|: The identifier for the downloaded file. static void open(long downloadId); @@ -467,24 +470,24 @@ namespace downloads { // Show the default Downloads folder in a file manager. static void showDefaultFolder(); - // Erase matching $ref:DownloadItem from history without deleting the - // downloaded file. An $ref:onErased event will fire for each - // $ref:DownloadItem that matches query, then + // Erase matching $(ref:DownloadItem) from history without deleting the + // downloaded file. An $(ref:onErased) event will fire for each + // $(ref:DownloadItem) that matches query, then // callback will be called. static void erase(DownloadQuery query, optional EraseCallback callback); - // Remove the downloaded file if it exists and the $ref:DownloadItem is - // complete; otherwise return an error through $ref:runtime.lastError. + // Remove the downloaded file if it exists and the $(ref:DownloadItem) is + // complete; otherwise return an error through $(ref:runtime.lastError). static void removeFile(long downloadId, optional NullCallback callback); // Prompt the user to accept a dangerous download. Does not automatically // accept dangerous downloads. If the download is accepted, then an - // $ref:onChanged event will fire, otherwise nothing will happen. When all + // $(ref:onChanged) event will fire, otherwise nothing will happen. When all // the data is fetched into a temporary file and either the download is not // dangerous or the danger has been accepted, then the temporary file is // renamed to the target filename, the |state| changes to 'complete', and - // $ref:onChanged fires. - // |downloadId|: The identifier for the $ref:DownloadItem. + // $(ref:onChanged) fires. + // |downloadId|: The identifier for the $(ref:DownloadItem). // |callback|: Called when the danger prompt dialog closes. static void acceptDanger(long downloadId, optional NullCallback callback); @@ -496,37 +499,37 @@ namespace downloads { // with the current browser profile. The shelf will be disabled as long as // at least one extension has disabled it. Enabling the shelf while at least // one other extension has disabled it will return an error through - // $ref:runtime.lastError. Requires the "downloads.shelf" + // $(ref:runtime.lastError). Requires the "downloads.shelf" // permission in addition to the "downloads" permission. static void setShelfEnabled(boolean enabled); }; interface Events { - // This event fires with the $ref:DownloadItem object when a download + // This event fires with the $(ref:DownloadItem) object when a download // begins. static void onCreated(DownloadItem downloadItem); // Fires with the downloadId when a download is erased from // history. - // |downloadId|: The id of the $ref:DownloadItem that was + // |downloadId|: The id of the $(ref:DownloadItem) that was // erased. static void onErased(long downloadId); - // When any of a $ref:DownloadItem's properties except + // When any of a $(ref:DownloadItem)'s properties except // bytesReceived and estimatedEndTime changes, // this event fires with the downloadId and an object // containing the properties that changed. static void onChanged(DownloadDelta downloadDelta); // During the filename determination process, extensions will be given the - // opportunity to override the target $ref:DownloadItem.filename. Each + // opportunity to override the target $(ref:DownloadItem.filename). Each // extension may not register more than one listener for this event. Each // listener must call suggest exactly once, either // synchronously or asynchronously. If the listener calls // suggest asynchronously, then it must return // true. If the listener neither calls suggest // synchronously nor returns true, then suggest - // will be called automatically. The $ref:DownloadItem will not complete + // will be called automatically. The $(ref:DownloadItem) will not complete // until all listeners have called suggest. Listeners may call // suggest without any arguments in order to allow the download // to use downloadItem.filename for its filename, or pass a @@ -536,9 +539,9 @@ namespace downloads { // suggestion object to suggest wins. In order to // avoid confusion regarding which extension will win, users should not // install extensions that may conflict. If the download is initiated by - // $ref:download and the target filename is known before the MIME type and + // $(ref:download) and the target filename is known before the MIME type and // tentative filename have been determined, pass filename to - // $ref:download instead. + // $(ref:download) instead. [maxListeners=1] static void onDeterminingFilename( DownloadItem downloadItem, SuggestFilenameCallback suggest); }; diff --git a/idl/events.json b/idl/events.json index b67b8b05..b09dba75 100644 --- a/idl/events.json +++ b/idl/events.json @@ -5,7 +5,7 @@ [ { "namespace": "events", - "description": "Use the chrome.events API to notify you when something interesting happens.", + "description": "The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens.", "compiler_options": { "implemented_in": "chrome/browser/extensions/api/declarative/declarative_api.h" }, @@ -112,6 +112,12 @@ "type": "string", "description": "Name of the event this function affects." }, + { + "name": "webViewInstanceId", + "type": "integer", + "nodoc": true, + "description": "If provided, this is an integer that uniquely identfies the associated with this function call." + }, { "name": "rules", "type": "array", @@ -145,9 +151,15 @@ "type": "string", "description": "Name of the event this function affects." }, + { + "name": "webViewInstanceId", + "type": "integer", + "nodoc": true, + "description": "If provided, this is an integer that uniquely identfies the associated with this function call." + }, { "name": "ruleIdentifiers", - "optional": "true", + "optional": true, "type": "array", "items": {"type": "string"}, "description": "If an array is passed, only rules with identifiers contained in this array are returned." @@ -178,9 +190,15 @@ "type": "string", "description": "Name of the event this function affects." }, + { + "name": "webViewInstanceId", + "type": "integer", + "nodoc": true, + "description": "If provided, this is an integer that uniquely identfies the associated with this function call." + }, { "name": "ruleIdentifiers", - "optional": "true", + "optional": true, "type": "array", "items": {"type": "string"}, "description": "If an array is passed, only rules with identifiers contained in this array are unregistered." diff --git a/idl/experimental_accessibility.json b/idl/experimental_accessibility.json index da3536e9..97bd69be 100644 --- a/idl/experimental_accessibility.json +++ b/idl/experimental_accessibility.json @@ -93,6 +93,25 @@ "selectionEnd": {"type": "integer", "description": "The index of the character where the selection ends, if this control contains editable text."} } }, + { + "id": "TreeDetails", + "type": "object", + "description": "Information about the state of a tree control.", + "properties": { + } + }, + { + "id": "TreeItemDetails", + "type": "object", + "description": "Information about a selected tree control item.", + "properties": { + "itemDepth": {"type": "integer", "description": "The 0-based depth of this tree item."}, + "itemCount": {"type": "integer", "description": "The number of items in the current depth."}, + "itemIndex": {"type": "integer", "description": "The 0-based index of this tree item at the current tree depth."}, + "childrenCount": {"type": "integer", "description": "The number of children of the current tree item."}, + "isItemExpanded": {"type": "boolean", "description": "True if this if this tree item is expanded."} + } + }, { "id": "AlertInfo", "type": "object", @@ -112,7 +131,7 @@ "type": { "type": "string", "description": "The type of this object, which determines the contents of 'details'.", - "enum": ["button", "checkbox", "combobox", "link", "menu", "menuitem", "radiobutton", "slider", "tab", "textbox", "window"] + "enum": ["alert", "button", "checkbox", "combobox", "link", "menu", "menuitem", "radiobutton", "slider", "tab", "textbox", "tree", "treeitem", "window"] }, "name": { "type": "string", @@ -134,7 +153,9 @@ { "$ref": "RadioButtonDetails" }, { "$ref": "SliderDetails" }, { "$ref": "TabDetails" }, - { "$ref": "TextBoxDetails" } + { "$ref": "TextBoxDetails" }, + { "$ref": "TreeDetails" }, + { "$ref": "TreeItemDetails" } ] } } @@ -293,6 +314,23 @@ "description": "Information about the menu that was closed." } ] + }, + { + "name": "onChromeVoxLoadStateChanged", + "type": "function", + "description": "Fired ChromeVox load state changes.", + "parameters": [ + { + "type": "boolean", + "name": "loading", + "description": "True if ChromeVox is loading; false if ChromeVox is unloading." + }, + { + "type": "boolean", + "name": "makeAnnouncements", + "description": "Whether to make introductory announcements." + } + ] } ] } diff --git a/idl/experimental_discovery.idl b/idl/experimental_discovery.idl deleted file mode 100644 index 4f631c35..00000000 --- a/idl/experimental_discovery.idl +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// An experimental API that allows extensions to inject suggest links in the recommended pane of the New Tab Page. -namespace experimental.discovery { - - dictionary SuggestDetails { - // The URL to suggest and that will be displayed in the new tab page under - // the recommended pane. - DOMString linkUrl; - - // The linkified text. It should be relatively short. - DOMString linkText; - - // The url of the image to use as a tile. - DOMString? urlImage; - - // A score indicating how interesting that suggestion is. The value must be - // between 0 and 1. A suggestion with score 1 is twice as likely to be - // displayed than one with a score of 0.5. Defaults to 1. - // TODO: need minimum=0 and maximum=1. - double? score; - }; - - interface Functions { - // Suggests a URL for discovery. - // |details|: Detailed information on the URL to suggest. - static void suggest(SuggestDetails details); - - // Removes a URL that was previously suggested for discovery by this - // extension. - // |linkUrl|: The URl to remove from discovery. Must be exactly the same as - // a linkUrl previously used on a call to suggest. - static void removeSuggestion(DOMString linkUrl); - - // Clear all the URLs that were previously suggested for discovery by this - // extension. - static void clearAllSuggestions(); - }; -}; diff --git a/idl/experimental_history.json b/idl/experimental_history.json deleted file mode 100644 index f7f2290b..00000000 --- a/idl/experimental_history.json +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "experimental.history", - "description": "Use the chrome.experimental.history API to interact with the browser's record of most visited pages.", - "types": [ - { - "id": "MostVisitedItem", - "type": "object", - "properties": { - "url": {"type": "string", "description": "The URL navigated to by a user."}, - "title": {"type": "string", "description": "The title of the page when it was last loaded."} - } - } - ], - "functions": [ - { - "name": "getMostVisited", - "type": "function", - "description": "Retrieves most visited URLs on the time specified.", - "parameters": [ - { "name": "details", - "type": "object", - "properties": { - "filterTime": {"type": "number", "optional": true, "description": "Sets the time to be used as a basis for the query, represented in milliseconds since the epoch. Defaults to the current time."}, - "filterWidth": {"type": "number", "optional": true, "description": "Limit results to those visited at filterTime +/- this on each day, in milliseconds."}, - "dayOfTheWeek": {"type": "integer", "optional": true, "minimum": 0, "description": "Limit results to those visited on this day of the week (0 - Sunday, 1 - Monday, etc.) starting with this week."}, - "maxResults": {"type": "integer", "optional": true, "minimum": 0, "description": "The maximum number of results to retrieve. Defaults to 100."} - } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { "name": "results", "type": "array", "items": { "$ref": "MostVisitedItem"} } - ] - } - ] - } - ] - } -] diff --git a/idl/experimental_identity.idl b/idl/experimental_identity.idl deleted file mode 100644 index 9bcee6ba..00000000 --- a/idl/experimental_identity.idl +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// The chrome.experimental.identity API. -namespace experimental.identity { - - [inline_doc] dictionary ExperimentalTokenDetails { - // Whether to prompt the user to log in or grant scope permissions (if they - // have not already done so). Default is false. - boolean? interactive; - }; - - [inline_doc] dictionary ExperimentalWebAuthFlowDetails { - // The URL that initiates the auth flow. - DOMString url; - - // Whether to launch auth flow in interactive mode. Default is false. - boolean? interactive; - - // Width of the window, if one is shown in interactive mode. - long? width; - - // Height of the window, if one is shown in interactive mode. - long? height; - - // X coordinate of the window, if one is shown in interactive mode. - long? left; - - // Y coordinate of the window, if one is shown in interactive mode. - long? top; - }; - - callback GetAuthTokenCallback = void (optional DOMString token); - callback InvalidateAuthTokenCallback = void (); - callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); - - interface Functions { - // Gets an OAuth2 access token as specified by the manifest. - // - // |details| : Token options. - // |callback| : Called with an OAuth2 access token as specified by the - // manifest, or undefined if there was an error. - static void getAuthToken(optional ExperimentalTokenDetails details, - GetAuthTokenCallback callback); - - // Starts an auth flow at the specified URL. - // - // |details| : WebAuth flow options. - // |callback| : Called with the URL redirected back to your application. - static void launchWebAuthFlow(ExperimentalWebAuthFlowDetails details, - LaunchWebAuthFlowCallback callback); - }; -}; diff --git a/idl/extension.json b/idl/extension.json index f2ba0948..efb7f4b8 100644 --- a/idl/extension.json +++ b/idl/extension.json @@ -28,10 +28,10 @@ { "name": "sendRequest", "nocompile": true, - "nodoc": true, + "deprecated": "Please use $(ref:runtime.sendMessage).", "type": "function", "allowAmbiguousOptionalArguments": true, - "description": "Deprecated: Please use sendMessage.", + "description": "Sends a single request to other listeners within the extension. Similar to $(ref:runtime.connect), but only sends a single request with an optional response. The $(ref:extension.onRequest) event is fired in each page of the extension.", "parameters": [ {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."}, { "type": "any", "name": "request" }, @@ -43,7 +43,7 @@ { "name": "response", "type": "any", - "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message." + "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." } ] } @@ -119,10 +119,10 @@ { "name": "getExtensionTabs", "nocompile": true, - "nodoc": true, + "deprecated": "Please use $(ref:extension.getViews) {type: \"tab\"}.", "type": "function", "maximumManifestVersion": 1, - "description": "Deprecated. Please use getViews({type: 'TAB'}). Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.", + "description": "Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window.", "parameters": [ {"type": "integer", "name": "windowId", "optional": true} ], @@ -187,12 +187,12 @@ "events": [ { "name": "onRequest", - "nodoc": true, + "deprecated": "Please use $(ref:runtime.onMessage).", "type": "function", "options": { "unmanaged": true }, - "description": "Deprecated: please use onMessage.", + "description": "Fired when a request is sent from either an extension process or a content script.", "parameters": [ {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."}, {"name": "sender", "$ref": "runtime.MessageSender" }, @@ -201,12 +201,12 @@ }, { "name": "onRequestExternal", - "nodoc": true, + "deprecated": "Please use $(ref:runtime.onMessageExternal).", "type": "function", "options": { "unmanaged": true }, - "description": "Deprecated: please use onMessageExternal.", + "description": "Fired when a request is sent from another extension.", "parameters": [ {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."}, {"name": "sender", "$ref": "runtime.MessageSender" }, diff --git a/idl/feedback_private.idl b/idl/feedback_private.idl index 93f799c3..ba48e72a 100644 --- a/idl/feedback_private.idl +++ b/idl/feedback_private.idl @@ -47,6 +47,9 @@ namespace feedbackPrivate { // feedback report. SystemInformation[]? systemInformation; + // True if we have permission to add histograms to this feedback report. + boolean sendHistograms; + // TODO(rkc): Remove these once we have bindings to send blobs to Chrome. // Used internally to store the blob uuid after parameter customization. DOMString? attachedFileBlobUuid; diff --git a/idl/file_browser_private.json b/idl/file_browser_private.json deleted file mode 100644 index b9ee773e..00000000 --- a/idl/file_browser_private.json +++ /dev/null @@ -1,1157 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace":"fileBrowserPrivate", - "compiler_options": { - "implemented_in": "chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_functions.h" - }, - "description": "none", - "platforms": ["chromeos"], - "types": [ - { - "id": "FileTask", - "type": "object", - "description": "A file task represents an action that the file manager can perform over the currently selected files. See chrome/browser/chromeos/extensions/file_manager/file_tasks.h for details about how file tasks are handled.", - "properties": { - "taskId": { - "type": "string", - "description": "The unique identifier of the task." - }, - "title": { - "type": "string", - "description": "Task title (ex. App name)." - }, - "iconUrl": { - "type": "string", - "description": "Task icon url (from chrome://extension-icon/...)" - }, - "isDefault": { - "type": "boolean", - "description": "True if this task is a default task for the selected files." - } - } - }, - { - "id": "DriveEntryProperties", - "type": "object", - "description": "Drive file properties.", - "properties": { - "thumbnailUrl": { - "type": "string", - "optional": true, - "description": "URL to the Drive thumbnail image for this file." - }, - "imageWidth": { - "type": "integer", - "optional": true, - "description": "Width, if the entry is an image." - }, - "imageHeight": { - "type": "integer", - "optional": true, - "description": "Height, if the entry is an image." - }, - "imageRotation": { - "type": "integer", - "optional": true, - "description": "Rotation in clockwise degrees, if the entry is an image." - }, - "isPinned": { - "type": "boolean", - "optional": true, - "description": "True if the file is pinned in Drive cache." - }, - "isPresent": { - "type": "boolean", - "optional": true, - "description": "True if the file is present in Drive cache." - }, - "isHosted": { - "type": "boolean", - "optional": true, - "description": "True if the file is hosted on a Drive server instead of local." - }, - "customIconUrl": { - "type": "string", - "optional": true, - "description": "URL to the custom icon for this file." - }, - "contentMimeType": { - "type": "string", - "optional": true, - "description": "Drive MIME type for this file." - }, - "sharedWithMe": { - "type": "boolean", - "optional": true, - "description": "True if the entry is labeled as shared-with-me." - } - } - }, - { - "id": "MountPointSizeStats", - "type": "object", - "description": "Information about total and remaining size on the mount point.", - "properties": { - "totalSize": { - "type": "number", - "description": "Approximate total available size on the mount point." - }, - "remainingSize": { - "type": "number", - "description": "Approximate remaining available size on the mount point." - } - } - }, - { - "id": "VolumeMetadata", - "type": "object", - "description": "Mounted disk volume metadata.", - "properties": { - "mountPath": { - "type": "string", - "description": "Disk volume mount point path." - }, - "sourcePath": { - "type": "string", - "optional": true, - "description": "The path to the mounted device, archive file or network resource." - }, - "volumeType": { - "type": "string", - "enum": ["drive", "downloads", "removable", "archive"], - "description": "Type of the mounted volume." - }, - "deviceType": { - "type": "string", - "optional": true, - "enum": ["usb", "sd", "optical", "mobile", "unknown"], - "description": "Device type. Available if this is removable volume." - }, - "isReadOnly": { - "type": "boolean", - "description": "Flag that specifies if volume is mounted in read-only mode." - }, - "mountCondition": { - "type": "string", - "optional": true, - "enum": ["unknown", "unsupported"], - "description": "Additional data about mount, for example, that the filesystem is not supported." - } - } - }, - { - "id": "MountCompletedEvent", - "type": "object", - "description": "Payload data for mount event.", - "properties": { - "eventType": { - "type": "string", - "enum": ["mount", "unmount"], - "description": "Is the event raised for mounting or unmounting." - }, - "status": { - "type": "string", - "enum": ["success", "error_unknown", "error_internal", - "error_invalid_argument", "error_invalid_path", - "error_path_already_mounted", "error_path_not_mounted", - "error_directory_creation_failed", - "error_invalid_mount_options", - "error_invalid_unmount_options", - "error_insufficient_permissions", - "error_mount_program_not_found", - "error_mount_program_failed", "error_invalid_device_path", - "error_unknown_filesystem", "error_unsuported_filesystem", - "error_invalid_archive", "error_authentication", - "error_path_unmounted"], - "description": "Event type that tells listeners if mount was successful or an error occurred. It also specifies the error." - }, - "volumeMetadata": { - "$ref": "VolumeMetadata", - "description": "Metadata of the mounted volume." - } - } - }, - { - "id": "FileTransferStatus", - "type": "object", - "description": "Payload data for file transfer status updates.", - "properties": { - "fileUrl": { - "type": "string", - "description": "URL of file that is being transfered." - }, - "transferState": { - "type": "string", - "enum": ["started", "in_progress", "completed", "failed"], - "description": "File transfer progress state." - }, - "transferType": { - "type": "string", - "enum": ["upload", "download"], - "description": "Defines file transfer direction." - }, - "processed": { - "type": "number", - "optional": true, - "description": "Approximated completed portion of the transfer operation." - }, - "total": { - "type": "number", - "optional": true, - "description": "Approximated total size of transfer operation." - } - } - }, - { - "id": "CopyProgressStatus", - "type": "object", - "description": "Payload data for copy status progress updates.", - "properties": { - "type": { - "type": "string", - "enum": ["begin_copy_entry", "end_copy_entry", "progress", "success", "error"], - "description": "The type of the progress event. \"begin_copy_entry\" is fired for each entry (file or directory) before starting the copy operation, \"end_copy_entry\" is fired for each entry (file or directory) after ending the copy operation. \"progress\" is fired periodically to report progress of a file copy (not directory). \"success\" is fired after all entries are copied. \"error\" is fired when an error occurs." - }, - "sourceUrl": { - "type": "string", - "optional": true, - "description": "URL for the entry currently being copied. This field is particularly useful when a directory copy is initiated with startCopy(). The field tells what file/directory in that directory is now being copied." - }, - "destinationUrl": { - "type": "string", - "optional": true, - "description": "URL for the entry currently being created. This field is particularly useful when a directory copy is initiated with startCopy(). The field tells what file/directory in that directory is being created. Available only for end_copy_entry and success." - }, - "size": { - "type": "number", - "optional": true, - "description": "Number of processed bytes for the file currently being copied. Available only for \"progress\" event. To show the progress bar, a caller needs to pre-compute the size of files being copied for the file (not directory)." - }, - "error": { - "type": "integer", - "optional": true, - "description": "FileError's code of the error. Available only for ERROR event." - } - } - }, - { - "id": "FileTransferCancelStatus", - "type": "object", - "description": "Payload data for file transfer cancel response.", - "properties": { - "fileUrl": { - "type": "string", - "description": "URL of file that is being transfered." - }, - "canceled": { - "type": "boolean", - "description": "True if ongoing transfer operation was found and canceled." - } - } - }, - { - "id": "FileWatchEvent", - "type": "object", - "description": "Directory change notification details.", - "properties": { - "eventType": { - "type": "string", - "enum": ["changed", "error"], - "description": "Specifies type of event that is raised." - }, - "directoryUrl": { - "type": "string", - "description": "URL of watched directory." - } - } - } - ], - "functions": [ - { - "name": "logoutUser", - "type": "function", - "description": "Logout the current user.", - "parameters": [] - }, - { - "name": "cancelDialog", - "type": "function", - "description": "Cancels file selection.", - "parameters": [] - }, - { - "name": "executeTask", - "description": "Executes file browser task over selected files", - "parameters": [ - { - "name": "taskId", - "type": "string", - "description": "The unique identifier of task to execute." - }, - { - "name": "fileUrls", - "type": "array", - "description": "Array of file URLs", - "items": { "type": "string" } - }, - { - "name": "callback", - "type": "function", - "optional": true, - "parameters": [ - { - "name": "success", - "type": "boolean", - "optional": true, - "description": "True of task execution was successfully initiated." - } - ] - } - ] - }, - { - "name": "setDefaultTask", - "description": "Sets the default task for the supplied MIME types and suffixes of the supplied file URLs. Lists of MIME types and URLs may contain duplicates.", - "parameters": [ - { - "name": "taskId", - "type": "string", - "description": "The unique identifier of task to mark as default." - }, - { - "name": "fileUrls", - "type": "array", - "description": "Array of selected file URLs to extract suffixes from.", - "items": { "type": "string" } - }, - { - "name": "mimeTypes", - "type": "array", - "optional": true, - "description": "Array of selected file MIME types.", - "items": { "type": "string" } - }, - { - "name": "callback", - "type": "function", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "getFileTasks", - "description": "Gets the list of tasks that can be performed over selected files.", - "parameters": [ - { - "name": "fileUrls", - "type": "array", - "description": "Array of selected file URLs", - "items": { "type": "string" } - }, - { - "name": "mimeTypes", - "type": "array", - "description": "Array of selected file MIME types", - "items": { "type": "string" } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "tasks", - "type": "array", - "items": {"$ref": "FileTask"}, - "description": "The list of matched file URL patterns for this task." - } - ] - } - ] - }, - { - "name": "getStrings", - "type": "function", - "description": "Gets localized strings and initialization data.", - "parameters": [ - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "object", - "additionalProperties": { "type": "any" } - } - ] - } - ] - }, - { - "name": "addFileWatch", - "description": "Adds file watch.", - "parameters": [ - { - "name": "fileUrl", - "type": "string", - "description": "URL of file to watch" - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "success", - "type": "boolean", - "optional": true, - "description": "True when file watch is successfully added." - } - ] - } - ] - }, - { - "name": "removeFileWatch", - "description": "Removes file watch.", - "parameters": [ - { - "name": "fileUrl", - "type": "string", - "description": "URL of watched file to remove" - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "success", - "type": "boolean", - "optional": true, - "description": "True when file watch is successfully removed." - } - ] - } - ] - }, - { - "name": "requestFileSystem", - "description": "Requests access to the file system specially set up for Files.app. The filesystem has multiple mount points which provide access to the user's Downloadsfolder, removal media like SD cards, and Drive. See comments at CrosDiskMountPorivder for details.", - "parameters": [ - { - "name": "fileSystemId", - "type": "string", - "description": "The ID of the file system to request. The file system ID is delivered to JavaScript as part of VolumeMetadata (This is not yet implemented). By specifying \"compatible\", this function behaves in the compatible mode, where the returned FileSystem object gives access to all file systems (i.e. all file systems are provided inside the single FileSystem object). In the new \"multi FileSystem object model\", a separate FileSystem object is created for each file system. \"compatible\" parameter will be removed once Files.app is switched to the multi FileSystem object model. crbug.com/284963" - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "fileSystem", - "type": "object", - "optional": true, - "additionalProperties": { "type": "any" }, - "description": "A DOMFileSystem instance for local file system access. null if the caller has no appropriate permissions." - } - ] - } - ] - }, - { - "name": "selectFiles", - "type": "function", - "description": "Selects multiple files.", - "parameters": [ - { - "name": "selectedPaths", - "type": "array", - "description": "Array of selected paths", - "items": {"type": "string"} - }, - { - "name": "shouldReturnLocalPath", - "type": "boolean", - "description": "true if paths need to be resolved to local paths." - }, - { - "name": "callback", - "type": "function", - "parameters": [] - } - ] - }, - { - "name": "selectFile", - "type": "function", - "description": "Selects a file.", - "parameters": [ - { - "name": "selectedPath", - "type": "string", - "description": "A selected path" - }, - { - "name": "index", - "type": "integer", - "description": "Index of Filter" - }, - { - "name": "forOpening", - "type": "boolean", - "description": "true if paths are selected for opening. false if for saving." - }, - { - "name": "shouldReturnLocalPath", - "type": "boolean", - "description": "true if paths need to be resolved to local paths." - }, - { - "name": "callback", - "type": "function", - "parameters": [] - } - ] - }, - { - "name": "getDriveEntryProperties", - "description": "Requests Drive file properties for a file", - "parameters": [ - { - "name": "fileUrl", - "type": "string", - "description": "URL of a file" - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "fileProperties", - "$ref": "DriveEntryProperties", - "description": "A dictionary containing properties of the requested entry." - } - ] - } - ] - }, - { - "name": "pinDriveFile", - "description": "Pins/unpins a Drive file in the cache", - "parameters": [ - { - "name": "fileUrl", - "type": "string", - "description": "URL of a file to pin/unpin." - }, - { - "name": "pin", - "type": "boolean", - "description": "Pass true to pin the file." - }, - { - "name": "callback", - "type": "function", - "optional": true, - "description": "Completion callback. $ref:runtime.lastError will be set if there was an error.", - "parameters": [] - } - ] - }, - { - "name": "getDriveFiles", - "description": "Get Drive files", - "parameters": [ - { - "name": "fileUrls", - "type": "array", - "description": "Array of Drive file URLs to get.", - "items": { "type": "string" } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "localFilePaths", - "type": "array", - "items": {"type": "string"}, - "description": "An array of the local file paths for the requested files, one entry for each file in fileUrls." - } - ] - } - ] - }, - { - "name": "addMount", - "description": "Mount a resource or a file.", - "parameters": [ - { - "name": "source", - "type": "string", - "description": "Mount point source. For compressed files it is relative file path within external file system" - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "sourcePath", - "type": "string", - "description": "Source path of the mount." - } - ] - } - ] - }, - { - "name": "removeMount", - "description": "Unmounts a mounted resource.", - "parameters": [ - { - "name": "mountPath", - "type": "string", - "description": "A path of the mount." - } - ] - }, - { - "name": "getVolumeMetadataList", - "description": "Get the list of mounted volumes.", - "parameters": [ - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "volumeMetadataList", - "type": "array", - "items": {"$ref": "VolumeMetadata"}, - "description": "The list of VolumeMetadata representing mounted volumes." - } - ] - } - ] - }, - { - "name": "cancelFileTransfers", - "description": "Cancels ongoing file transfers for selected files.", - "parameters": [ - { - "name": "fileUrls", - "type": "array", - "description": "Array of files for which ongoing transfer should be canceled.", - "items": {"type": "string"} - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "fileTransferCancelStatuses", - "type": "array", - "items": {"$ref": "FileTransferCancelStatus"}, - "description": "The list of FileTransferCancelStatus." - } - ] - } - ] - }, - { - "name": "startCopy", - "description": "Starts to copy an entry. If the source is a directory, the copy is done recursively.", - "parameters": [ - { - "name": "sourceUrl", - "type": "string", - "description": "URL of the source entry to be copied." - }, - { - "name": "parent", - "type": "string", - "description": "URL of the destination directory." - }, - { - "name": "newName", - "type": "string", - "description": "Name of the new entry. It shouldn't contain '/'." - }, - { - "name": "callback", - "type": "function", - "description": "Completion callback.", - "parameters": [ - { - "name": "copyId", - "type": "integer", - "description": "ID of the copy task. Can be used to identify the progress, and to cancel the task." - } - ] - } - ] - }, - { - "name": "cancelCopy", - "description": "Cancels the running copy task.", - "parameters": [ - { - "name": "copyId", - "type": "integer", - "description": "ID of the copy task to be cancelled." - }, - { - "name": "callback", - "type": "function", - "optional": true, - "description": "Completion callback of the cancel.", - "parameters": [] - } - ] - }, - { - "name": "getSizeStats", - "description": "Retrieves total and remaining size of a mount point.", - "parameters": [ - { - "name": "mountPath", - "type": "string", - "description": "Mount point path." - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name" : "sizeStats", - "optional": true, - "$ref": "MountPointSizeStats", - "description": "Name/value pairs of size stats. Will be undefined if stats could not be determined." - } - ] - } - ] - }, - { - "name": "formatDevice", - "description": "Formats a mounted device", - "parameters": [ - { - "name": "mountPath", - "type": "string", - "description": "Device's mount path." - } - ] - }, - { - "name": "getPreferences", - "description": "Retrieves file manager preferences .", - "parameters": [ - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "result", - "type": "object", - "properties": { - "driveEnabled": {"type":"boolean"}, - "cellularDisabled": {"type":"boolean"}, - "hostedFilesDisabled": {"type":"boolean"}, - "use24hourClock": {"type":"boolean"}, - "allowRedeemOffers": {"type":"boolean"} - } - } - ] - } - ] - }, - { - "name": "setPreferences", - "description": "Sets file manager preferences.", - "parameters": [ - { - "name": "changeInfo", - "type": "object", - "properties": { - "cellularDisabled": {"type":"boolean", "optional":true}, - "hostedFilesDisabled": {"type":"boolean", "optional":true} - } - } - ] - }, - { - "name": "searchDrive", - "type": "function", - "description": "Performs drive content search.", - "parameters": [ - { - "name": "searchParams", - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "Search query." - }, - "nextFeed": { - "type": "string", - "description": "ID of the search feed that should be fetched next. Value passed here should be gotten from previous searchDrive call. It can be empty for the initial search request." - } - } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "entries", - "type": "array", - "items": { - "type": "object", - "isInstanceOf": "Entry", - "additionalProperties": { "type": "any" }, - "description": "An Entry object which represents a Drive file. The conversion into a kind of FileEntry object is done in file_browser_handler_custom_bindings.cc. For filesystem API's Entry interface, see The Entry interface." - } - }, - { - "name": "nextFeed", - "type": "string", - "description": "ID of the feed that contains next chunk of the search result. Should be sent to the next searchDrive request to perform incremental search." - } - ] - } - ] - }, - { - "name": "searchDriveMetadata", - "type": "function", - "description": "Performs drive metadata search.", - "parameters": [ - { - "name": "searchParams", - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "Search query. It can be empty. Any filename matches to an empty query." - }, - "types": { - "type": "string", - "enum": ["EXCLUDE_DIRECTORIES", "SHARED_WITH_ME", "OFFLINE", "ALL"], - "description": "The type of entry that is needed. Default to ALL." - }, - "maxResults": { - "type": "integer", - "description": "Maximum number of results." - } - } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { - "type": "object", - "properties": { - "entry": { - "type": "object", - "isInstanceOf": "Entry", - "additionalProperties": { "type": "any" }, - "description": "A dictionary object which represents a Drive file. This will be converted into a kind of FileEntry object. See file_browser_handler_custom_bindings.cc for details. For filesystem API's Entry interface, see The Entry interface." - }, - "highlightedBaseName": { - "type": "string", - "description": "The base name of a Drive file that matched the search query. The matched sub strings are highlighted with element. Meta characters are escaped like <." - } - }, - "description": "Entry and Drive-related properties representing a search result." - } - } - ] - } - ] - }, - { - "name": "clearDriveCache", - "description": "Clear all Drive local caches including locally cached user files and filesystem metadata. The file system metadata will be reloaded from the server immediately.", - "parameters": [] - }, - { - "name": "zipSelection", - "description": "Create a zip file for the selected files.", - "parameters": [ - { - "name": "dirURL", - "type": "string", - "description": "URL of the directory containing the selected files." - }, - { - "name": "selectionUrls", - "type": "array", - "description": "URLs of the selected files. The files must be under the directory specified by dirURL.", - "items": { "type": "string" } - }, - { - "name": "destName", - "type": "string", - "description": "Name of the destination zip file. The zip file will be created under the directory specified by dirURL." - }, - { - "name": "callback", - "type": "function", - "optional": true, - "parameters": [ - { - "name" : "success", - "type" : "boolean", - "optional": true - } - ] - } - ] - }, - { - "name": "getDriveConnectionState", - "description": "Retrieves the state of the current drive connection.", - "parameters": [ - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "result", - "type": "object", - "properties": { - "type": {"type": "string"}, - "reasons": { - "type": "array", - "description": "Reasons of offline.", - "items": { "type": "string" } - } - } - } - ] - } - ] - }, - { - "name": "validatePathNameLength", - "description": "Checks whether the path name length fits in the limit of the filesystem.", - "parameters": [ - { - "name": "parent_directory_url", - "type": "string", - "description": "The URL of the parent directory entry." - }, - { - "name": "name", - "type": "string", - "description": "The name of the file." - }, - { - "name": "callback", - "type": "function", - "description": "Called back when the check is finished.", - "parameters": [ - { - "name": "result", - "type": "boolean", - "description": "true if the length is in the valid range, false otherwise." - } - ] - } - ] - }, - { - "name": "zoom", - "description": "Changes the zoom factor of the Files.app.", - "parameters": [ - { - "name": "operation", - "type": "string", - "description": "Zooming mode.", - "enum": ["in", "out", "reset"] - } - ] - }, - { - "name": "requestAccessToken", - "description": "Requests a Drive API OAuth2 access token.", - "parameters": [ - { - "name": "refresh", - "type": "boolean", - "description": "Whether the token should be refetched instead of using the cached one." - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "accessToken", - "type": "string", - "description": "OAuth2 access token, or an empty string if failed to fetch." - } - ] - } - ] - }, - { - "name": "requestWebStoreAccessToken", - "description": "Requests a Webstore API OAuth2 access token.", - "parameters": [ - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "accessToken", - "type": "string", - "description": "OAuth2 access token, or an empty string if failed to fetch." - } - ] - } - ] - }, - { - "name": "getShareUrl", - "description": "Requests a share dialog url for the specified file.", - "parameters": [ - { - "name": "url", - "type": "string", - "description": "Url for the file." - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "shareUrl", - "type": "string", - "description": "Share Url for the sharing dialog." - } - ] - } - ] - }, - { - "name": "installWebstoreItem", - "type": "function", - "description": "Requests to install a webstore item.", - "parameters": [ - { - "name": "item_id", - "type": "string", - "description": "The id of the item to install." - }, - { - "name": "callback", - "type": "function", - "parameters": [] - } - ] - } - ], - "events": [ - { - "name": "onMountCompleted", - "type": "function", - "description": "Fired when mount event is detected.", - "parameters": [ - { - "$ref": "MountCompletedEvent", - "name": "event", - "description": "MountCompleted event information." - } - ] - }, - { - "name": "onFileTransfersUpdated", - "type": "function", - "description": "Fired when file transfers with remote file system are in progress.", - "parameters": [ - { - "type": "array", - "items": {"$ref": "FileTransferStatus"}, - "name": "event", - "description": "List of ongoing file statuses for ongoing transfer operations." - } - ] - }, - // Here is an example of onCopyProgress: - // Suppose a/b/c.txt (100bytes) and a/b/d.txt (200bytes), and trying to - // copy a to x recursively. The events will be: - // - // begin_copy_entry "a" - // - // end_copy_entry "a" "x/a" - // - // begin_copy_entry "a/b" - // - // end_copy_entry "a/b" "x/a/b" - // - // begin_copy_entry "a/b/c.txt" - // progress "a/b/c.txt" 0 - // progress "a/b/c.txt" 10 - // : - // progress "a/b/c.txt" 100 - // end_copy_entry "a/b/c.txt" "x/a/b/c.txt" - // - // begin_copy_entry "a/b/d.txt" - // progress "a/b/d.txt" 0 - // progress "a/b/d.txt" 10 - // : - // progress "a/b/d.txt" 200 - // end_copy_entry "a/b/d.txt" "x/a/b/d.txt" - // - // success "a" "x/a" - { - "name": "onCopyProgress", - "type": "function", - "description": "Periodically fired during a copy task to report its progress update.", - "parameters": [ - { - "type": "integer", - "name": "copyId", - "description": "Id of the copy task of this progress update." - }, - { - "$ref": "CopyProgressStatus", - "name": "status", - "description": "Progress update status." - } - ] - }, - { - "name": "onDirectoryChanged", - "type": "function", - "description": "Fired when watched file change event is detected in a watched directory.", - "parameters": [ - { - "$ref": "FileWatchEvent", - "name": "event", - "description": "File watch event information." - } - ] - }, - { - "name": "onPreferencesChanged", - "type": "function", - "description": "Fired when file manager preferences change. The preferences can be retrieved via 'getPreferences'.", - "parameters": [] - }, - { - "name": "onDriveConnectionStatusChanged", - "type": "function", - "description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getDriveConnectionState'.", - "parameters": [] - } - ] - } -] diff --git a/idl/file_system.idl b/idl/file_system.idl index 3eb20ccf..61a9f27d 100644 --- a/idl/file_system.idl +++ b/idl/file_system.idl @@ -53,12 +53,7 @@ namespace fileSystem { }; dictionary ChooseEntryOptions { - // Type of the prompt to show. The default is 'openFile'. From Chrome 31 - // onwards, 'openWritableFile' is deprecated and 'openFile' will return a - // writable file entry for apps with the 'write' permission under - // 'fileSystem'. 'openDirectory' is new in Chrome 31 and will fail with a - // runtime error if the application doesn't have the 'directory' permission - // under 'fileSystem'. + // Type of the prompt to show. The default is 'openFile'. ChooseEntryType? type; // The suggested file name that will be presented to the user as the diff --git a/idl/gcm.json b/idl/gcm.json index cd814128..ca3dfd1c 100644 --- a/idl/gcm.json +++ b/idl/gcm.json @@ -5,7 +5,7 @@ [ { "namespace": "gcm", - "description": "Use chrome.gcm to enable apps and extensions to send and receive messages through Google Cloud Messaging for Android.", + "description": "Use chrome.gcm to enable apps and extensions to send and receive messages through Google Cloud Messaging.", "properties": { "MAX_MESSAGE_SIZE": { "value": 4096, @@ -21,7 +21,7 @@ { "name": "senderIds", "type": "array", - "items": { + "items": { "type": "string", "minLength": 1 }, @@ -32,9 +32,9 @@ { "name": "callback", "type": "function", - "description": "Function called when registration completes. It should check $ref:runtime.lastError for error when registrationId is empty.", + "description": "Function called when registration completes. It should check $(ref:runtime.lastError) for error when registrationId is empty.", "parameters": [ - { + { "name": "registrationId", "type": "string", "description": "A registration ID assigned to the application by the GCM." @@ -43,6 +43,19 @@ } ] }, + { + "name": "unregister", + "type": "function", + "description": "Unregisters the application from GCM.", + "parameters": [ + { + "name": "callback", + "type": "function", + "description": "A function called after the unregistration completes. Unregistration was successful if $(ref:runtime.lastError) is not set.", + "parameters": [] + } + ] + }, { "name": "send", "type": "function", @@ -61,14 +74,14 @@ "messageId": { "type": "string", "minLength": 1, - "description": "The ID of the message. It must be unique for each message." + "description": "The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID." }, "timeToLive": { "type": "integer", "minimum": 0, "maximum": 2419200, "optional": true, - "description": "Time-to-live of the message in seconds. If it is not possible to send the message wihtin that time an error will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 2419200 seconds (4 weeks)." + "description": "Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 2419200 seconds (4 weeks)." }, "data": { "type": "object", @@ -77,14 +90,14 @@ "type": "string", "minLength": 1 }, - "description": "Message data to send to the server. goog. and google are disallowed as key prefixes. Sum of all key/value pairs should not exceed $ref:MAX_MESSAGE_SIZE." + "description": "Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed $(ref:gcm.MAX_MESSAGE_SIZE)." } } }, { "name": "callback", "type": "function", - "description": "A function called after the message is successfully queued for sending. $ref:runtime.lastError should be checked, to ensure a message was sent without problems.", + "description": "A function called after the message is successfully queued for sending. $(ref:runtime.lastError) should be checked, to ensure a message was sent without problems.", "parameters": [ { "name": "messageId", @@ -102,7 +115,7 @@ "type": "function", "description": "Fired when a message is received through GCM.", "parameters": [ - { + { "name": "message", "type": "object", "description": "A message received from another party via GCM.", @@ -114,6 +127,11 @@ "type": "string" }, "description": "The message data." + }, + "collapseKey": { + "type": "string", + "optional": true, + "desctription": "The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details." } } } @@ -122,7 +140,7 @@ { "name": "onMessagesDeleted", "type": "function", - "description": "Fired when a GCM server had to delete messages to the application from its queue in order to manage its size. The app is expected to handle that case gracefully, e.g. by running a full sync with its server." + "description": "Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event." }, { "name": "onSendError", diff --git a/idl/hid.idl b/idl/hid.idl index a718ace3..d92a063d 100644 --- a/idl/hid.idl +++ b/idl/hid.idl @@ -6,28 +6,13 @@ // This API provides access to HID operations from within the context of an app. // Using this API, apps can function as drivers for hardware devices. namespace hid { - // HID usage pair. Each enumerated device interface exposes an array of - // these objects. Values correspond to those defined by the - // window.navigator.language
.", + "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).", "parameters": [ { "type": "function", @@ -44,6 +44,17 @@ "type": "string", "description": "Message localized for current locale." } + }, + { + "name": "getUILanguage", + "type": "function", + "nocompile": true, + "description": "Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) which returns the preferred user languages.", + "parameters": [], + "returns": { + "type": "string", + "description": "The browser UI language code such as en-US or fr-FR." + } } ], "events": [] diff --git a/idl/identity.idl b/idl/identity.idl index 0cd65143..10c73422 100644 --- a/idl/identity.idl +++ b/idl/identity.idl @@ -91,6 +91,14 @@ namespace identity { // |callback| : Called with the URL redirected back to your application. static void launchWebAuthFlow(WebAuthFlowDetails details, LaunchWebAuthFlowCallback callback); + + // Generates a redirect URL to be used in |launchWebAuthFlow|. + // + // The generated URLs match the pattern + // https://<app-id>.chromiumapp.org/*. + // + // |path| : The path appended to the end of the generated URL. + [nocompile] static DOMString getRedirectURL(optional DOMString path); }; interface Events { diff --git a/idl/image_writer_private.idl b/idl/image_writer_private.idl index 2dc3e3d0..8c49b68f 100644 --- a/idl/image_writer_private.idl +++ b/idl/image_writer_private.idl @@ -30,7 +30,8 @@ verifyDownload, unzip, write, - verifyWrite + verifyWrite, + unknown }; // Options for writing an image. @@ -43,7 +44,7 @@ }; dictionary ProgressInfo { - // The $ref:Stage that the write process is currently in. + // The $(ref:Stage) that the write process is currently in. Stage stage; // Current progress within the stage. long percentComplete; @@ -84,28 +85,27 @@ // completes, either successfully or on error. // // |storageUnitId|: The identifier for the storage unit - // |options|: If present the imageUrl of the options will be used to - // download the image. Otherwise the user will be prompted for a local - // image to burn. + // |fileEntry|: The FileEntry object of the image to be burned. // |callback|: The callback which signifies that the write operation has // been started by the system and provides a unique ID for this operation. static void writeFromFile(DOMString storageUnitId, + [instanceOf=FileEntry] object fileEntry, WriteImageCallback callback); // Cancel a current write operation. // // |callback|: The callback which is triggered with the write is - // successfully cancelled, passing the $ref:ProgressInfo of the operation at + // successfully cancelled, passing the $(ref:ProgressInfo) of the operation at // the time it was cancelled. static boolean cancelWrite(WriteCancelCallback callback); // Destroys the partition table of a disk, effectively erasing it. This is // a fairly quick operation and so it does not have complex stages or - // progress information. However, it can fail and call the callback with - // an error. + // progress information, just a write phase. // // |storageUnitId|: The identifier of the storage unit to wipe - // |callback|: A callback which is called when the operation is complete. + // |callback|: A callback that triggers when the operation has been + // successfully started. static void destroyPartitions(DOMString storageUnitId, DestroyPartitionsCallback callback); @@ -119,12 +119,20 @@ // Fires periodically throughout the writing operation and at least once per // stage. static void onWriteProgress(ProgressInfo info); + // Fires when the write operation has completely finished, such as all // devices being finalized and resources released. static void onWriteComplete(); - // Fires when an error occured during writing, passing the $ref:ProgressInfo + + // Fires when an error occured during writing, passing the $(ref:ProgressInfo) // of the operation at the time the error occured. static void onWriteError(ProgressInfo info, DOMString error); + + // Fires when a removable storage device is inserted. + static void onDeviceInserted(RemovableStorageDevice device); + + // Fires when a removable storage device is removed. + static void onDeviceRemoved(RemovableStorageDevice device); }; }; diff --git a/idl/input_ime.json b/idl/input_ime.json index e3349463..e682d40b 100644 --- a/idl/input_ime.json +++ b/idl/input_ime.json @@ -15,6 +15,7 @@ "properties": { "type": {"type": "string", "description": "One of keyup or keydown.", "enum": ["keyup", "keydown"]}, "requestId": {"type": "string", "description": "The ID of the request."}, + "extensionId": {"type": "string", "optional": true, "description": "The extension ID of the sender of this keyevent."}, "key": {"type": "string", "description": "Value of the key being pressed"}, "code": {"type": "string", "description": "Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state."}, "altKey": {"type": "boolean", "optional": true, "description": "Whether or not the ALT key is pressed."}, @@ -29,7 +30,7 @@ "description": "Describes an input Context", "properties": { "contextID": {"type": "integer", "description": "This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called."}, - "type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, Password, etc)", "enum": ["text", "number", "password"]} + "type": {"type": "string", "description": "Type of value this text field edits, (Text, Number, URL, etc)", "enum": ["text", "search", "tel", "url", "email", "number"]} } }, { @@ -184,10 +185,47 @@ } ] }, + { + "name": "sendKeyEvents", + "type": "function", + "description": "Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.", + "parameters": [ + { + "name": "parameters", + "type": "object", + "properties": { + "contextID": { + "description": "ID of the context where the key events will be sent, or zero to send key events to non-input field.", + "type": "integer" + }, + "keyData": { + "type": "array", + "description": "Data on the key event.", + "items": { + "$ref": "KeyboardEvent" + } + } + } + }, + { + "type": "function", + "name": "callback", + "optional": true, + "description": "Called when the operation completes.", + "parameters": [] + } + ] + }, + { + "name": "hideInputView", + "type": "function", + "description": "Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.", + "parameters": [] + }, { "name": "setCandidateWindowProperties", "type": "function", - "description": "Sets the properties of the candidate window. This fails if the extension doesn’t own the active IME", + "description": "Sets the properties of the candidate window. This fails if the extension doesn't own the active IME", "parameters": [ { "name": "parameters", @@ -257,7 +295,7 @@ { "name": "setCandidates", "type": "function", - "description": "Sets the current candidate list. This fails if this extension doesn’t own the active IME", + "description": "Sets the current candidate list. This fails if this extension doesn't own the active IME", "parameters": [ { "name": "parameters", diff --git a/idl/log_private.idl b/idl/log_private.idl index 31a22ec4..454d18fb 100644 --- a/idl/log_private.idl +++ b/idl/log_private.idl @@ -49,6 +49,11 @@ namespace logPrivate { interface Functions { // Get the existing logs from ChromeOS system. static void getHistorical(Filter filter, GetHistoricalCallback callback); + static void startNetInternalsWatch(); + static void stopNetInternalsWatch(); }; + interface Events { + static void onAddNetInternalsEntries(object[] entries); + }; }; diff --git a/idl/management.json b/idl/management.json index b8b58b43..d3940045 100644 --- a/idl/management.json +++ b/idl/management.json @@ -58,7 +58,7 @@ "isApp": { "description": "True if this is an app.", "type": "boolean", - "nodoc": true + "deprecated": "Please use $(ref:management.ExtensionInfo.type)." }, "type": { "description": "The type of this extension, app, or theme.", @@ -146,12 +146,12 @@ { "name": "id", "type": "string", - "description": "The ID from an item of $ref:ExtensionInfo." + "description": "The ID from an item of $(ref:management.ExtensionInfo)." }, { "type": "function", "name": "callback", - "optional": "true", + "optional": true, "parameters": [ { "name": "result", @@ -172,7 +172,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [ { "name": "permissionWarnings", @@ -195,7 +195,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [ { "name": "permissionWarnings", @@ -213,7 +213,7 @@ { "name": "id", "type": "string", - "description": "This should be the id from an item of $ref:ExtensionInfo." + "description": "This should be the id from an item of $(ref:management.ExtensionInfo)." }, { "name": "enabled", @@ -223,7 +223,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -235,12 +235,12 @@ { "name": "id", "type": "string", - "description": "This should be the id from an item of $ref:ExtensionInfo." + "description": "This should be the id from an item of $(ref:management.ExtensionInfo)." }, { "type": "object", "name": "options", - "optional": "true", + "optional": true, "properties": { "showConfirmDialog": { "type": "boolean", @@ -252,7 +252,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -264,7 +264,7 @@ { "type": "object", "name": "options", - "optional": "true", + "optional": true, "properties": { "showConfirmDialog": { "type": "boolean", @@ -276,7 +276,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -293,7 +293,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] diff --git a/idl/manifest_types.json b/idl/manifest_types.json index d4b24ec8..d2e1af6b 100644 --- a/idl/manifest_types.json +++ b/idl/manifest_types.json @@ -17,7 +17,7 @@ "type": "object", // Note: description commented out because externally_connectable.html // already describes it, and the repetition looks odd. - // "description": "The externally_connectable manifest property declares which extensions, apps, and web pages can connect to your extension via $ref:runtime.connect and $ref:runtime.sendMessage.", + // "description": "The externally_connectable manifest property declares which extensions, apps, and web pages can connect to your extension via $(ref:runtime.connect) and $(ref:runtime.sendMessage).", "properties": { "ids": { "description": "

The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect.

The wildcard \"*\" will allow all extensions and apps to connect.

", @@ -26,13 +26,13 @@ "items": {"type": "string"} }, "matches": { - "description": "

The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect.

Patterns cannot include wildcard domains nor subdomains of (effective) top level domains; *://google.com/* and http://*.chromium.org/* are valid, while <all_urls>, http://*/*, *://*.com/*, and even http://*.appspot.com/* are not.

", + "description": "

The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect.

Patterns cannot include wildcard domains nor subdomains of (effective) top level domains; *://google.com/* and http://*.chromium.org/* are valid, while <all_urls>, http://*/*, *://*.com/*, and even http://*.appspot.com/* are not.

", "optional": true, "type": "array", "items": {"type": "string"} }, "accepts_tls_channel_id": { - "description": "If true, messages sent via $ref:runtime.connect or $ref:runtime.sendMessage will set $ref:runtime.MessageSender.tlsChannelId if those methods request it to be. If false, $ref:runtime.MessageSender.tlsChannelId will never be set under any circumstance.", + "description": "If true, messages sent via $(ref:runtime.connect) or $(ref:runtime.sendMessage) will set $(ref:runtime.MessageSender.tlsChannelId) if those methods request it to be. If false, $(ref:runtime.MessageSender.tlsChannelId) will never be set under any circumstance.", "optional": true, "type": "boolean" } @@ -43,6 +43,36 @@ "type": "object", "description": "Chrome settings which can be overriden by an extension.", "properties": { + // TODO(wittman): Remove for M37. + "bookmarks_ui": { + "type": "object", + "description": "Settings to permit bookmarks user interface customization by extensions.", + "optional": true, + "nodoc": true, + "properties": { + "remove_button": { + "type": "boolean", + "description": "If true, the built-in bookmark button will be removed from the user interface.", + "optional": true + }, + "remove_bookmark_shortcut": { + "type": "boolean", + "description": "If true, the built-in \"Bookmark this page...\" shortcut key is removed and the extension is permitted to override the shortcut by binding it in the commands section of the manifest. The corresponding menu item is also removed or overridden as well.", + "optional": true + }, + "remove_bookmark_open_pages_shortcut": { + "type": "boolean", + "nodoc": true, + "description": "[Private] If true, the built-in \"Bookmark open pages...\" shortcut key and corresponding menu item is removed.", + "optional": true + }, + "hide_bookmark_button": { + "type": "boolean", + "description": "Deprecated. Use remove_button instead.", + "optional": true + } + } + }, "homepage": { "description": "New value for the homepage.", "optional": true, @@ -120,13 +150,52 @@ } } }, - "startup_page": { - "description": "A new startup page to be added to the list.", + "startup_pages": { + "description": "URLs to be added to the list of startup pages.", "optional": true, - "type": "string" + "type": "array", + "items": {"type": "string"} } } }, + { + "id": "ChromeUIOverrides", + "type": "object", + "description": "Chrome user interface features which can be overriden by an extension.", + "properties": { + "bookmarks_ui": { + "type": "object", + "description": "Settings to permit bookmarks user interface customization by extensions.", + "optional": true, + "properties": { + "remove_button": { + "type": "boolean", + "description": "If true, the built-in bookmark button will be removed from the user interface.", + "optional": true + }, + "remove_bookmark_shortcut": { + "type": "boolean", + "description": "If true, the built-in \"Bookmark this page...\" shortcut key is removed and the extension is permitted to override the shortcut by binding it in the commands section of the manifest.", + "optional": true + }, + "remove_bookmark_open_pages_shortcut": { + "type": "boolean", + "nodoc": true, + "description": "[Private] If true, the built-in \"Bookmark open pages...\" shortcut key and corresponding menu item is removed.", + "optional": true + } + } + } + } + }, + { + "id": "SocketHostPatterns", + "description": "

A single string or a list of strings representing host:port patterns.

", + "choices": [ + { "type": "string" }, + { "type": "array", "items": { "type": "string" } } + ] + }, { "id": "sockets", "type": "object", @@ -140,17 +209,17 @@ "bind": { "description": "

The host:port pattern for bind operations.

", "optional": true, - "type": "string" + "$ref": "SocketHostPatterns" }, "send": { "description": "

The host:port pattern for send operations.

", "optional": true, - "type": "string" + "$ref": "SocketHostPatterns" }, "multicastMembership": { "description": "

The host:port pattern for joinGroup operations.

", "optional": true, - "type": "string" + "$ref": "SocketHostPatterns" } } }, @@ -162,7 +231,7 @@ "connect": { "description": "

The host:port pattern for connect operations.

", "optional": true, - "type": "string" + "$ref": "SocketHostPatterns" } } }, @@ -174,11 +243,27 @@ "listen": { "description": "

The host:port pattern for listen operations.

", "optional": true, - "type": "string" + "$ref": "SocketHostPatterns" } } } } + }, + { + "id": "bluetooth", + "type": "object", + "description": "The bluetooth manifest property give permission to an app to use the $(ref:bluetooth) API. A list of UUIDs can be optionally specified to enable communication with devices.", + "properties": { + "uuids": { + "description": "The uuids manifest property declares the list of protocols, profiles and services that an app can communicate using.", + "optional": true, + "type": "array", + "items": { + "description": "

The list specified as UUID strings.

", + "type": "string" + } + } + } } ] } diff --git a/idl/media_galleries.idl b/idl/media_galleries.idl index 5295c225..bb3a269f 100644 --- a/idl/media_galleries.idl +++ b/idl/media_galleries.idl @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Use the chrome.mediaGalleries API to access media files (images, -// video, audio) from the user's local disks (with the user's consent). +// Use the chrome.mediaGalleries API to access media files (audio, +// images, video) from the user's local disks (with the user's consent). namespace mediaGalleries { [inline_doc] enum GetMediaFileSystemsInteractivity { @@ -16,6 +16,25 @@ namespace mediaGalleries { if_needed }; + [inline_doc] enum GetMetadataType { + // Retrieve all available metadata. + all, + // Retrieve only the mime type. + mimeTypeOnly + }; + + [inline_doc] enum ScanProgressType { + // The scan started. + start, + // The scan was cancelled. + cancel, + // The scan finished but none of the result have been added, + // addScanResults() has to be called to ask the user for permission. + finish, + // The scan encountered an error and could not proceed. + error + }; + [inline_doc] dictionary MediaFileSystemsDetails { // Whether to prompt the user for permission to additional media galleries // before returning the permitted set. Default is silent. If the value @@ -25,9 +44,19 @@ namespace mediaGalleries { GetMediaFileSystemsInteractivity? interactive; }; + [inline_doc] dictionary MediaMetadataOptions { + // Specifies which subset of the metadata to retrieve. Defaults to 'all' + // if the option is omitted. + GetMetadataType? metadataType; + }; + callback MediaFileSystemsCallback = void ([instanceOf=DOMFileSystem] optional object[] mediaFileSystems); + callback AddUserFolderCallback = + void ([instanceOf=DOMFileSystem] optional object[] mediaFileSystems, + DOMString selectedFileSystemName); + [inline_doc] dictionary MediaFileSystemMetadata { // The name of the file system. DOMString name; @@ -36,7 +65,7 @@ namespace mediaGalleries { DOMString galleryId; // If the media gallery is on a removable device, a unique id for the - // device. + // device while the device is online. DOMString? deviceId; // True if the media gallery is on a removable device. @@ -45,17 +74,103 @@ namespace mediaGalleries { // True if the device the media gallery is on was detected as a media // device. i.e. a PTP or MTP device, or a DCIM directory is present. boolean isMediaDevice; + + // True if the device is currently available. + boolean isAvailable; + }; + + [inline_doc] dictionary ScanProgressDetails { + // The type of progress event, i.e. start, finish, etc. + ScanProgressType type; + + // The number of Galleries found. + long? galleryCount; + + // Appoximate number of media files found; some file types can be either + // audio or video and are included in both counts. + long? audioCount; + long? imageCount; + long? videoCount; + }; + + callback MediaFileSystemsMetadataCallback = + void (MediaFileSystemMetadata[] metadata); + + dictionary MediaMetadata { + // The browser sniffed mime type. + DOMString mimeType; + + // Defined for images and video. In pixels. + long? height; + long? width; + + // Defined for audio and video. In seconds. + double? duration; + + // Defined for images and video. In degrees. + long? rotation; + + // Generic metadata tags. + DOMString? album; + DOMString? artist; + DOMString? comment; + DOMString? copyright; + long? disc; + DOMString? genre; + DOMString? language; + DOMString? title; + long? track; }; + callback MediaMetadataCallback = void (MediaMetadata metadata); + interface Functions { // Get the media galleries configured in this user agent. If none are // configured or available, the callback will receive an empty array. static void getMediaFileSystems(optional MediaFileSystemsDetails details, MediaFileSystemsCallback callback); + // Present a directory picker to the user and add the selected directory + // as a gallery. If the user cancels the picker, selectedFileSystemName + // will be empty. + // A user gesture is required for the dialog to display. Without a user + // gesture, the callback will run as though the user canceled. + static void addUserSelectedFolder(AddUserFolderCallback callback); + + // Start a scan of the user's hard disks for directories containing media. + // The scan may take a long time so progress and completion is communicated + // by events. No permission is granted as a result of the scan, see + // addScanResults. + static void startMediaScan(); + + // Cancel any pending media scan. Well behaved apps should provide a way + // for the user to cancel scans they start. + static void cancelMediaScan(); + + // Show the user the scan results and let them add any or all of them as + // galleries. This should be used after the 'finish' onScanProgress() + // event has happened. All galleries the app has access to are returned, not + // just the newly added galleries. + static void addScanResults(MediaFileSystemsCallback callback); + // Get metadata about a specific media file system. [nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata( [instanceOf=DOMFileSystem] object mediaFileSystem); + + // Get metadata for all available media galleries. + static void getAllMediaFileSystemMetadata( + MediaFileSystemsMetadataCallback callback); + + // Gets the media-specific metadata for a media file. This should work + // for files in media galleries as well as other DOM filesystems. + static void getMetadata([instanceOf=Blob] object mediaFile, + optional MediaMetadataOptions options, + MediaMetadataCallback callback); }; + interface Events { + // The pending media scan has changed state. See details for more + // information. + static void onScanProgress(ScanProgressDetails details); + }; }; diff --git a/idl/media_galleries_private.idl b/idl/media_galleries_private.idl index e04df524..64312a5b 100644 --- a/idl/media_galleries_private.idl +++ b/idl/media_galleries_private.idl @@ -2,25 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This is a private API since M23. This will be superceded by the -// systeminfo.storage API in the future. -// See http://crbug.com/166950 and http://crbug.com/177605. +// This is a private API since M23. Gallery watching needs to be implemented +// on platforms others than Windows and then moved to the public API. +// See http://crbug.com/166950. namespace mediaGalleriesPrivate { - // A dictionary that describes an attached device. - [inline_doc] dictionary DeviceAttachmentDetails { - // The name of the device. - DOMString deviceName; - - // A transient id that unique identifies the device. - DOMString deviceId; - }; - - // A dictionary that describes a detached device. - [inline_doc] dictionary DeviceDetachmentDetails { - // A transient id that unique identifies the device. - DOMString deviceId; - }; - // A dictionary that describes the modified gallery. [inline_doc] dictionary GalleryChangeDetails { // Gallery identifier. @@ -28,12 +13,6 @@ namespace mediaGalleriesPrivate { }; interface Events { - // Fired when a media device gets attached. - static void onDeviceAttached(DeviceAttachmentDetails details); - - // Fired when a media device gets detached. - static void onDeviceDetached(DeviceDetachmentDetails details); - // Fired when a media gallery is changed. static void onGalleryChanged(GalleryChangeDetails details); }; diff --git a/idl/metrics_private.json b/idl/metrics_private.json index 06e52740..28edefe1 100644 --- a/idl/metrics_private.json +++ b/idl/metrics_private.json @@ -33,7 +33,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "is_enabled", "type": "boolean" } ] @@ -49,7 +49,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "group", "type": "string" } ] @@ -65,7 +65,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "params", @@ -147,6 +147,15 @@ {"name": "value", "type": "integer"} ] }, + { + "name": "recordSparseValue", + "type": "function", + "description": "Increments the count associated with |value| in the sparse histogram defined by the |metricName|.", + "parameters": [ + {"name": "metricName", "type": "string"}, + {"name": "value", "type": "integer"} + ] + }, { "name": "recordValue", "type": "function", diff --git a/idl/networking_private.json b/idl/networking_private.json index 750860f9..5ef6d7bd 100644 --- a/idl/networking_private.json +++ b/idl/networking_private.json @@ -9,6 +9,7 @@ "compiler_options": { "implemented_in": "chrome/browser/extensions/api/networking_private/networking_private_api.h" }, + "platforms": ["chromeos", "win", "mac"], "types" : [ { "id": "NetworkProperties", @@ -352,6 +353,55 @@ "description": "A callback function that receives base64-encoded encrypted data to send to a trusted device." } ] + }, + { + "name": "setWifiTDLSEnabledState", + "description": "Enables TDLS for wifi traffic with a specified peer if available.", + "parameters": [ + { + "name": "ip_or_mac_address", + "type": "string", + "description": "The IP or MAC address of the peer with which to enable a TDLS connection." + }, + { + "name": "enabled", + "type": "boolean", + "description": "If true, enable TDLS, otherwise disable TDLS." + }, + { + "name": "callback", + "type": "function", + "parameters": [ + { + "name": "status", + "type": "string" + } + ], + "description": "A callback function that receives a string with an error or the current TDLS status. 'Failed' indicates that the request failed (e.g. MAC address lookup failed). 'Timeout' indicates that the lookup timed out. Otherwise a valid status is returned (see getWifiTDLSStatus)." + } + ] + }, + { + "name": "getWifiTDLSStatus", + "description": "Returns the current TDLS status for the specified peer.", + "parameters": [ + { + "name": "ip_or_mac_address", + "type": "string", + "description": "The IP or MAC address of the peer." + }, + { + "name": "callback", + "type": "function", + "parameters": [ + { + "name": "status", + "type": "string" + } + ], + "description": "A callback function that receives a string with the current TDLS status which can be 'Connected', 'Disabled', 'Disconnected', 'Nonexistent', or 'Unknown'" + } + ] } ], "events": [ diff --git a/idl/notifications.idl b/idl/notifications.idl index f916f015..da95e62c 100644 --- a/idl/notifications.idl +++ b/idl/notifications.idl @@ -50,20 +50,20 @@ namespace notifications { dictionary NotificationOptions { // Which type of notification to display. - // Required for $ref:notifications.create method. + // Required for $(ref:notifications.create) method. TemplateType? type; // Sender's avatar, app icon, or a thumbnail for image notifications. - // Required for $ref:notifications.create method. + // Required for $(ref:notifications.create) method. DOMString? iconUrl; [nodoc] NotificationBitmap? iconBitmap; // Title of the notification (e.g. sender name for email). - // Required for $ref:notifications.create method. + // Required for $(ref:notifications.create) method. DOMString? title; // Main notification content. - // Required for $ref:notifications.create method. + // Required for $(ref:notifications.create) method. DOMString? message; // Alternate notification content with a lower-weight font. @@ -123,7 +123,7 @@ namespace notifications { // Updates an existing notification. // |notificationId|: The id of the notification to be updated. This is - // returned by $ref:notifications.create method. + // returned by $(ref:notifications.create) method. // |options|: Contents of the notification to update to. // |callback|: Called to indicate whether a matching notification existed. static void update(DOMString notificationId, @@ -132,7 +132,7 @@ namespace notifications { // Clears the specified notification. // |notificationId|: The id of the notification to be cleared. This is - // returned by $ref:notifications.create method. + // returned by $(ref:notifications.create) method. // |callback|: Called to indicate whether a matching notification existed. static void clear(DOMString notificationId, ClearCallback callback); @@ -158,6 +158,9 @@ namespace notifications { // The user changes the permission level. static void onPermissionLevelChanged(PermissionLevel level); + + // The user clicked on a link for the app's notification settings. + static void onShowSettings(); }; }; diff --git a/idl/page_capture.json b/idl/page_capture.json index f796d693..e0fd86b7 100644 --- a/idl/page_capture.json +++ b/idl/page_capture.json @@ -31,7 +31,7 @@ { "name": "mhtmlData", "type": "binary", - "optional": "true", + "optional": true, "description": "The MHTML data as a Blob." } ] diff --git a/idl/permissions.json b/idl/permissions.json index 3ce74b43..a5047460 100644 --- a/idl/permissions.json +++ b/idl/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", @@ -15,13 +15,13 @@ "type": "array", "items": {"type": "string"}, "optional": true, - "description": "List of named permissions (does not include hosts or origins)." + "description": "List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest." }, "origins": { "type": "array", "items": {"type": "string"}, "optional": true, - "description": "List of origin permissions." + "description": "List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://*/ appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored." } } } @@ -96,7 +96,7 @@ { "name": "request", "type": "function", - "description": "Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, $ref:runtime.lastError will be set.", + "description": "Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, $(ref:runtime.lastError) will be set.", "parameters": [ { "name": "permissions", @@ -119,7 +119,7 @@ { "name": "remove", "type": "function", - "description": "Removes access to the specified permissions. If there are any problems removing the permissions, $ref:runtime.lastError will be set.", + "description": "Removes access to the specified permissions. If there are any problems removing the permissions, $(ref:runtime.lastError) will be set.", "parameters": [ { "name": "permissions", diff --git a/idl/preferences_private.json b/idl/preferences_private.json index 4ceeb5fa..3660bee6 100644 --- a/idl/preferences_private.json +++ b/idl/preferences_private.json @@ -8,10 +8,31 @@ "description": "none", "properties": { "googleGeolocationAccessEnabled": { + "nocompile": true, "$ref": "types.private.ChromeDirectSetting", "value": ["googlegeolocationaccess.enabled", {"type":"boolean"}], "description": "If enabled, Google services can access the user's location. This preference's value is a boolean, defaulting to false." } - } + }, + "functions": [ + { + "name": "getSyncCategoriesWithoutPassphrase", + "description": "Returns a list of sync categories the user has enabled without using a custom passphrase for encryption. The possible values are those that can be returned from syncer::ModelTypeToString in sync/syncable/model_type.cc.", + "type": "function", + "parameters": [ + { + "name": "callback", + "type": "function", + "parameters": [ + { + "name": "categories", + "type": "array", + "items": {"type": "string"} + } + ] + } + ] + } + ] } ] diff --git a/idl/processes.json b/idl/processes.json index 77b1ad77..9ff9dff6 100644 --- a/idl/processes.json +++ b/idl/processes.json @@ -20,6 +20,10 @@ "type": "integer", "description": "The ID of the process, as provided by the OS." }, + "title": { + "type": "string", + "description": "The title of the process as seen in the task manager." + }, "type": { "type": "string", "enum": ["browser", "renderer", "extension", "notification", "plugin", "worker", "nacl", "utility", "gpu", "other"], @@ -29,6 +33,10 @@ "type": "string", "description": "The profile which the process is associated with." }, + "naclDebugPort": { + "type": "integer", + "description": "The debugging port for Native Client processes. Zero for other process types and for NaCl processes that do not have debugging enabled." + }, "tabs": { "type": "array", "items": {"type": "integer", "minimum": 0}, "description": "Array of Tab IDs that have a page rendered by this process. The list will be non-empty for renderer processes only." diff --git a/idl/proxy.json b/idl/proxy.json index 2d28bb63..24a5a7ef 100644 --- a/idl/proxy.json +++ b/idl/proxy.json @@ -12,7 +12,7 @@ "type": "object", "description": "An object encapsulating a single proxy server's specification.", "properties": { - "scheme": {"type": "string", "optional": true, "enum": ["http", "https", "socks4", "socks5"], "description": "The scheme (protocol) of the proxy server itself. Defaults to 'http'."}, + "scheme": {"type": "string", "optional": true, "enum": ["http", "https", "quic", "socks4", "socks5"], "description": "The scheme (protocol) of the proxy server itself. Defaults to 'http'."}, "host": {"type": "string", "description": "The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet."}, "port": {"type": "integer", "optional": true, "description": "The port of the proxy server. Defaults to a port that depends on the scheme."} } diff --git a/idl/reading_list_private.json b/idl/reading_list_private.json new file mode 100644 index 00000000..7e1979d0 --- /dev/null +++ b/idl/reading_list_private.json @@ -0,0 +1,96 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[ + { + "namespace": "readingListPrivate", + "description": "none", + "types": [ + { + "id": "Entry", + "type": "object", + "description": "An article entry from the reading list. May contain one or more pages.", + "properties": { + "id": { + "description": "A unique id for referring to the entry.", + "type": "string" + } + } + } + ], + "functions": [ + { + "name": "addEntry", + "type": "function", + "description": "Adds an entry to the reading list. The callback is invoked only once article distillation is complete.", + "parameters": [ + { + "type": "object", + "name": "entry", + "properties": { + "url": { + "description": "The url of the entry.", + "type": "string" + } + } + }, + { + "type": "function", + "name": "callback", + "optional": true, + "parameters": [ + { + "name": "result", + "$ref": "Entry", + "description": "The entry that was added." + } + ] + } + ] + }, + { + "name": "removeEntry", + "type": "function", + "description": "Removes an entry with the given entry id.", + "parameters": [ + { + "name": "id", + "type": "string", + "description": "A string containing an entry id." + }, + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "result", + "$ref": "Entry", + "optional": true, + "description": "The entry that was removed or null if removal failed." + } + ] + } + ] + }, + { + "name": "getEntries", + "type": "function", + "description": "Gets all the entries currently stored in the reading list.", + "parameters": [ + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "result", + "type": "array", + "items": {"$ref": "Entry"} + } + ] + } + ] + } + ] + } +] diff --git a/idl/runtime.json b/idl/runtime.json index 82ff4799..55704f1e 100644 --- a/idl/runtime.json +++ b/idl/runtime.json @@ -31,7 +31,7 @@ "type": "object", "description": "An object containing information about the script context that sent a message or request.", "properties": { - "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $ref:tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app."}, + "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab) which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app."}, "id": {"type": "string", "optional": true, "description": "The ID of the extension or app that opened the connection, if any."}, "url": {"type": "string", "optional": true, "description": "The URL of the page or frame that opened the connection, if any. This property will only be present when the connection was opened from a tab or content script."}, "tlsChannelId": {"type": "string", "optional": true, "description": "The TLS channel ID of the web page that opened the connection, if requested by the extension or app, and if available."} @@ -111,9 +111,8 @@ } }, { - "name": "setUninstallUrl", + "name": "setUninstallURL", "type": "function", - "unpriviledged": true, "description": "Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.", "parameters": [ { @@ -127,7 +126,6 @@ "name": "reload", "description": "Reloads the app or extension.", "type": "function", - "nocompile": true, "parameters": [] }, { @@ -165,16 +163,15 @@ "name": "restart", "description": "Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op.", "type": "function", - "nocompile": true, "parameters": [] }, { "name": "connect", "type": "function", "nocompile": true, - "description": "Attempts to connect to other listeners within the extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes. 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 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/app you want to connect to. If omitted, default is your own extension."}, + {"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", @@ -187,7 +184,7 @@ ], "returns": { "$ref": "Port", - "description": "Port through which messages can be sent and received. The port's $ref:[runtime.Port onDisconnect] event is fired if the extension/app does not exist. " + "description": "Port through which messages can be sent and received. The port's $(ref:runtime.Port onDisconnect) event is fired if the extension/app does not exist. " } }, { @@ -212,9 +209,9 @@ "type": "function", "nocompile": true, "allowAmbiguousOptionalArguments": true, - "description": "Sends a single message to onMessage event listeners within the extension (or another extension/app). Similar to chrome.runtime.connect, but only sends a single message with an optional response. The $ref:runtime.onMessage event is fired in each extension page of the extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $ref:tabs.sendMessage.", + "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 each page, 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 extension ID of the extension you want to connect to. If omitted, default is your own extension."}, + {"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" }, { "type": "object", @@ -232,7 +229,7 @@ { "name": "response", "type": "any", - "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message." + "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." } ] } @@ -265,7 +262,7 @@ { "name": "response", "type": "any", - "description": "The response message send by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message.", + "description": "The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message.", "additionalProperties": { "type": "any" } @@ -393,7 +390,7 @@ "name": "onBrowserUpdateAvailable", "type": "function", "description": "Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required.", - "nodoc": true, + "deprecated": "Please use $(ref:runtime.onRestartRequired).", "parameters": [] }, { @@ -434,7 +431,7 @@ ], "returns": { "type": "boolean", - "optional": "true", + "optional": true, "description": "Return true from the event listener if you wish to call sendResponse after the event listener returns." } }, @@ -452,7 +449,7 @@ ], "returns": { "type": "boolean", - "optional": "true", + "optional": true, "description": "Return true from the event listener if you wish to call sendResponse after the event listener returns." } }, diff --git a/idl/serial.idl b/idl/serial.idl index fff23bc2..2f4979a2 100644 --- a/idl/serial.idl +++ b/idl/serial.idl @@ -11,6 +11,17 @@ namespace serial { // argument to chrome.serial.connect in order to connect to // this device. DOMString path; + + // A PCI or USB vendor ID if one can be determined for the underlying + // device. + long? vendorId; + + // A USB product ID if one can be determined for the underlying device. + long? productId; + + // A human-readable display name for the underlying device if one can be + // queried from the host driver. + DOMString? displayName; }; callback GetDevicesCallback = void (DeviceInfo[] ports); diff --git a/idl/sessions.json b/idl/sessions.json index 48c09e90..a063d920 100644 --- a/idl/sessions.json +++ b/idl/sessions.json @@ -16,7 +16,7 @@ "minimum": 0, "maximum": 25, "optional": true, - "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($ref:MAX_SESSION_RESULTS)." + "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($(ref:sessions.MAX_SESSION_RESULTS))." } } }, @@ -25,8 +25,8 @@ "type": "object", "properties": { "lastModified": {"type": "integer", "description": "The time when the window or tab was closed or modified, represented in milliseconds since the epoch."}, - "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $ref:tabs.Tab, if this entry describes a tab. Either this or $ref:Session.window will be set."}, - "window": {"$ref": "windows.Window", "optional": true, "description": "The $ref:windows.Window, if this entry describes a window. Either this or $ref:Session.tab will be set."} + "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set."}, + "window": {"$ref": "windows.Window", "optional": true, "description": "The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set."} } }, { @@ -75,7 +75,7 @@ "name": "callback", "parameters": [ { - "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $ref:Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. $ref:tabs.Tab objects are sorted by recency in the $ref:windows.Window of the $ref:Session objects." + "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $(ref:sessions.Device) objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. $(ref:tabs.Tab) objects are sorted by recency in the $(ref:windows.Window) of the $(ref:sessions.Session) objects." } ] } @@ -84,13 +84,13 @@ { "name": "restore", "type": "function", - "description": "Reopens a $ref:windows.Window or $ref:tabs.Tab, with an optional callback to run when the entry has been restored.", + "description": "Reopens a $(ref:windows.Window) or $(ref:tabs.Tab), with an optional callback to run when the entry has been restored.", "parameters": [ { "type": "string", "name": "sessionId", "optional": true, - "description": "The $ref:windows.Window.sessionId, or $ref:tabs.Tab.sessionId to restore." + "description": "The $(ref:windows.Window.sessionId), or $(ref:tabs.Tab.sessionId) to restore." }, { "type": "function", @@ -100,7 +100,7 @@ { "$ref": "Session", "name": "restoredSession", - "description": "A $ref:Session containing the restored $ref:windows.Window or $ref:tabs.Tab object." + "description": "A $(ref:sessions.Session) containing the restored $(ref:windows.Window) or $(ref:tabs.Tab) object." } ] } @@ -110,7 +110,7 @@ "properties": { "MAX_SESSION_RESULTS": { "value": 25, - "description": "The maximum number of $ref:Session that will be included in a requested list." + "description": "The maximum number of $(ref:sessions.Session) that will be included in a requested list." } } } diff --git a/idl/streams_private.idl b/idl/streams_private.idl new file mode 100644 index 00000000..2d3badaa --- /dev/null +++ b/idl/streams_private.idl @@ -0,0 +1,39 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Streams Private API. +namespace streamsPrivate { + dictionary StreamInfo { + // The MIME type of the intercepted URL request. + DOMString mimeType; + + // 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; + + // The amount of data the Stream should contain, if known. If there is no + // information on the size it will be -1. + long expectedContentSize; + + // The HTTP response headers of the intercepted request stored as a + // dictionary mapping header name to header value. If a header name appears + // multiple times, the header values are merged in the dictionary and + // separated by a ", ". + object responseHeaders; + }; + + interface Events { + // Fired when a resource is fetched which matches a mime type handled by + // this extension. The resource request is cancelled, and the extension is + // expected to handle the request. The event is restricted to a small number + // of white-listed extensions. + static void onExecuteMimeTypeHandler(StreamInfo streamInfo); + }; +}; diff --git a/idl/streams_private.json b/idl/streams_private.json deleted file mode 100644 index f2483456..00000000 --- a/idl/streams_private.json +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace":"streamsPrivate", - "description": "none", - "events": [ - { - "name": "onExecuteMimeTypeHandler", - "type": "function", - "description": "Fired when a resource is fetched which matches a mime type handled by this extension. The resource request is cancelled, and the extension is expected to handle the request. The event is restricted to a small number of white-listed extensions.", - "parameters": [ - { - "name": "mimeType", - "type": "string", - "description": "The MIME type of the intercepted URL request." - }, - { - "name": "originalUrl", - "type": "string", - "description": "The original URL that was intercepted." - }, - { - "name": "streamUrl", - "type": "string", - "description": "The URL that the stream can be read from." - }, - { - "name": "tabId", - "type": "integer", - "description": "The ID of the tab that opened the stream. If the stream is not opened in a tab, it will be -1." - }, - { - "name": "expectedContentSize", - "type": "integer", - "description": "The amount of data the Stream should contain, if known. If there is no information on the size it will be -1." - } - ] - } - ], - - "functions": [ - ] - } -] - diff --git a/idl/sync_file_system.idl b/idl/sync_file_system.idl index 9a025875..c1e2eebe 100644 --- a/idl/sync_file_system.idl +++ b/idl/sync_file_system.idl @@ -66,18 +66,18 @@ namespace syncFileSystem { // but file will no longer exist. [instanceOf=Entry] object fileEntry; - // Resulting file status after $ref:onFileStatusChanged event. + // Resulting file status after $(ref:onFileStatusChanged) event. // The status value can be 'synced', // 'pending' or 'conflicting'. FileStatus status; - // Sync action taken to fire $ref:onFileStatusChanged event. + // Sync action taken to fire $(ref:onFileStatusChanged) event. // The action value can be // 'added', 'updated' or 'deleted'. // Only applies if status is 'synced'. SyncAction? action; - // Sync direction for the $ref:onFileStatusChanged event. + // Sync direction for the $(ref:onFileStatusChanged) event. // Sync direction value can be // 'local_to_remote' or 'remote_to_local'. // Only applies if status is 'synced'. @@ -137,7 +137,13 @@ namespace syncFileSystem { // Returns a syncable filesystem backed by Google Drive. // The returned DOMFileSystem instance can be operated on // in the same way as the Temporary and Persistant file systems (see - // http://www.w3.org/TR/file-system-api/). + // http://www.w3.org/TR/file-system-api/), + // except that the filesystem object returned for Sync FileSystem does + // NOT support directory operations (yet). You can get a list + // of file entries by reading the root directory (by + // creating a new DirectoryReader), + // but cannot create a new directory in it. + // // Calling this multiple times from // the same app will return the same handle to the same file system. static void requestFileSystem(GetFileSystemCallback callback); @@ -163,7 +169,7 @@ namespace syncFileSystem { static void getUsageAndQuota([instanceOf=DOMFileSystem] object fileSystem, QuotaAndUsageCallback callback); - // Returns the $ref:FileStatus for the given fileEntry. + // Returns the $(ref:FileStatus) for the given fileEntry. // The status value can be 'synced', // 'pending' or 'conflicting'. // Note that 'conflicting' state only happens when @@ -171,7 +177,7 @@ namespace syncFileSystem { static void getFileStatus([instanceOf=Entry] object fileEntry, GetFileStatusCallback callback); - // Returns each $ref:FileStatus for the given fileEntry array. + // Returns each $(ref:FileStatus) for the given fileEntry array. // Typically called with the result from dirReader.readEntries(). static void getFileStatuses(object[] fileEntries, GetFileStatusesCallback callback); diff --git a/idl/system_cpu.idl b/idl/system_cpu.idl index 0516679d..bb3ac857 100644 --- a/idl/system_cpu.idl +++ b/idl/system_cpu.idl @@ -5,13 +5,45 @@ // Use the system.cpu API to query CPU metadata. namespace system.cpu { + // Counters for assessing CPU utilization. Each field is monotonically + // increasing while the processor is powered on. Values are in milliseconds. + dictionary CpuTime { + // The cumulative time used by userspace programs on this processor. + double user; + + // The cumulative time used by kernel programs on this processor. + double kernel; + + // The cumulative time spent idle by this processor. + double idle; + + // The total cumulative time for this processor. This value is equal to + // user + kernel + idle. + double total; + }; + + dictionary ProcessorInfo { + // Cumulative usage info for this logical processor. + CpuTime usage; + }; + dictionary CpuInfo { // The number of logical processors. long numOfProcessors; + // The architecture name of the processors. DOMString archName; + // The model name of the processors. DOMString modelName; + + // A set of feature codes indicating some of the processor's capabilities. + // The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", + // "sse4_1", "sse4_2", and "avx". + DOMString[] features; + + // Information about each logical processor. + ProcessorInfo[] processors; }; callback CpuInfoCallback = void (CpuInfo info); diff --git a/idl/system_display.idl b/idl/system_display.idl index 2a34d9e8..b971f3ee 100644 --- a/idl/system_display.idl +++ b/idl/system_display.idl @@ -108,7 +108,7 @@ namespace system.display { // together with boundsOriginY, if boundsOriginY // is set. Note that, when updating the display origin, some constraints // will be applied, so the final bounds origin may be different than the one - // set. The final bounds can be retrieved using $ref:getInfo. + // set. The final bounds can be retrieved using $(ref:getInfo). // The bounds origin is applied after rotation. // The bounds origin cannot be changed on the primary display. Note that is // also invalid to set bounds origin values if isPrimary is @@ -128,14 +128,14 @@ namespace system.display { static void getInfo(DisplayInfoCallback callback); // Updates the properties for the display specified by |id|, according to - // the information provided in |info|. On failure, $ref:runtime.lastError + // the information provided in |info|. On failure, $(ref:runtime.lastError) // will be set. // |id|: The display's unique identifier. // |info|: The information about display properties that should be changed. // A property will be changed only if a new value for it is specified in // |info|. // |callback|: Empty function called when the function finishes. To find out - // whether the function succeeded, $ref:runtime.lastError should be + // whether the function succeeded, $(ref:runtime.lastError) should be // queried. static void setDisplayProperties( DOMString id, diff --git a/idl/system_private.json b/idl/system_private.json index 7d954501..ea9ae38f 100644 --- a/idl/system_private.json +++ b/idl/system_private.json @@ -86,6 +86,24 @@ ] } ] + }, + { + "name": "getApiKey", + "type": "function", + "description": "Gets Chrome's API key to use for requests to Google services.", + "parameters": [ + { + "type": "function", + "name": "callback", + "parameters": [ + { + "name": "key", + "type": "string", + "description": "The API key." + } + ] + } + ] } ], "events": [ diff --git a/idl/tabs.json b/idl/tabs.json index 4b4077d6..3bd8a571 100644 --- a/idl/tabs.json +++ b/idl/tabs.json @@ -11,12 +11,12 @@ "id": "Tab", "type": "object", "properties": { - "id": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $ref:sessions API, in which case a session ID may be present."}, + "id": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present."}, // TODO(kalman): Investigate how this is ending up as -1 (based on window type? a bug?) and whether it should be optional instead. "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."}, "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window the tab is contained within."}, "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.", "nodoc": true}, + "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."}, "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."}, @@ -27,7 +27,7 @@ "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."}, "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."}, "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."}, - "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Tab obtained from the $ref:sessions API."} + "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API."} } }, { @@ -89,7 +89,7 @@ "name": "connect", "nocompile": true, "type": "function", - "description": "Connects to the content script(s) in the specified tab. The $ref:runtime.onConnect event is fired in each content script running in the specified tab for the current extension. For more details, see Content Script Messaging.", + "description": "Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) event is fired in each content script running in the specified tab for the current extension. For more details, see Content Script Messaging.", "parameters": [ { "type": "integer", @@ -107,15 +107,15 @@ ], "returns": { "$ref": "runtime.Port", - "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $ref:runtime.Port event is fired if the tab closes or does not exist. " + "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. " } }, { "name": "sendRequest", - "nodoc": true, + "deprecated": "Please use $(ref:runtime.sendMessage).", "nocompile": true, "type": "function", - "description": "Deprecated: Please use sendMessage.", + "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:extension.onRequest) event is fired in each content script running in the specified tab for the current extension.", "parameters": [ { "type": "integer", @@ -134,7 +134,7 @@ { "name": "response", "type": "any", - "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message." + "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." } ] } @@ -144,7 +144,7 @@ "name": "sendMessage", "nocompile": true, "type": "function", - "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $ref:runtime.onMessage event is fired in each content script running in the specified tab for the current extension.", + "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the current extension.", "parameters": [ { "type": "integer", @@ -163,7 +163,7 @@ { "name": "response", "type": "any", - "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $ref:runtime.lastError will be set to the error message." + "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." } ] } @@ -171,9 +171,9 @@ }, { "name": "getSelected", - "nodoc": true, + "deprecated": "Please use $(ref:tabs.query) {active: true}.", "type": "function", - "description": "Deprecated. Please use query({'active': true}). Gets the tab that is selected in the specified window.", + "description": "Gets the tab that is selected in the specified window.", "parameters": [ { "type": "integer", @@ -194,8 +194,8 @@ { "name": "getAllInWindow", "type": "function", - "nodoc": true, - "description": "Deprecated. Please use query({'windowId': windowId}). Gets details about all tabs in the specified window.", + "deprecated": "Please use $(ref:tabs.query) {windowId: windowId}.", + "description": "Gets details about all tabs in the specified window.", "parameters": [ { "type": "integer", @@ -242,10 +242,10 @@ "active": { "type": "boolean", "optional": true, - "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $ref:windows.update). Defaults to true." + "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to true." }, "selected": { - "nodoc": true, + "deprecated": "Please use active.", "type": "boolean", "optional": true, "description": "Whether the tab should become the selected tab in the window. Defaults to true" @@ -296,7 +296,7 @@ { "name": "tab", "optional": true, - "description": "Details about the duplicated tab. The $ref:tabs.Tab object doesn't contain url, title and favIconUrl if the \"tabs\" permission has not been requested.", + "description": "Details about the duplicated tab. The $(ref:tabs.Tab) object doesn't contain url, title and favIconUrl if the \"tabs\" permission has not been requested.", "$ref": "Tab" } ] @@ -357,7 +357,7 @@ "type": "integer", "optional": true, "minimum": -2, - "description": "The ID of the parent window, or $ref:windows.WINDOW_ID_CURRENT for the current window." + "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the current window." }, "windowType": { "type": "string", @@ -449,7 +449,7 @@ "active": { "type": "boolean", "optional": true, - "description": "Whether the tab should be active. Does not affect whether the window is focused (see $ref:windows.update)." + "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))." }, "highlighted": { "type": "boolean", @@ -457,7 +457,7 @@ "description": "Adds or removes the tab from the current selection." }, "selected": { - "nodoc": true, + "deprecated": "Please use highlighted.", "type": "boolean", "optional": true, "description": "Whether the tab should be selected." @@ -484,7 +484,7 @@ "name": "tab", "$ref": "Tab", "optional": true, - "description": "Details about the updated tab. The $ref:tabs.Tab object doesn't contain url, title and favIconUrl if the \"tabs\" permission has not been requested." + "description": "Details about the updated tab. The $(ref:tabs.Tab) object doesn't contain url, title and favIconUrl if the \"tabs\" permission has not been requested." } ] } @@ -612,25 +612,9 @@ "description": "The target window. Defaults to the current window." }, { - "type": "object", + "$ref": "types.ImageDetails", "name": "options", - "optional": true, - "description": "Set parameters of image capture, such as the format of the resulting image.", - "properties": { - "format": { - "type": "string", - "optional": true, - "enum": ["jpeg", "png"], - "description": "The format of the resulting image. Default is jpeg." - }, - "quality": { - "type": "integer", - "optional": true, - "minimum": 0, - "maximum": 100, - "description": "When format is 'jpeg', controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease." - } - } + "optional": true }, { "type": "function", "name": "callback", "parameters": [ @@ -744,7 +728,7 @@ { "name": "onMoved", "type": "function", - "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $ref:onDetached.", + "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $(ref:tabs.onDetached).", "parameters": [ {"type": "integer", "name": "tabId", "minimum": 0}, { @@ -760,9 +744,9 @@ }, { "name": "onSelectionChanged", - "nodoc": true, + "deprecated": "Please use $(ref:tabs.onActivated).", "type": "function", - "description": "Deprecated. Please use onActivated.", + "description": "Fires when the selected tab in a window changes.", "parameters": [ { "type": "integer", @@ -785,9 +769,9 @@ }, { "name": "onActiveChanged", - "nodoc": true, + "deprecated": "Please use $(ref:tabs.onActivated).", "type": "function", - "description": "Deprecated. Please use onActivated.", + "description": "Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to $(ref:tabs.onUpdated) events to be notified when a URL is set.", "parameters": [ { "type": "integer", @@ -833,9 +817,9 @@ }, { "name": "onHighlightChanged", + "deprecated": "Please use $(ref:tabs.onHighlighted).", "type": "function", - "nodoc": true, - "description": "Deprecated. Please use onHighlighted.", + "description": "Fired when the highlighted or selected tabs in a window changes.", "parameters": [ { "type": "object", diff --git a/idl/test.json b/idl/test.json index 285c4970..61ae9864 100644 --- a/idl/test.json +++ b/idl/test.json @@ -23,6 +23,19 @@ "optional": true, "description": "Additional string argument to pass to test." }, + "ftpServer": { + "type": "object", + "optional": true, + "description": "Details on the FTP server used to mock network responses. Will be set only if test calls ExtensionApiTest::StartFTPServer().", + "properties": { + "port": { + "type": "integer", + "description": "The port on which the FTP server is listening.", + "minimum": 1024, + "maximum": 65535 + } + } + }, "testServer": { "type": "object", "optional": true, @@ -353,6 +366,21 @@ "parameters": [] } ] + }, + { + "name": "waitForRoundTrip", + "type": "function", + "description": "Sends a string message one round trip from the renderer to the browser process and back.", + "parameters": [ + {"type": "string", "name": "message"}, + { + "type": "function", + "name": "callback", + "parameters": [ + {"type": "string", "name": "message"} + ] + } + ] } ], "events": [ diff --git a/idl/tts.json b/idl/tts.json index ae8771e7..8449be6f 100644 --- a/idl/tts.json +++ b/idl/tts.json @@ -62,6 +62,11 @@ "description": "This voice's gender.", "enum": ["male", "female"] }, + "remote": { + "type": "boolean", + "optional": true, + "description": "If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs." + }, "extensionId": { "type": "string", "optional": true, @@ -226,7 +231,7 @@ "type": "array", "name": "voices", "items": { "$ref": "TtsVoice" }, - "description": "Array of $ref:TtsVoice objects representing the available voices for speech synthesis." + "description": "Array of $(ref:tts.TtsVoice) objects representing the available voices for speech synthesis." } ] } diff --git a/idl/types.json b/idl/types.json index a2d13552..82442562 100644 --- a/idl/types.json +++ b/idl/types.json @@ -12,11 +12,12 @@ "type": "object", "js_module": "ChromeSetting", "customBindings": "ChromeSetting", - "description": "An interface that allows access to a Chrome browser setting. See $ref:proxy.settings for an example.", + "description": "An interface that allows access to a Chrome browser setting. See $(ref:proxy.settings) for an example.", "functions": [ { "name": "get", "type": "function", + "nocompile": true, "description": "Gets the value of a setting.", "parameters": [ { @@ -63,6 +64,7 @@ { "name": "set", "type": "function", + "nocompile": true, "description": "Sets the value of a setting.", "parameters": [ { @@ -94,6 +96,7 @@ { "name": "clear", "type": "function", + "nocompile": true, "description": "Clears the setting, restoring any default value.", "parameters": [ { @@ -147,6 +150,26 @@ ] } ] + }, + { + "id": "ImageDetails", + "type": "object", + "description": "Details about the format and quality of an image.", + "properties": { + "format": { + "type": "string", + "optional": true, + "enum": ["jpeg", "png"], + "description": "The format of the resulting image. Default is \"jpeg\"." + }, + "quality": { + "type": "integer", + "optional": true, + "minimum": 0, + "maximum": 100, + "description": "When format is \"jpeg\", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease." + } + } } ] } diff --git a/idl/virtual_keyboard_private.json b/idl/virtual_keyboard_private.json index d58bb331..1f6c3a15 100644 --- a/idl/virtual_keyboard_private.json +++ b/idl/virtual_keyboard_private.json @@ -18,6 +18,7 @@ "type": {"type": "string", "description": "One of keyup or keydown.", "enum": ["keyup", "keydown"]}, "charValue": {"type": "integer", "description": "Unicode value of the key."}, "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."}, + "keyName": {"type": "string", "description": "Name of the key, which is independent of modifier state."}, "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."} } } @@ -91,6 +92,17 @@ } ] }, + { + "name": "lockKeyboard", + "type": "function", + "description": "Sets the lock state of the virtual keyboard. A locked keyboard remains visible even after a text area loses input focus.", + "parameters": [ + { + "type": "boolean", + "name": "lock" + } + ] + }, { "name": "keyboardLoaded", "type": "function", @@ -103,6 +115,36 @@ "parameters": [] } ] + }, + { + "name": "getKeyboardConfig", + "type": "function", + "description": "Gets the virtual keyboard configuration.", + "parameters": [ + { + "type": "function", + "name": "callback", + "optional": true, + "description": "Called when querying virtual keyboard configuration is complete.", + "parameters": [ + { + "type": "object", + "name": "config", + "properties": { + "layout": { + "type": "string", + "minLength": 1, + "description": "Virtual keyboard layout string." + }, + "a11ymode": { + "type": "boolean", + "description": "True if accessbility virtual keyboard is enabled." + } + } + } + ] + } + ] } ], "events": [ diff --git a/idl/wallpaper.json b/idl/wallpaper.json index 59f7cb5b..a810b853 100644 --- a/idl/wallpaper.json +++ b/idl/wallpaper.json @@ -9,13 +9,12 @@ "implemented_in": "chrome/browser/chromeos/extensions/wallpaper_api.h" }, "platforms": ["chromeos"], - "description": "none", + "description": "Use the chrome.wallpaper API to change the ChromeOS wallpaper.", "functions": [ { "name": "setWallpaper", "type": "function", - "description": "Sets wallpaper to the image from url with specified layout", - "nodoc": "true", + "description": "Sets wallpaper to the image at url or wallpaperData with the specified layout", "parameters": [ { "name": "details", @@ -29,7 +28,7 @@ "url": { "type": "string", "optional": true, - "description": "The url of online wallpaper." + "description": "The URL of the wallpaper to be set." }, "layout": { "type": "string", @@ -38,7 +37,7 @@ }, "name": { "type": "string", - "description": "The file name of saved wallpaper." + "description": "The file name of the saved wallpaper." }, "thumbnail": { "type": "boolean", @@ -54,7 +53,8 @@ { "type": "binary", "optional": true, - "name": "thumbnail" + "name": "thumbnail", + "description": "The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60." } ] } diff --git a/idl/wallpaper_private.json b/idl/wallpaper_private.json index 49f5955b..23159062 100644 --- a/idl/wallpaper_private.json +++ b/idl/wallpaper_private.json @@ -21,7 +21,7 @@ { "name": "getStrings", "type": "function", - "description": "Gets translated strings.", + "description": "Gets translated strings and initialization data.", "nodoc": "true", "parameters": [ { @@ -31,7 +31,7 @@ { "name": "result", "type": "object", - "additionalProperties": {"type": "string"} + "additionalProperties": {"type": "any"} } ] } diff --git a/idl/web_navigation.json b/idl/web_navigation.json index 783ecddd..63f1d9c4 100644 --- a/idl/web_navigation.json +++ b/idl/web_navigation.json @@ -149,7 +149,7 @@ "url": {"type": "string"}, "processId": {"type": "integer", "description": "The ID of the process runs the renderer for this tab."}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."}, - "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used."}, + "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the history API except with \"start_page\" in place of \"auto_toplevel\" (for backwards compatibility)."}, "transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"type": "string", "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]}}, "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."} } @@ -283,7 +283,7 @@ "url": {"type": "string"}, "processId": {"type": "integer", "description": "The ID of the process runs the renderer for this tab."}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."}, - "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used."}, + "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the history API except with \"start_page\" in place of \"auto_toplevel\" (for backwards compatibility)."}, "transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"type": "string", "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]}}, "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."} } @@ -327,7 +327,7 @@ "url": {"type": "string"}, "processId": {"type": "integer", "description": "The ID of the process runs the renderer for this tab."}, "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."}, - "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used."}, + "transitionType": {"type": "string", "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"], "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the history API except with \"start_page\" in place of \"auto_toplevel\" (for backwards compatibility)."}, "transitionQualifiers": {"type": "array", "description": "A list of transition qualifiers.", "items": {"type": "string", "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]}}, "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."} } diff --git a/idl/web_request.json b/idl/web_request.json index 786625d6..5d279c76 100644 --- a/idl/web_request.json +++ b/idl/web_request.json @@ -66,7 +66,7 @@ "redirectUrl": { "type": "string", "optional": true, - "description": "Only used as a response to the onBeforeRequest event. If set, the original request is prevented from being sent and is instead redirected to the given URL." + "description": "Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method." }, "requestHeaders": { "$ref": "HttpHeaders", @@ -288,7 +288,7 @@ "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."}, "type": {"type": "string", "enum": ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"], "description": "How the requested resource will be used."}, "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."}, - "statusLine": {"type": "string", "optional": true, "description": "HTTP status line of the response."}, + "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line)."}, "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that have been received with this response."} } } @@ -339,7 +339,7 @@ "challenger": {"type": "object", "description": "The server requesting authentication.", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}}}, "isProxy": {"type": "boolean", "description": "True for Proxy-Authenticate, false for WWW-Authenticate."}, "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."}, - "statusLine": {"type": "string", "optional": true, "description": "HTTP status line of the response."} + "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."} } }, { @@ -396,7 +396,7 @@ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."}, "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."}, - "statusLine": {"type": "string", "optional": true, "description": "HTTP status line of the response."} + "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."} } } ], @@ -441,7 +441,7 @@ "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, "redirectUrl": {"type": "string", "description": "The new URL."}, "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this redirect."}, - "statusLine": {"type": "string", "optional": true, "description": "HTTP status line of the response."} + "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."} } } ], @@ -485,7 +485,7 @@ "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."}, "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}, "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."}, - "statusLine": {"type": "string", "optional": true, "description": "HTTP status line of the response."} + "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."} } } ], diff --git a/idl/webrtc_cast_send_transport.idl b/idl/webrtc_cast_send_transport.idl deleted file mode 100644 index 3070bde4..00000000 --- a/idl/webrtc_cast_send_transport.idl +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// The chrome.webrtc.castSendTransport API takes a track as -// a source of media, and sends that media on the inner transport according to -// the given RtpParams. -namespace webrtc.castSendTransport { - // Params for audio and video codec. - dictionary CodecSpecificParam { - DOMString key; - DOMString value; - }; - - // RTP payload param. - dictionary RtpPayloadParam { - long payloadType; - - DOMString codecName; - - // Synchronization source identifier. - long? ssrc; - - long? clockRate; - - long? minBitrate; - - long? maxBitrate; - - // The number of channels. - long? channels; - - // Video width in pixels. - long? width; - - // Video height in pixels. - long? height; - - // A list of codec specific params. - CodecSpecificParam[] codecSpecficParams; - }; - - // Cast transport capabilities - dictionary CastTransportCaps { - // RTP payload params. - RtpPayloadParam[] payloads; - - DOMString[] rtcpFeatures; - - DOMString[] fecMechanisms; - }; - - // Cast transport params. - dictionary CastTransportParams { - // RTP payload params. - RtpPayloadParam[] payloads; - - DOMString[] rtcpFeatures; - - DOMString[] fecMechanisms; - }; - - // Result of create call. - dictionary CreateInfo { - // The ID of the newly created transport. - long transportId; - }; - - // Callback from the create method. - // |id| : The transport id. - callback CreateCallback = void (CreateInfo info); - - // Callback from the createParams method. - // |params| : The cast transport params. - callback CreateParamsCallback = void (CastTransportParams params); - - // Callback from the getCaps method. - // |caps| : Capabilities of the cast transport. - callback GetCapsCallback = void (CastTransportCaps caps); - - interface Functions { - // Creates a cast send transport. - // |track| : the media track encoded by this transport. - // |innerTransportId| : the ID of the inner transport. The transport to be - // created will send data on the inner transport. - // |callback| : Called when the transport has been created. - [nocompile] static void create( - [instanceOf=MediaStreamTrack] object track, - long innerTransportId, - CreateCallback callback); - - // Destroys a cast send transport. - // |transportId| : The transport ID. - [nocompile] static void destroy(long transportId); - - // Creates suitable params given the capabilities. - // |caps| : the capabilities. - // |callback| : Called when the params have been created. - [nocompile] static void getCaps(long transportId, - GetCapsCallback callback); - - // Creates suitable params given the capabilities. - // |transportId| : The transport ID. - // |remoteCaps| : Capabilities of remote peer. - // |callback| : Called when the params has been created. - [nocompile] static void createParams( - long transportId, - CastTransportCaps remoteCaps, - CreateParamsCallback callback); - - // Starts to use the transport by providing remote params info. - // |transportId| : The transport ID. - // |params| : Parameters set for this transport. - [nocompile] static void start(long transportId, - CastTransportParams params); - - // Stops using the transport. - // |transportId| : The transport ID. - [nocompile] static void stop(long transportId); - }; - - interface Events { - // Event fired when a cast send transport has started. - // |transportId| : The ID of the transport. - static void onStarted(long transportId); - - // Event fired when a cast send transport has connected. - // After this event, the transport is ready to send the track. - // |transportId| : The ID of the transport. - static void onConnected(long transportId); - - // Event fired when a cast send transport has stopped. - // |transportId| : The ID of the transport. - static void onStopped(long transportId); - - // Event fired when a cast send transport has timeout. - // This happens when network has been congested for a while, or one side - // left. - // |transportId| : The ID of the transport. - static void onTimeout(long transportId); - - // Event fired when a cast send transport has error. - // |transportId| : The ID of the transport. - // |errorString| : The error info. - static void onError(long transportId, DOMString errorString); - }; -}; - diff --git a/idl/webrtc_cast_udp_transport.idl b/idl/webrtc_cast_udp_transport.idl deleted file mode 100644 index 0370a38c..00000000 --- a/idl/webrtc_cast_udp_transport.idl +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// The chrome.webrtc.castUdpTransport API creates a UDP -// transport for outer transport to send and receive data. This API is not -// useful when standalone since it does not have send and receive methods. -// It should be used as an inner transport for other transports such as -// castSendTransport. -namespace webrtc.castUdpTransport { - // The UDP socket address and port. - dictionary UdpParams { - DOMString address; - long port; - }; - - // Result of create call. - dictionary CreateInfo { - // The ID of the newly created UDP transport. - long tranportId; - - // The transport params. - UdpParams params; - }; - - // Callback from the create method. - // |createInfo| : The transport info. - // A null value indicates an error. - callback CreateCallback = void (CreateInfo createInfo); - - interface Functions { - // Creates a UDP transport. - // |callback| : Called when the transport has been created. - [nocompile] static void create(CreateCallback callback); - - // Destroys a UDP transport. - // |transportId| : The transport ID. - [nocompile] static void destroy(long transportId); - - // Starts to use the transport by providing remote UDP info. - // |transportId| : The transport ID. - // |remoteParams| : The address and port to send packets to. - [nocompile] static void start(long transportId, UdpParams remoteParams); - - // Stops using the transport. - // |transportId| : The transport ID. - [nocompile] static void stop(long transportId); - }; -}; diff --git a/idl/webstore.json b/idl/webstore.json index 31cbd2d0..38d6de38 100644 --- a/idl/webstore.json +++ b/idl/webstore.json @@ -6,6 +6,40 @@ { "namespace": "webstore", "description": "Use the chrome.webstore API to initiate app and extension installations \"inline\" from your site.", + "types": [ + { + "id": "InstallStage", + "type": "string", + "enum": ["installing", "downloading"], + "description": "Enum used to indicate the stage of the installation process. 'downloading' indicates that the necessary files are being downloaded, and 'installing' indicates that the files are downloaded and are being actively installed." + } + ], // types + "events": [ + { + "name": "onInstallStageChanged", + "description": "Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins.", + "type": "function", + "parameters": [ + { + "name": "stage", + "$ref": "InstallStage", + "description": "The InstallStage that just began." + } + ] + }, // onInstallStageChanged + { + "name": "onDownloadProgress", + "description": "Fired periodically with the download progress of an inline install. In order to receive notifications about this event, listeners must be registered before the inline installation begins.", + "type": "function", + "parameters": [ + { + "name": "percentDownloaded", + "type": "number", + "description": "The progress of the download, between 0 and 1. 0 indicates no progress; 1.0 indicates complete." + } + ] + } // onDownloadProgress + ], // events "functions": [ { "name": "install", @@ -39,6 +73,6 @@ } ] } // install - ] + ] // functions } // webstore ] diff --git a/idl/webstore_private.json b/idl/webstore_private.json index f80ff335..8d8bea71 100644 --- a/idl/webstore_private.json +++ b/idl/webstore_private.json @@ -20,7 +20,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -58,7 +58,7 @@ "name": "callback", "type": "function", "description": "Called when the install process completes. Upon failures, chrome.runtime.lastError will be set to 'user_canceled' or 'unknown_error'.", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -119,7 +119,7 @@ "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", + "optional": true, "parameters": [ { "name": "result", @@ -143,7 +143,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -155,7 +155,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -167,7 +167,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "info", @@ -187,7 +187,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "login", "type": "string" } ] @@ -202,7 +202,7 @@ { "name": "callback", "type": "function", - "optional": "true", + "optional": true, "parameters": [] } ] @@ -214,7 +214,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "webgl_status", @@ -232,7 +232,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "is_enabled", "type": "boolean" } ] @@ -246,7 +246,7 @@ { "name": "callback", "type": "function", - "optional": "false", + "optional": false, "parameters": [ { "name": "is_incognito", "type": "boolean" } ] diff --git a/idl/webview.json b/idl/webview.json index b077a11b..3de3b6e2 100644 --- a/idl/webview.json +++ b/idl/webview.json @@ -6,6 +6,7 @@ { "namespace": "webview", "description": "none", + "dependencies": ["contextMenusInternal"], "types": [ { "id": "DataTypeSet", @@ -58,6 +59,235 @@ } ], "functions": [ + { + "name": "contextMenusCreate", + "type": "function", + "returns": { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "description": "The ID of the newly created item." + }, + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "nodoc": true + }, + { + "type": "object", + "name": "createProperties", + "properties": { + "type": { + "type": "string", + "enum": ["normal", "checkbox", "radio", "separator"], + "optional": true, + "description": "The type of menu item. Defaults to 'normal' if not specified." + }, + "id": { + "type": "string", + "optional": true, + "description": "The unique ID to assign to this item. Cannot be the same as another ID for this webview." + }, + "title": { + "type": "string", + "optional": true, + "description": "The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"." + }, + "checked": { + "type": "boolean", + "optional": true, + "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items." + }, + "contexts": { + "type": "array", + "items": { + "type": "string", + // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API. + "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"] + }, + "minItems": 1, + "optional": true, + "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for ." + }, + "onclick": { + "type": "function", + "optional": true, + "description": "A function that will be called back when the menu item is clicked.", + "parameters": [ + { + "name": "info", + "$ref": "contextMenusInternal.OnClickData", + "description": "Information about the item clicked and the context where the click happened." + } + ] + }, + "parentId": { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "optional": true, + "description": "The ID of a parent menu item; this makes the item a child of a previously added item." + }, + "documentUrlPatterns": { + "type": "array", + "items": {"type": "string"}, + "optional": true, + "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns." + }, + "targetUrlPatterns": { + "type": "array", + "items": {"type": "string"}, + "optional": true, + "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags." + }, + "enabled": { + "type": "boolean", + "optional": true, + "description": "Whether this context menu item is enabled or disabled. Defaults to true." + } + } + }, + { + "type": "function", + "name": "callback", + "optional": true, + "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.", + "parameters": [] + } + ] + }, + { + "name": "contextMenusUpdate", + "type": "function", + "description": "Updates a previously created context menu item.", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "nodoc": true + }, + { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "name": "id", + "description": "The ID of the item to update." + }, + { "type": "object", + "name": "updateProperties", + "description": "The properties to update. Accepts the same values as the create function.", + "properties": { + "type": { + "type": "string", + "enum": ["normal", "checkbox", "radio", "separator"], + "optional": true + }, + "title": { + "type": "string", + "optional": true + }, + "checked": { + "type": "boolean", + "optional": true + }, + "contexts": { + "type": "array", + "items": { + "type": "string", + // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API. + "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"] + }, + "minItems": 1, + "optional": true, + "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for ." + }, + "onclick": { + "type": "function", + "optional": true + }, + "parentId": { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "optional": true, + "description": "Note: You cannot change an item to be a child of one of its own descendants." + }, + "documentUrlPatterns": { + "type": "array", + "items": {"type": "string"}, + "optional": true + }, + "targetUrlPatterns": { + "type": "array", + "items": {"type": "string"}, + "optional": true + }, + "enabled": { + "type": "boolean", + "optional": true + } + } + }, + { + "type": "function", + "name": "callback", + "optional": true, + "parameters": [], + "description": "Called when the context menu has been updated." + } + ] + }, + { + "name": "contextMenusRemove", + "type": "function", + "description": "Removes a context menu item.", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "nodoc": true + }, + { + "choices": [ + { "type": "integer" }, + { "type": "string" } + ], + "name": "menuItemId", + "description": "The ID of the context menu item to remove." + }, + { + "type": "function", + "name": "callback", + "optional": true, + "parameters": [], + "description": "Called when the context menu has been removed." + } + ] + }, + { + "name": "contextMenusRemoveAll", + "type": "function", + "description": "Removes all context menu items added by this webview.", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "nodoc": true + }, + { + "type": "function", + "name": "callback", + "optional": true, + "parameters": [], + "description": "Called when removal is complete." + } + ] + }, { "name": "clearData", "type": "function", @@ -150,6 +380,172 @@ } ] }, + { + "name": "captureVisibleRegion", + "type": "function", + "description": "Captures the visible area of the currently loaded page inside .", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "description": "The instance ID of the guest process." + }, + { + "$ref": "types.ImageDetails", + "name": "options", + "optional": true + }, + { + "type": "function", "name": "callback", "parameters": [ + {"type": "string", "name": "dataUrl", "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."} + ] + } + ] + }, + { + "name": "setZoom", + "type": "function", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "description": "The instance ID of the guest process." + }, + { + "type": "number", + "name": "zoomFactor", + "description" : "The new zoom factor." + }, + { + "type": "function", + "name": "callback", + "description": "Called after the zoom message has been sent to the guest process.", + "optional": true, + "parameters": [] + } + ] + }, + { + "name": "getZoom", + "type": "function", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "description": "The instance ID of the guest process." + }, + { + "type": "function", + "name": "callback", + "description": "Called after the current zoom factor is retreived.", + "parameters": [ + { + "type": "number", + "name": "zoomFactor", + "description": "The current zoom factor." + } + ] + } + ] + }, + { + "name": "find", + "type": "function", + "description": "Initiates a find-in-page request.", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "description": "The instance ID of the guest process." + }, + { + "type": "string", + "name": "searchText", + "description": "The string to find in the page." + }, + { + "type": "object", + "name": "options", + "optional": true, + "properties": { + "backward": { + "type": "boolean", + "description": "Flag to find matches in reverse order.", + "optional": true + }, + "matchCase": { + "type": "boolean", + "description": "Flag to match |searchText| with case-sensitivity.", + "optional": true + } + } + }, + { + "type": "function", + "name": "callback", + "description": "Called after all find results have been returned for this find request.", + "optional": true, + "parameters": [ + { + "type": "object", + "name": "results", + "optional": true, + "properties": { + "numberOfMatches": { + "type": "integer", + "description": "The number of times |searchText| was matched on the page." + }, + "activeMatchOrdinal": { + "type": "integer", + "description": "The ordinal number of the current match." + }, + "selectionRect": { + "type": "object", + "description": "Describes a rectangle around the active match.", + "properties": { + "left": { + "type": "integer" + }, + "top": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + } + }, + "canceled": { + "type": "boolean", + "description": "Indicates whether this find request was canceled." + } + } + } + ] + } + ] + }, + { + "name": "stopFinding", + "type": "function", + "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.", + "parameters": [ + { + "type": "integer", + "name": "instanceId", + "description": "The instance ID of the guest process." + }, + { + "type": "string", + "name": "action", + "description": "Determines what to do with the active match after the find session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.", + "optional": true, + "enum": ["clear", "keep", "activate"] + } + ] + }, { "name": "go", "type": "function", @@ -243,6 +639,14 @@ } ] } + ], + "events": [ + { + "name": "onClicked", + "type": "function", + "nodoc": true, + "$ref": "contextMenusInternal.onClicked" + } ] } ] diff --git a/idl/webview_tag.json b/idl/webview_tag.json index 3b96d568..1802e107 100644 --- a/idl/webview_tag.json +++ b/idl/webview_tag.json @@ -11,6 +11,38 @@ "namespace": "" }, "types": [ + { + "id": "ClearDataOptions", + "type": "object", + "description": "Options that determine what data should be cleared by clearData.", + "properties": { + "since": { + "type": "number", + "optional": true, + "description": "Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data)." + } + } + }, + { + "id": "ClearDataTypeSet", + "type": "object", + "description": "A set of data types. Missing properties are interpreted as false.", + "properties": { + "appcache": { "type": "boolean", "optional": true, "description": "Websites' appcaches." }, + "cache": { "type": "boolean", "optional": true, "description": "The partition's cache. Note: This clears the entire cache regardless of the age passed to clearData." }, + "cookies": { "type": "boolean", "optional": true, "description": "The partition's cookies." }, + "downloads": { "type": "boolean", "optional": true, "description": "The partition's download list." }, + "fileSystems": { "type": "boolean", "optional": true, "description": "Websites' filesystems." }, + "formData": { "type": "boolean", "optional": true, "description": "The partition's stored form data." }, + "history": { "type": "boolean", "optional": true, "description": "The partition's history." }, + "indexedDB": { "type": "boolean", "optional": true, "description": "Websites' IndexedDB data." }, + "localStorage": { "type": "boolean", "optional": true, "description": "Websites' local storage data." }, + "serverBoundCertificates": { "type": "boolean", "optional": true, "description": "Server-bound certificates." }, + "pluginData": { "type": "boolean", "optional": true, "description": "Plugins' data." }, + "passwords": { "type": "boolean", "optional": true, "description": "Stored passwords." }, + "webSQL": { "type": "boolean", "optional": true, "description": "Websites' WebSQL data." } + } + }, { "id": "InjectDetails", "type": "object", @@ -51,6 +83,69 @@ } ] }, + { + "id": "DialogController", + "type": "object", + "description": "Interface attached to dialog DOM events.", + "functions": [ + { + "name": "ok", + "description": "Accept the dialog. Equivalent to clicking OK in an alert, confirm, or prompt dialog.", + "parameters": [ + { + "type": "string", + "optional": true, + "name": "response", + "description": "The response string to provide to the guest when accepting a prompt dialog." + } + ] + }, + { + "name": "cancel", + "description": "Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog." + } + ] + }, + { + "id": "FindCallbackResults", + "type": "object", + "description": "Contains all of the results of the find request.", + "properties": { + "numberOfMatches": { + "type": "integer", + "description": "The number of times searchText was matched on the page." + }, + "activeMatchOrdinal": { + "type": "integer", + "description": "The ordinal number of the current match." + }, + "selectionRect": { + "$ref": "SelectionRect", + "description": "Describes a rectangle around the active match in screen coordinates." + }, + "canceled": { + "type": "boolean", + "description": "Indicates whether this find request was canceled." + } + } + }, + { + "id": "FindOptions", + "type": "object", + "description": "Options for the find request.", + "properties": { + "backward": { + "type": "boolean", + "description": "Flag to find matches in reverse order. The default value is false.", + "optional": true + }, + "matchCase": { + "type": "boolean", + "description": "Flag to match with case-sensitivity. The default value is false.", + "optional": true + } + } + }, { "id": "NewWindow", "type": "object", @@ -86,7 +181,7 @@ }, "functions": [ { "name": "allow", "description": "Allow the permission request." }, - { "name": "deny", "description": "Deny the permission request." } + { "name": "deny", "description": "Deny the permission request. This is the default behavior if allow is not called." } ] }, { @@ -101,7 +196,7 @@ }, "functions": [ { "name": "allow", "description": "Allow the permission request." }, - { "name": "deny", "description": "Deny the permission request." } + { "name": "deny", "description": "Deny the permission request. This is the default behavior if allow is not called." } ] }, { @@ -124,8 +219,75 @@ }, "functions": [ { "name": "allow", "description": "Allow the permission request." }, + { "name": "deny", "description": "Deny the permission request. This is the default behavior if allow is not called." } + ] + }, + { + "id": "DownloadPermissionRequest", + "type": "object", + "description": "The type of request object which accompanies a download permissionrequest DOM event.", + "properties": { + "requestMethod": { + "description": "The HTTP request type (e.g. GET) associated with the download request.", + "type": "string" + }, + "url": { + "description": "The requested download URL.", + "type": "string" + } + }, + "functions": [ + { "name": "allow", "description": "Allow the permission request." }, + { "name": "deny", "description": "Deny the permission request. This is the default behavior if allow is not called." } + ] + }, + { + "id": "LoadPluginPermissionRequest", + "type": "object", + "description": "The type of request object which accompanies a loadplugin permissionrequest DOM event.

", + "properties": { + "identifier": { + "description": "The plugin's identifier string.", + "type": "string" + }, + "name": { + "description": "The plugin's display name.", + "type": "string" + } + }, + "functions": [ + { "name": "allow", "description": "Allow the permission request. This is the default behavior if deny is not called.." }, { "name": "deny", "description": "Deny the permission request." } ] + }, + { + "id": "SelectionRect", + "type": "object", + "description": "

Describes a rectangle in screen coordinates.

The containment semantics are array-like; that is, the coordinate (left, top) is considered to be contained by the rectangle, but the coordinate (left + width, top) is not.

", + "properties": { + "left": { + "type": "integer", + "description": "Distance from the left edge of the screen to the left edge of the rectangle." + }, + "top": { + "type": "integer", + "description": "Distance from the top edge of the screen to the top edge of the rectangle." + }, + "width": { + "type": "integer", + "description": "Width of the rectangle." + }, + "height": { + "type": "integer", + "description": "Height of the rectangle." + } + } + }, + { + "id": "WebRequestEventInteface", + "type": "object", + "description": "Interface which provides access to webRequest events on the guest page. See the chrome.webRequest extensions API for details on webRequest life cycle and related concepts.

To illustrate how usage differs from the extensions webRequest API, consider the following example code which blocks any guest requests for URLs which match *://www.evil.com/*:

webview.request.onBeforeRequest.addListener(\r  function(details) { return {cancel: true}; },\r  {urls: [\"*://www.evil.com/*\"]},\r  [\"blocking\"]);

Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events. See declarativeWebRequest for API details.

Note that conditions and actions for declarative webview webRequests should be instantiated from their chrome.webViewRequest.* counterparts. The following example code declaratively blocks all requests to \"example.com\" on the webview myWebview:

var rule = {\r  conditions: [\r    new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } })\r  ],\r  actions: [ new chrome.webViewRequest.CancelRequest() ]\r};\rmyWebview.request.onRequest.addRules([rule]);
", + "properties": {} } ], "functions": [ @@ -146,6 +308,30 @@ "returns": { "type": "boolean" }, "description": "Indicates whether or not it is possible to navigate forward through history." }, + { + "name": "clearData", + "type": "function", + "description": "

Clears browsing data for the webview partition.

", + "parameters": [ + { + "name": "options", + "$ref": "ClearDataOptions", + "description": "Options determining exactly what data to clear." + }, + { + "name": "types", + "$ref": "ClearDataTypeSet", + "description": "The types of data to be cleared." + }, + { + "type": "function", + "name": "callback", + "optional": true, + "description": "Called after the data has been successfully cleared.", + "parameters": [] + } + ] + }, { "name": "executeScript", "type": "function", @@ -173,6 +359,38 @@ } ] }, + { + "name": "find", + "type": "function", + "description": "Initiates a find-in-page request.", + "parameters": [ + { + "type": "string", + "name": "searchText", + "description": "The string to find in the page." + }, + { + "$ref": "FindOptions", + "name": "options", + "optional": true, + "description": "Options for the find request." + }, + { + "type": "function", + "name": "callback", + "description": "Called after all find results have been returned for this find request.", + "optional": true, + "parameters": [ + { + "$ref": "FindCallbackResults", + "name": "results", + "description": "Contains all of the results of the find request. results can be omitted if it is not utilized in the callback function body; for example, if the callback is only used to discern when the find request has completed.", + "optional": true + } + ] + } + ] + }, { "name": "forward", "type": "function", @@ -186,6 +404,13 @@ "description": "Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID.", "parameters": [] }, + { + "name": "getUserAgent", + "type": "function", + "returns": { "type": "string" }, + "description": "Returns the user agent string used by the webview for guest page requests.", + "parameters": [] + }, { "name": "go", "type": "function", @@ -217,18 +442,49 @@ } ] }, + { + "name": "isUserAgentOverridden", + "type": "function", + "description": "Indicates whether or not the webview's user agent string has been overridden by $(ref:webviewTag.setUserAgentOverride)" + }, { "name": "reload", "type": "function", "description": "Reloads the current top-level page.", "parameters": [] }, + { + "name": "setUserAgentOverride", + "type": "function", + "description": "Override the user agent string used by the webview for guest page requests.", + "parameters": [ + { + "name": "userAgent", + "type": "string", + "description": "The user agent string to use." + } + ] + }, { "name": "stop", "type": "function", "description": "Stops loading the current <webview> navigation if in progress.", "parameters": [] }, + { + "name": "stopFinding", + "type": "function", + "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.", + "parameters": [ + { + "type": "string", + "name": "action", + "description": "Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep.", + "optional": true, + "enum": ["clear", "keep", "activate"] + } + ] + }, { "name": "terminate", "type": "function", @@ -276,6 +532,29 @@ "description": "Fired when the guest window fires a load event.

The following example code modifies the default font size of the guest's body element after the page loads:

webview.addEventListener('contentload', function() {\r  webview.executeScript({ code: 'document.body.style.fontSize = \"42px\"' });\r});
", "parameters": [] }, + { + "name": "dialog", + "options": { "supportsDom": true }, + "description": "Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.

Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)

The default behavior is to cancel the dialog.

", + "parameters": [ + { + "name": "messageType", + "type": "string", + "enum": ["alert", "confirm", "prompt"], + "description": "The type of modal dialog requested by the guest." + }, + { + "name": "messageText", + "type": "string", + "description": "The text the guest attempted to display in the modal dialog." + }, + { + "name": "dialog", + "$ref": "DialogController", + "description": "An interface that can be used to respond to the guest's modal request." + } + ] + }, { "name": "exit", "options": { "supportsDom": true }, @@ -294,6 +573,43 @@ } ] }, + { + "name": "findupdate", + "options": { "supportsDom": true }, + "description": "Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found.", + "parameters": [ + { + "name": "searchText", + "type": "string", + "description": "The string that is being searched for in the page." + }, + { + "name": "numberOfMatches", + "type": "integer", + "description": "The number of matches found for searchText on the page so far." + }, + { + "name": "activeMatchOrdinal", + "type": "integer", + "description": "The ordinal number of the current active match, if it has been found. This will be 0 until then." + }, + { + "name": "selectionRect", + "$ref": "SelectionRect", + "description": "Describes a rectangle around the active match, if it has been found, in screen coordinates." + }, + { + "name": "canceled", + "type": "boolean", + "description": "Indicates whether the find request was canceled." + }, + { + "name": "finalUpdate", + "type": "string", + "description": "Indicates that all find requests have completed and that no more findupdate events will be fired until more find requests are made." + } + ] + }, { "name": "loadabort", "options": { "supportsDom": true }, @@ -426,18 +742,18 @@ "name": "permission", "description": "The type of permission being requested.", "type": "string", - "enum": ["media", "geolocation", "pointerLock"] + "enum": ["media", "geolocation", "pointerLock", "download", "loadplugin"] }, { "name": "requestId", - "description": "An number which uniquely identifies this request from the guest.", + "description": "A number which uniquely identifies this request from the guest.", "type": "integer" }, { "name": "request", "type": "object", "properties": {}, - "description": "An object which holds details of the requested permission. Depending on the type of permission requested, this may be a $ref:MediaPermissionRequest, $ref:GeolocationPermissionRequest, or a $ref:PointerLockPermissionRequest." + "description": "An object which holds details of the requested permission. Depending on the type of permission requested, this may be a $(ref:webviewTag.MediaPermissionRequest), $(ref:webviewTag.GeolocationPermissionRequest), $(ref:webviewTag.PointerLockPermissionRequest), $(ref:webviewTag.DownloadPermissionRequest), or $(ref:webviewTag.LoadPluginPermissionRequest)." } ] }, @@ -497,6 +813,10 @@ "contentWindow": { "$ref": "ContentWindow", "description": "Object reference which can be used to post messages into the guest page." + }, + "request": { + "$ref": "WebRequestEventInteface", + "description": "Interface which provides access to webRequest events on the guest page." } } } diff --git a/idl/windows.json b/idl/windows.json index 8ef02ac8..00ded38b 100644 --- a/idl/windows.json +++ b/idl/windows.json @@ -14,28 +14,28 @@ "id": "Window", "type": "object", "properties": { - "id": {"type": "integer", "optional": true, "minimum": 0, "description": "The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $ref:sessions API, in which case a session ID may be present."}, + "id": {"type": "integer", "optional": true, "minimum": 0, "description": "The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $(ref:sessions) API, in which case a session ID may be present."}, "focused": {"type": "boolean", "description": "Whether the window is currently the focused window."}, - "top": {"type": "integer", "optional": true, "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $ref:sessions API."}, - "left": {"type": "integer", "optional": true, "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $ref:sessions API."}, - "width": {"type": "integer", "optional": true, "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $ref:sessions API."}, - "height": {"type": "integer", "optional": true, "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $ref:sessions API."}, - "tabs": {"type": "array", "items": { "$ref": "tabs.Tab" }, "optional": true, "description": "Array of $ref:tabs.Tab objects representing the current tabs in the window."}, + "top": {"type": "integer", "optional": true, "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API."}, + "left": {"type": "integer", "optional": true, "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API."}, + "width": {"type": "integer", "optional": true, "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API."}, + "height": {"type": "integer", "optional": true, "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API."}, + "tabs": {"type": "array", "items": { "$ref": "tabs.Tab" }, "optional": true, "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window."}, "incognito": {"type": "boolean", "description": "Whether the window is incognito."}, "type": { "type": "string", "optional": true, - "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $ref:sessions API.", + "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $(ref:sessions) API.", "enum": ["normal", "popup", "panel", "app"] }, "state": { "type": "string", "optional": true, - "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $ref:sessions API.", + "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $(ref:sessions) API.", "enum": ["normal", "minimized", "maximized", "fullscreen"] }, "alwaysOnTop": {"type": "boolean", "description": "Whether the window is set to be always on top."}, - "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Window obtained from the $ref:sessions API."} + "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API."} } } ], @@ -62,7 +62,7 @@ "optional": true, "description": "", "properties": { - "populate": {"type": "boolean", "optional": true, "description": "If true, the $ref:windows.Window object will have a tabs property that contains a list of the $ref:tabs.Tab objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } + "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } } }, { @@ -87,7 +87,7 @@ "optional": true, "description": "", "properties": { - "populate": {"type": "boolean", "optional": true, "description": "If true, the $ref:windows.Window object will have a tabs property that contains a list of the $ref:tabs.Tab objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } + "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } } }, { @@ -112,7 +112,7 @@ "optional": true, "description": "", "properties": { - "populate": {"type": "boolean", "optional": true, "description": "If true, the $ref:windows.Window object will have a tabs property that contains a list of the $ref:tabs.Tab objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } + "populate": {"type": "boolean", "optional": true, "description": "If true, the $(ref:windows.Window) object will have a tabs property that contains a list of the $(ref:tabs.Tab) objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } } }, { @@ -137,7 +137,7 @@ "optional": true, "description": "", "properties": { - "populate": {"type": "boolean", "optional": true, "description": "If true, each $ref:windows.Window object will have a tabs property that contains a list of the $ref:tabs.Tab objects for that window. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } + "populate": {"type": "boolean", "optional": true, "description": "If true, each $(ref:windows.Window) object will have a tabs property that contains a list of the $(ref:tabs.Tab) objects for that window. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the \"tabs\" permission." } } }, { diff --git a/lib/chrome_app.dart b/lib/chrome_app.dart index 41f811a5..f141f496 100644 --- a/lib/chrome_app.dart +++ b/lib/chrome_app.dart @@ -9,11 +9,15 @@ export 'gen/alarms.dart'; export 'gen/app.dart'; export 'gen/audio.dart'; export 'gen/bluetooth.dart'; +export 'gen/bluetooth_low_energy.dart'; +export 'gen/bluetooth_socket.dart'; export 'gen/browser.dart'; +export 'gen/commands.dart'; export 'gen/context_menus.dart'; export 'gen/events.dart'; export 'gen/file_system.dart'; export 'gen/gcm.dart'; +export 'gen/hid.dart'; export 'gen/i18n.dart'; export 'gen/identity.dart'; export 'gen/idle.dart'; diff --git a/lib/gen/alarms.dart b/lib/gen/alarms.dart index d4448f68..a7ddddac 100644 --- a/lib/gen/alarms.dart +++ b/lib/gen/alarms.dart @@ -83,19 +83,23 @@ class ChromeAlarms extends ChromeApi { * Clears the alarm with the given name. * [name]: The name of the alarm to clear. Defaults to the empty string. */ - void clear([String name]) { + Future clear([String name]) { if (_alarms == null) _throwNotAvailable(); - _alarms.callMethod('clear', [name]); + var completer = new ChromeCompleter.oneArg(); + _alarms.callMethod('clear', [name, completer.callback]); + return completer.future; } /** * Clears all alarms. */ - void clearAll() { + Future clearAll() { if (_alarms == null) _throwNotAvailable(); - _alarms.callMethod('clearAll'); + var completer = new ChromeCompleter.oneArg(); + _alarms.callMethod('clearAll', [completer.callback]); + return completer.future; } void _throwNotAvailable() { diff --git a/lib/gen/app.dart b/lib/gen/app.dart index 51e49187..e8c1c114 100644 --- a/lib/gen/app.dart +++ b/lib/gen/app.dart @@ -142,8 +142,8 @@ class _ChromeAppWindow extends ChromeApi { * ways. The most simple option is not specifying anything at all, in which * case a default size and platform dependent position will be used. * - * Another option is to use the bounds property, which will put the window at - * the specified coordinates with the specified size. If the window has a + * Another option is to use the `bounds` property, which will put the window + * at the specified coordinates with the specified size. If the window has a * frame, it's total size will be the size given plus the size of the frame; * that is, the size in bounds is the content size, not the window size. * @@ -160,8 +160,8 @@ class _ChromeAppWindow extends ChromeApi { * the created window (child). The parent can set fields or functions on the * child usable from onload. E.g. background.js: * - * `function(created_window) { created_window.contentWindow.foo = function () - * { }; };` + * `function(createdWindow) { createdWindow.contentWindow.foo = function () { + * }; };` * * window.js: * @@ -192,6 +192,27 @@ class _ChromeAppWindow extends ChromeApi { _app_window.callMethod('initializeAppWindow', [jsify(state)]); } + /** + * Gets an array of all currently created app windows. This method is new in + * Chrome 33. + */ + List getAll() { + if (_app_window == null) _throwNotAvailable(); + + var ret = _app_window.callMethod('getAll'); + return ret; + } + + /** + * Gets an [AppWindow] with the given id. If no window with the given id + * exists null is returned. This method is new in Chrome 33. + */ + AppWindow get(String id) { + if (_app_window == null) _throwNotAvailable(); + + return _createAppWindow(_app_window.callMethod('get', [id])); + } + void _throwNotAvailable() { throw new UnsupportedError("'chrome.app.window' is not available"); } @@ -224,9 +245,88 @@ class WindowType extends ChromeEnum { const WindowType._(String str): super(str); } +/** + * Previously named Bounds. + */ +class ContentBounds extends ChromeObject { + ContentBounds({int left, int top, int width, int height}) { + if (left != null) this.left = left; + if (top != null) this.top = top; + if (width != null) this.width = width; + if (height != null) this.height = height; + } + ContentBounds.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get left => jsProxy['left']; + set left(int value) => jsProxy['left'] = value; + + int get top => jsProxy['top']; + set top(int value) => jsProxy['top'] = value; + + int get width => jsProxy['width']; + set width(int value) => jsProxy['width'] = value; + + int get height => jsProxy['height']; + set height(int value) => jsProxy['height'] = value; +} + +class BoundsSpecification extends ChromeObject { + BoundsSpecification({int left, int top, int width, int height, int minWidth, int minHeight, int maxWidth, int maxHeight}) { + if (left != null) this.left = left; + if (top != null) this.top = top; + if (width != null) this.width = width; + if (height != null) this.height = height; + if (minWidth != null) this.minWidth = minWidth; + if (minHeight != null) this.minHeight = minHeight; + if (maxWidth != null) this.maxWidth = maxWidth; + if (maxHeight != null) this.maxHeight = maxHeight; + } + BoundsSpecification.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get left => jsProxy['left']; + set left(int value) => jsProxy['left'] = value; + + int get top => jsProxy['top']; + set top(int value) => jsProxy['top'] = value; + + int get width => jsProxy['width']; + set width(int value) => jsProxy['width'] = value; + + int get height => jsProxy['height']; + set height(int value) => jsProxy['height'] = value; + + int get minWidth => jsProxy['minWidth']; + set minWidth(int value) => jsProxy['minWidth'] = value; + + int get minHeight => jsProxy['minHeight']; + set minHeight(int value) => jsProxy['minHeight'] = value; + + int get maxWidth => jsProxy['maxWidth']; + set maxWidth(int value) => jsProxy['maxWidth'] = value; + + int get maxHeight => jsProxy['maxHeight']; + set maxHeight(int value) => jsProxy['maxHeight'] = value; +} + +class FrameOptions extends ChromeObject { + FrameOptions({String type, String color}) { + if (type != null) this.type = type; + if (color != null) this.color = color; + } + FrameOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + String get type => jsProxy['type']; + set type(String value) => jsProxy['type'] = value; + + String get color => jsProxy['color']; + set color(String value) => jsProxy['color'] = value; +} + class CreateWindowOptions extends ChromeObject { - CreateWindowOptions({String id, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, WindowType type, String frame, Bounds bounds, bool transparentBackground, State state, bool hidden, bool resizable, bool singleton, bool alwaysOnTop}) { + CreateWindowOptions({String id, BoundsSpecification innerBounds, BoundsSpecification outerBounds, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, WindowType type, String frame, ContentBounds bounds, bool transparentBackground, State state, bool hidden, bool resizable, bool singleton, bool alwaysOnTop, bool focused}) { if (id != null) this.id = id; + if (innerBounds != null) this.innerBounds = innerBounds; + if (outerBounds != null) this.outerBounds = outerBounds; if (defaultWidth != null) this.defaultWidth = defaultWidth; if (defaultHeight != null) this.defaultHeight = defaultHeight; if (defaultLeft != null) this.defaultLeft = defaultLeft; @@ -248,12 +348,19 @@ class CreateWindowOptions extends ChromeObject { if (resizable != null) this.resizable = resizable; if (singleton != null) this.singleton = singleton; if (alwaysOnTop != null) this.alwaysOnTop = alwaysOnTop; + if (focused != null) this.focused = focused; } CreateWindowOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); String get id => jsProxy['id']; set id(String value) => jsProxy['id'] = value; + BoundsSpecification get innerBounds => _createBoundsSpecification(jsProxy['innerBounds']); + set innerBounds(BoundsSpecification value) => jsProxy['innerBounds'] = jsify(value); + + BoundsSpecification get outerBounds => _createBoundsSpecification(jsProxy['outerBounds']); + set outerBounds(BoundsSpecification value) => jsProxy['outerBounds'] = jsify(value); + int get defaultWidth => jsProxy['defaultWidth']; set defaultWidth(int value) => jsProxy['defaultWidth'] = value; @@ -296,8 +403,8 @@ class CreateWindowOptions extends ChromeObject { String get frame => jsProxy['frame']; set frame(String value) => jsProxy['frame'] = value; - Bounds get bounds => _createBounds(jsProxy['bounds']); - set bounds(Bounds value) => jsProxy['bounds'] = jsify(value); + ContentBounds get bounds => _createContentBounds(jsProxy['bounds']); + set bounds(ContentBounds value) => jsProxy['bounds'] = jsify(value); bool get transparentBackground => jsProxy['transparentBackground']; set transparentBackground(bool value) => jsProxy['transparentBackground'] = value; @@ -316,17 +423,40 @@ class CreateWindowOptions extends ChromeObject { bool get alwaysOnTop => jsProxy['alwaysOnTop']; set alwaysOnTop(bool value) => jsProxy['alwaysOnTop'] = value; + + bool get focused => jsProxy['focused']; + set focused(bool value) => jsProxy['focused'] = value; } class _AppWindow extends ChromeObject { - _AppWindow({Window contentWindow}) { + _AppWindow({bool hasFrameColor, int frameColor, Window contentWindow, String id, Bounds innerBounds, Bounds outerBounds}) { + if (hasFrameColor != null) this.hasFrameColor = hasFrameColor; + if (frameColor != null) this.frameColor = frameColor; if (contentWindow != null) this.contentWindow = contentWindow; + if (id != null) this.id = id; + if (innerBounds != null) this.innerBounds = innerBounds; + if (outerBounds != null) this.outerBounds = outerBounds; } _AppWindow.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + bool get hasFrameColor => jsProxy['hasFrameColor']; + set hasFrameColor(bool value) => jsProxy['hasFrameColor'] = value; + + int get frameColor => jsProxy['frameColor']; + set frameColor(int value) => jsProxy['frameColor'] = value; + Window get contentWindow => _createWindow(jsProxy['contentWindow']); set contentWindow(Window value) => jsProxy['contentWindow'] = jsify(value); + String get id => jsProxy['id']; + set id(String value) => jsProxy['id'] = value; + + Bounds get innerBounds => _createBounds(jsProxy['innerBounds']); + set innerBounds(Bounds value) => jsProxy['innerBounds'] = jsify(value); + + Bounds get outerBounds => _createBounds(jsProxy['outerBounds']); + set outerBounds(Bounds value) => jsProxy['outerBounds'] = jsify(value); + /** * Focus the window. */ @@ -336,6 +466,14 @@ class _AppWindow extends ChromeObject { /** * Fullscreens the window. + * + * The user will be able to restore the window by pressing ESC. An + * application can prevent the fullscreen state to be left when ESC is pressed + * by requesting the app.window.fullscreen.overrideEsc permission and + * canceling the event by calling .preventDefault(), like this: + * + * `window.onKeyDown = function(e) { if (e.keyCode == 27 / ESC /) { + * e.preventDefault(); } };` */ void fullscreen() { jsProxy.callMethod('fullscreen'); @@ -419,10 +557,11 @@ class _AppWindow extends ChromeObject { } /** - * Show the window. Does nothing if the window is already visible. + * Show the window. Does nothing if the window is already visible. Focus the + * window if [focused] is set to true or omitted. */ - void show() { - jsProxy.callMethod('show'); + void show([bool focused]) { + jsProxy.callMethod('show', [focused]); } /** @@ -433,16 +572,16 @@ class _AppWindow extends ChromeObject { } /** - * Get the window's bounds as a [Bounds] object. + * Get the window's inner bounds as a [ContentBounds] object. */ - Bounds getBounds() { - return _createBounds(jsProxy.callMethod('getBounds')); + ContentBounds getBounds() { + return _createContentBounds(jsProxy.callMethod('getBounds')); } /** - * Set the window's bounds. + * Set the window's inner bounds. */ - void setBounds(Bounds bounds) { + void setBounds(ContentBounds bounds) { jsProxy.callMethod('setBounds', [jsify(bounds)]); } @@ -451,28 +590,46 @@ class _AppWindow extends ChromeObject { * being implemented on Ash. todo(stevenjb): Investigate implementing this on * Windows and OSX. */ - void setIcon(String icon_url) { - jsProxy.callMethod('setIcon', [icon_url]); + void setIcon(String iconUrl) { + jsProxy.callMethod('setIcon', [iconUrl]); + } + + /** + * Set a badge icon for the window. todo(benwells): Document this properly + * before going to stable. + */ + void setBadgeIcon(String iconUrl) { + jsProxy.callMethod('setBadgeIcon', [iconUrl]); } /** - * Is the window always on top? Currently available in the Dev channel only. + * Clear the current for the window. todo(benwells): Document this properly + * before going to stable. + */ + void clearBadge() { + jsProxy.callMethod('clearBadge'); + } + + /** + * Is the window always on top? */ bool isAlwaysOnTop() { return jsProxy.callMethod('isAlwaysOnTop'); } /** - * Set whether the window should stay above most other windows. Currently - * available in the Dev channel only. + * Set whether the window should stay above most other windows. Requires the + * `"app.window.alwaysOnTop"` permission. */ - void setAlwaysOnTop(bool always_on_top) { - jsProxy.callMethod('setAlwaysOnTop', [always_on_top]); + void setAlwaysOnTop(bool alwaysOnTop) { + jsProxy.callMethod('setAlwaysOnTop', [alwaysOnTop]); } } AppWindow _createAppWindow(JsObject jsProxy) => jsProxy == null ? null : new AppWindow.fromProxy(jsProxy); +BoundsSpecification _createBoundsSpecification(JsObject jsProxy) => jsProxy == null ? null : new BoundsSpecification.fromProxy(jsProxy); WindowType _createWindowType(String value) => WindowType.VALUES.singleWhere((ChromeEnum e) => e.value == value); -Bounds _createBounds(JsObject jsProxy) => jsProxy == null ? null : new Bounds.fromProxy(jsProxy); +ContentBounds _createContentBounds(JsObject jsProxy) => jsProxy == null ? null : new ContentBounds.fromProxy(jsProxy); State _createState(String value) => State.VALUES.singleWhere((ChromeEnum e) => e.value == value); Window _createWindow(JsObject jsProxy) => jsProxy == null ? null : new Window.fromProxy(jsProxy); +Bounds _createBounds(JsObject jsProxy) => jsProxy == null ? null : new Bounds.fromProxy(jsProxy); diff --git a/lib/gen/bluetooth.dart b/lib/gen/bluetooth.dart index fce6dd52..a6857799 100644 --- a/lib/gen/bluetooth.dart +++ b/lib/gen/bluetooth.dart @@ -1,7 +1,8 @@ /* This file has been generated from bluetooth.idl - do not edit */ /** - * Use the `chrome.bluetooth` API to connect to a Bluetooth device. + * Use the `chrome.bluetooth` API to connect to a Bluetooth device. All + * functions report failures via chrome.runtime.lastError. */ library chrome.bluetooth; @@ -18,12 +19,24 @@ class ChromeBluetooth extends ChromeApi { Stream get onAdapterStateChanged => _onAdapterStateChanged.stream; ChromeStreamController _onAdapterStateChanged; + Stream get onDeviceAdded => _onDeviceAdded.stream; + ChromeStreamController _onDeviceAdded; + + Stream get onDeviceChanged => _onDeviceChanged.stream; + ChromeStreamController _onDeviceChanged; + + Stream get onDeviceRemoved => _onDeviceRemoved.stream; + ChromeStreamController _onDeviceRemoved; + Stream get onConnection => _onConnection.stream; ChromeStreamController _onConnection; ChromeBluetooth._() { var getApi = () => _bluetooth; _onAdapterStateChanged = new ChromeStreamController.oneArg(getApi, 'onAdapterStateChanged', _createAdapterState); + _onDeviceAdded = new ChromeStreamController.oneArg(getApi, 'onDeviceAdded', _createDevice); + _onDeviceChanged = new ChromeStreamController.oneArg(getApi, 'onDeviceChanged', _createDevice); + _onDeviceRemoved = new ChromeStreamController.oneArg(getApi, 'onDeviceRemoved', _createDevice); _onConnection = new ChromeStreamController.oneArg(getApi, 'onConnection', _createSocket); } @@ -68,41 +81,28 @@ class ChromeBluetooth extends ChromeApi { } /** - * Get a bluetooth devices known to the system. Known devices are either - * currently paired, or have been paired in the past. - * [options]: Controls which devices are returned and provides - * [deviceCallback], which is called for each matching device. - * [callback]: Called when the search is completed. |options.deviceCallback| - * will not be called after [callback] has been called. - */ - Future getDevices(GetDevicesOptions options) { - if (_bluetooth == null) _throwNotAvailable(); - - var completer = new ChromeCompleter.noArgs(); - _bluetooth.callMethod('getDevices', [jsify(options), completer.callback]); - return completer.future; - } - - /** - * Returns the set of exported profiles for the device specified in options. - * This function will not initiate a connection to the remote device. + * Get a list of Bluetooth devices known to the system, including paired and + * recently discovered devices. + * [callback]: Called when the search is completed. */ - Future> getProfiles(GetProfilesOptions options) { + Future> getDevices() { if (_bluetooth == null) _throwNotAvailable(); - var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createProfile)); - _bluetooth.callMethod('getProfiles', [jsify(options), completer.callback]); + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createDevice)); + _bluetooth.callMethod('getDevices', [completer.callback]); return completer.future; } /** - * Get a list of services provided by a device. + * Get information about a Bluetooth device known to the system. + * [deviceAddress]: Address of device to get. + * [callback]: Called with the BluetoothDevice object describing the device. */ - Future> getServices(GetServicesOptions options) { + Future getDevice(String deviceAddress) { if (_bluetooth == null) _throwNotAvailable(); - var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createServiceRecord)); - _bluetooth.callMethod('getServices', [jsify(options), completer.callback]); + var completer = new ChromeCompleter.oneArg(_createDevice); + _bluetooth.callMethod('getDevice', [deviceAddress, completer.callback]); return completer.future; } @@ -133,9 +133,11 @@ class ChromeBluetooth extends ChromeApi { } /** - * Read data from a Bluetooth connection. + * Read data from a Bluetooth connection. The [callback] will be called with + * the current data in the buffer even if it is empty. This function should be + * polled to read incoming data. * [options]: The options for this function. - * [callback]: Called with the data when it is available. + * [callback]: Called with the data read from the socket buffer. */ Future read(ReadOptions options) { if (_bluetooth == null) _throwNotAvailable(); @@ -185,18 +187,21 @@ class ChromeBluetooth extends ChromeApi { } /** - * Start discovery. Discovered devices will be returned via the - * [onDeviceDiscovered] callback. Discovery will fail to start if it is - * already in progress. Discovery can be resource intensive: stopDiscovery - * should be called as soon as possible. - * [options]: The options for this function. + * Start discovery. Newly discovered devices will be returned via the + * onDeviceAdded event. Previously discovered devices already known to the + * adapter must be obtained using getDevices and will only be updated using + * the [onDeviceChanged] event if information about them changes. + * + * Discovery will fail to start if this application has already called + * startDiscovery. Discovery can be resource intensive: stopDiscovery should + * be called as soon as possible. * [callback]: Called to indicate success or failure. */ - Future startDiscovery(StartDiscoveryOptions options) { + Future startDiscovery() { if (_bluetooth == null) _throwNotAvailable(); var completer = new ChromeCompleter.noArgs(); - _bluetooth.callMethod('startDiscovery', [jsify(options), completer.callback]); + _bluetooth.callMethod('startDiscovery', [completer.callback]); return completer.future; } @@ -217,6 +222,41 @@ class ChromeBluetooth extends ChromeApi { } } +/** + * Allocation authorities for Vendor IDs. + */ +class VendorIdSource extends ChromeEnum { + static const VendorIdSource BLUETOOTH = const VendorIdSource._('bluetooth'); + static const VendorIdSource USB = const VendorIdSource._('usb'); + + static const List VALUES = const[BLUETOOTH, USB]; + + const VendorIdSource._(String str): super(str); +} + +/** + * Common device types recognized by Chrome. + */ +class DeviceType extends ChromeEnum { + static const DeviceType COMPUTER = const DeviceType._('computer'); + static const DeviceType PHONE = const DeviceType._('phone'); + static const DeviceType MODEM = const DeviceType._('modem'); + static const DeviceType AUDIO = const DeviceType._('audio'); + static const DeviceType CAR_AUDIO = const DeviceType._('carAudio'); + static const DeviceType VIDEO = const DeviceType._('video'); + static const DeviceType PERIPHERAL = const DeviceType._('peripheral'); + static const DeviceType JOYSTICK = const DeviceType._('joystick'); + static const DeviceType GAMEPAD = const DeviceType._('gamepad'); + static const DeviceType KEYBOARD = const DeviceType._('keyboard'); + static const DeviceType MOUSE = const DeviceType._('mouse'); + static const DeviceType TABLET = const DeviceType._('tablet'); + static const DeviceType KEYBOARD_MOUSE_COMBO = const DeviceType._('keyboardMouseCombo'); + + static const List VALUES = const[COMPUTER, PHONE, MODEM, AUDIO, CAR_AUDIO, VIDEO, PERIPHERAL, JOYSTICK, GAMEPAD, KEYBOARD, MOUSE, TABLET, KEYBOARD_MOUSE_COMBO]; + + const DeviceType._(String str): super(str); +} + class AdapterState extends ChromeObject { AdapterState({String address, String name, bool powered, bool available, bool discovering}) { if (address != null) this.address = address; @@ -244,11 +284,18 @@ class AdapterState extends ChromeObject { } class BluetoothDevice extends ChromeObject { - BluetoothDevice({String address, String name, bool paired, bool connected}) { + BluetoothDevice({String address, String name, int deviceClass, VendorIdSource vendorIdSource, int vendorId, int productId, int deviceId, DeviceType type, bool paired, bool connected, List uuids}) { if (address != null) this.address = address; if (name != null) this.name = name; + if (deviceClass != null) this.deviceClass = deviceClass; + if (vendorIdSource != null) this.vendorIdSource = vendorIdSource; + if (vendorId != null) this.vendorId = vendorId; + if (productId != null) this.productId = productId; + if (deviceId != null) this.deviceId = deviceId; + if (type != null) this.type = type; if (paired != null) this.paired = paired; if (connected != null) this.connected = connected; + if (uuids != null) this.uuids = uuids; } BluetoothDevice.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); @@ -258,11 +305,32 @@ class BluetoothDevice extends ChromeObject { String get name => jsProxy['name']; set name(String value) => jsProxy['name'] = value; + int get deviceClass => jsProxy['deviceClass']; + set deviceClass(int value) => jsProxy['deviceClass'] = value; + + VendorIdSource get vendorIdSource => _createVendorIdSource(jsProxy['vendorIdSource']); + set vendorIdSource(VendorIdSource value) => jsProxy['vendorIdSource'] = jsify(value); + + int get vendorId => jsProxy['vendorId']; + set vendorId(int value) => jsProxy['vendorId'] = value; + + int get productId => jsProxy['productId']; + set productId(int value) => jsProxy['productId'] = value; + + int get deviceId => jsProxy['deviceId']; + set deviceId(int value) => jsProxy['deviceId'] = value; + + DeviceType get type => _createDeviceType(jsProxy['type']); + set type(DeviceType value) => jsProxy['type'] = jsify(value); + bool get paired => jsProxy['paired']; set paired(bool value) => jsProxy['paired'] = value; bool get connected => jsProxy['connected']; set connected(bool value) => jsProxy['connected'] = value; + + List get uuids => listify(jsProxy['uuids']); + set uuids(List value) => jsProxy['uuids'] = jsify(value); } class Profile extends ChromeObject { @@ -353,50 +421,6 @@ class OutOfBandPairingData extends ChromeObject { set randomizer(ArrayBuffer value) => jsProxy['randomizer'] = jsify(value); } -/** - * Options for the getDevices function. If [profile] is not provided, all - * devices known to the system are returned. - */ -class GetDevicesOptions extends ChromeObject { - GetDevicesOptions({Profile profile, DeviceCallback deviceCallback}) { - if (profile != null) this.profile = profile; - if (deviceCallback != null) this.deviceCallback = deviceCallback; - } - GetDevicesOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - - Profile get profile => _createProfile(jsProxy['profile']); - set profile(Profile value) => jsProxy['profile'] = jsify(value); - - DeviceCallback get deviceCallback => _createDeviceCallback(jsProxy['deviceCallback']); - set deviceCallback(DeviceCallback value) => jsProxy['deviceCallback'] = jsify(value); -} - -/** - * Options for the getProfiles function. - */ -class GetProfilesOptions extends ChromeObject { - GetProfilesOptions({BluetoothDevice device}) { - if (device != null) this.device = device; - } - GetProfilesOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - - BluetoothDevice get device => _createDevice(jsProxy['device']); - set device(BluetoothDevice value) => jsProxy['device'] = jsify(value); -} - -/** - * Options for the getServices function. - */ -class GetServicesOptions extends ChromeObject { - GetServicesOptions({String deviceAddress}) { - if (deviceAddress != null) this.deviceAddress = deviceAddress; - } - GetServicesOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - - String get deviceAddress => jsProxy['deviceAddress']; - set deviceAddress(String value) => jsProxy['deviceAddress'] = value; -} - /** * Options for the connect function. */ @@ -474,24 +498,11 @@ class SetOutOfBandPairingDataOptions extends ChromeObject { set data(OutOfBandPairingData value) => jsProxy['data'] = jsify(value); } -/** - * Options for the startDiscovery function. - */ -class StartDiscoveryOptions extends ChromeObject { - StartDiscoveryOptions({DeviceCallback deviceCallback}) { - if (deviceCallback != null) this.deviceCallback = deviceCallback; - } - StartDiscoveryOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - - DeviceCallback get deviceCallback => _createDeviceCallback(jsProxy['deviceCallback']); - set deviceCallback(DeviceCallback value) => jsProxy['deviceCallback'] = jsify(value); -} - AdapterState _createAdapterState(JsObject jsProxy) => jsProxy == null ? null : new AdapterState.fromProxy(jsProxy); +BluetoothDevice _createDevice(JsObject jsProxy) => jsProxy == null ? null : new BluetoothDevice.fromProxy(jsProxy); Socket _createSocket(JsObject jsProxy) => jsProxy == null ? null : new Socket.fromProxy(jsProxy); -Profile _createProfile(JsObject jsProxy) => jsProxy == null ? null : new Profile.fromProxy(jsProxy); -ServiceRecord _createServiceRecord(JsObject jsProxy) => jsProxy == null ? null : new ServiceRecord.fromProxy(jsProxy); ArrayBuffer _createArrayBuffer(/*JsObject*/ jsProxy) => jsProxy == null ? null : new ArrayBuffer.fromProxy(jsProxy); OutOfBandPairingData _createOutOfBandPairingData(JsObject jsProxy) => jsProxy == null ? null : new OutOfBandPairingData.fromProxy(jsProxy); -BluetoothDevice _createDevice(JsObject jsProxy) => jsProxy == null ? null : new BluetoothDevice.fromProxy(jsProxy); -DeviceCallback _createDeviceCallback(JsObject jsProxy) => jsProxy == null ? null : new DeviceCallback.fromProxy(jsProxy); +VendorIdSource _createVendorIdSource(String value) => VendorIdSource.VALUES.singleWhere((ChromeEnum e) => e.value == value); +DeviceType _createDeviceType(String value) => DeviceType.VALUES.singleWhere((ChromeEnum e) => e.value == value); +Profile _createProfile(JsObject jsProxy) => jsProxy == null ? null : new Profile.fromProxy(jsProxy); diff --git a/lib/gen/bluetooth_low_energy.dart b/lib/gen/bluetooth_low_energy.dart new file mode 100644 index 00000000..57be92e7 --- /dev/null +++ b/lib/gen/bluetooth_low_energy.dart @@ -0,0 +1,391 @@ +/* This file has been generated from bluetooth_low_energy.idl - do not edit */ + +/** + * The `chrome.bluetoothLowEnergy` API is used to communicate with Bluetooth + * Smart (Low Energy) devices using the + * Generic Attribute Profile (GATT). + */ +library chrome.bluetoothLowEnergy; + +import '../src/common.dart'; + +/** + * Accessor for the `chrome.bluetoothLowEnergy` namespace. + */ +final ChromeBluetoothLowEnergy bluetoothLowEnergy = new ChromeBluetoothLowEnergy._(); + +class ChromeBluetoothLowEnergy extends ChromeApi { + JsObject get _bluetoothLowEnergy => chrome['bluetoothLowEnergy']; + + Stream get onServiceAdded => _onServiceAdded.stream; + ChromeStreamController _onServiceAdded; + + Stream get onServiceChanged => _onServiceChanged.stream; + ChromeStreamController _onServiceChanged; + + Stream get onServiceRemoved => _onServiceRemoved.stream; + ChromeStreamController _onServiceRemoved; + + Stream get onCharacteristicValueChanged => _onCharacteristicValueChanged.stream; + ChromeStreamController _onCharacteristicValueChanged; + + Stream get onDescriptorValueChanged => _onDescriptorValueChanged.stream; + ChromeStreamController _onDescriptorValueChanged; + + ChromeBluetoothLowEnergy._() { + var getApi = () => _bluetoothLowEnergy; + _onServiceAdded = new ChromeStreamController.oneArg(getApi, 'onServiceAdded', _createService); + _onServiceChanged = new ChromeStreamController.oneArg(getApi, 'onServiceChanged', _createService); + _onServiceRemoved = new ChromeStreamController.oneArg(getApi, 'onServiceRemoved', _createService); + _onCharacteristicValueChanged = new ChromeStreamController.oneArg(getApi, 'onCharacteristicValueChanged', _createCharacteristic); + _onDescriptorValueChanged = new ChromeStreamController.oneArg(getApi, 'onDescriptorValueChanged', _createDescriptor); + } + + bool get available => _bluetoothLowEnergy != null; + + /** + * Establishes a connection between the application and the device with the + * given address. A device may be already connected and its GATT services + * available without calling `connect`, however, an app that wants to access + * GATT services of a device should call this function to make sure that a + * connection to the device is maintained. If the device is not connected, all + * GATT services of the device will be discovered after a successful call to + * `connect`. + * [deviceAddress]: The Bluetooth address of the remote device to which a GATT + * connection should be opened. + * [properties]: Connection properties (optional). + * [callback]: Called when the connect request has completed. + */ + Future connect(String deviceAddress, [ConnectProperties properties]) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothLowEnergy.callMethod('connect', [deviceAddress, jsify(properties), completer.callback]); + return completer.future; + } + + /** + * Closes the app's connection to the device with the given address. Note that + * this will not always destroy the physical link itself, since there may be + * other apps with open connections. + * [deviceAddress]: The Bluetooth address of the remote device. + * [callback]: Called when the disconnect request has completed. + */ + Future disconnect(String deviceAddress) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothLowEnergy.callMethod('disconnect', [deviceAddress, completer.callback]); + return completer.future; + } + + /** + * Get the GATT service with the given instance ID. + * [serviceId]: The instance ID of the requested GATT service. + * [callback]: Called with the requested Service object. + */ + Future getService(String serviceId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createService); + _bluetoothLowEnergy.callMethod('getService', [serviceId, completer.callback]); + return completer.future; + } + + /** + * Get all the GATT services that were discovered on the remote device with + * the given device address. + * [deviceAddress]: The Bluetooth address of the remote device whose GATT + * services should be returned. + * [callback]: Called with the list of requested Service objects. + */ + Future> getServices(String deviceAddress) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createService)); + _bluetoothLowEnergy.callMethod('getServices', [deviceAddress, completer.callback]); + return completer.future; + } + + /** + * Get the GATT characteristic with the given instance ID that belongs to the + * given GATT service, if the characteristic exists. + * [characteristicId]: The instance ID of the requested GATT characteristic. + * [callback]: Called with the requested Characteristic object. + */ + Future getCharacteristic(String characteristicId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createCharacteristic); + _bluetoothLowEnergy.callMethod('getCharacteristic', [characteristicId, completer.callback]); + return completer.future; + } + + /** + * Get a list of all discovered GATT characteristics that belong to the given + * service. + * [serviceId]: The instance ID of the GATT service whose characteristics + * should be returned. + * [callback]: Called with the list of characteristics that belong to the + * given service. + */ + Future> getCharacteristics(String serviceId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createCharacteristic)); + _bluetoothLowEnergy.callMethod('getCharacteristics', [serviceId, completer.callback]); + return completer.future; + } + + /** + * Get a list of GATT services that are included by the given service. + * [serviceId]: The instance ID of the GATT service whose included services + * should be returned. + * [callback]: Called with the list of GATT services included from the given + * service. + */ + Future> getIncludedServices(String serviceId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createService)); + _bluetoothLowEnergy.callMethod('getIncludedServices', [serviceId, completer.callback]); + return completer.future; + } + + /** + * Get the GATT characteristic descriptor with the given instance ID. + * [descriptorId]: The instance ID of the requested GATT characteristic + * descriptor. + * [callback]: Called with the requested Descriptor object. + */ + Future getDescriptor(String descriptorId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createDescriptor); + _bluetoothLowEnergy.callMethod('getDescriptor', [descriptorId, completer.callback]); + return completer.future; + } + + /** + * Get a list of GATT characteristic descriptors that belong to the given + * characteristic. + * [characteristicId]: The instance ID of the GATT characteristic whose + * descriptors should be returned. + * [callback]: Called with the list of descriptors that belong to the given + * characteristic. + */ + Future> getDescriptors(String characteristicId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createDescriptor)); + _bluetoothLowEnergy.callMethod('getDescriptors', [characteristicId, completer.callback]); + return completer.future; + } + + /** + * Retrieve the value of a specified characteristic from a remote peripheral. + * This function will fail if the characteristic is local. + * [characteristicId]: The instance ID of the GATT characteristic whose value + * should be read from the remote device. + * [callback]: Called with the Characteristic object whose value was + * requested. The `value` field of the returned Characteristic object contains + * the result of the read request. + */ + Future readCharacteristicValue(String characteristicId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createCharacteristic); + _bluetoothLowEnergy.callMethod('readCharacteristicValue', [characteristicId, completer.callback]); + return completer.future; + } + + /** + * Write the value of a specified characteristic from a remote peripheral. + * This function will fail if the characteristic is local. + * [characteristicId]: The instance ID of the GATT characteristic whose value + * should be written to. + * [value]: The value that should be sent to the remote characteristic as part + * of the write request. + * [callback]: Called when the write request has completed. + */ + Future writeCharacteristicValue(String characteristicId, ArrayBuffer value) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothLowEnergy.callMethod('writeCharacteristicValue', [characteristicId, jsify(value), completer.callback]); + return completer.future; + } + + /** + * Retrieve the value of a specified characteristic descriptor from a remote + * peripheral. This function will fail if the descriptor is local. + * [descriptorId]: The instance ID of the GATT characteristic descriptor whose + * value should be read from the remote device. + * [callback]: Called with the Descriptor object whose value was requested. + * The `value` field of the returned Descriptor object contains the result of + * the read request. + */ + Future readDescriptorValue(String descriptorId) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createDescriptor); + _bluetoothLowEnergy.callMethod('readDescriptorValue', [descriptorId, completer.callback]); + return completer.future; + } + + /** + * Write the value of a specified characteristic descriptor from a remote + * peripheral. This function will fail if the descriptor is local. + * [descriptorId]: The instance ID of the GATT characteristic descriptor whose + * value should be written to. + * [value]: The value that should be sent to the remote descriptor as part of + * the write request. + * [callback]: Called when the write request has completed. + */ + Future writeDescriptorValue(String descriptorId, ArrayBuffer value) { + if (_bluetoothLowEnergy == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothLowEnergy.callMethod('writeDescriptorValue', [descriptorId, jsify(value), completer.callback]); + return completer.future; + } + + void _throwNotAvailable() { + throw new UnsupportedError("'chrome.bluetoothLowEnergy' is not available"); + } +} + +/** + * Values representing the possible properties of a characteristic. + */ +class CharacteristicProperty extends ChromeEnum { + static const CharacteristicProperty BROADCAST = const CharacteristicProperty._('broadcast'); + static const CharacteristicProperty READ = const CharacteristicProperty._('read'); + static const CharacteristicProperty WRITE_WITHOUT_RESPONSE = const CharacteristicProperty._('writeWithoutResponse'); + static const CharacteristicProperty WRITE = const CharacteristicProperty._('write'); + static const CharacteristicProperty NOTIFY = const CharacteristicProperty._('notify'); + static const CharacteristicProperty INDICATE = const CharacteristicProperty._('indicate'); + static const CharacteristicProperty AUTHENTICATED_SIGNED_WRITES = const CharacteristicProperty._('authenticatedSignedWrites'); + static const CharacteristicProperty EXTENDED_PROPERTIES = const CharacteristicProperty._('extendedProperties'); + static const CharacteristicProperty RELIABLE_WRITE = const CharacteristicProperty._('reliableWrite'); + static const CharacteristicProperty WRITABLE_AUXILIARIES = const CharacteristicProperty._('writableAuxiliaries'); + + static const List VALUES = const[BROADCAST, READ, WRITE_WITHOUT_RESPONSE, WRITE, NOTIFY, INDICATE, AUTHENTICATED_SIGNED_WRITES, EXTENDED_PROPERTIES, RELIABLE_WRITE, WRITABLE_AUXILIARIES]; + + const CharacteristicProperty._(String str): super(str); +} + +/** + * Represents a peripheral's Bluetooth GATT Service, a collection of + * characteristics and relationships to other services that encapsulate the + * behavior of part of a device. + */ +class Service extends ChromeObject { + Service({String uuid, bool isPrimary, bool isLocal, String instanceId, String deviceAddress}) { + if (uuid != null) this.uuid = uuid; + if (isPrimary != null) this.isPrimary = isPrimary; + if (isLocal != null) this.isLocal = isLocal; + if (instanceId != null) this.instanceId = instanceId; + if (deviceAddress != null) this.deviceAddress = deviceAddress; + } + Service.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + String get uuid => jsProxy['uuid']; + set uuid(String value) => jsProxy['uuid'] = value; + + bool get isPrimary => jsProxy['isPrimary']; + set isPrimary(bool value) => jsProxy['isPrimary'] = value; + + bool get isLocal => jsProxy['isLocal']; + set isLocal(bool value) => jsProxy['isLocal'] = value; + + String get instanceId => jsProxy['instanceId']; + set instanceId(String value) => jsProxy['instanceId'] = value; + + String get deviceAddress => jsProxy['deviceAddress']; + set deviceAddress(String value) => jsProxy['deviceAddress'] = value; +} + +/** + * Represents a GATT characteristic, which is a basic data element that provides + * further information about a peripheral's service. + */ +class Characteristic extends ChromeObject { + Characteristic({String uuid, bool isLocal, Service service, List properties, String instanceId, ArrayBuffer value}) { + if (uuid != null) this.uuid = uuid; + if (isLocal != null) this.isLocal = isLocal; + if (service != null) this.service = service; + if (properties != null) this.properties = properties; + if (instanceId != null) this.instanceId = instanceId; + if (value != null) this.value = value; + } + Characteristic.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + String get uuid => jsProxy['uuid']; + set uuid(String value) => jsProxy['uuid'] = value; + + bool get isLocal => jsProxy['isLocal']; + set isLocal(bool value) => jsProxy['isLocal'] = value; + + Service get service => _createService(jsProxy['service']); + set service(Service value) => jsProxy['service'] = jsify(value); + + List get properties => listify(jsProxy['properties'], _createCharacteristicProperty); + set properties(List value) => jsProxy['properties'] = jsify(value); + + String get instanceId => jsProxy['instanceId']; + set instanceId(String value) => jsProxy['instanceId'] = value; + + ArrayBuffer get value => _createArrayBuffer(jsProxy['value']); + set value(ArrayBuffer value) => jsProxy['value'] = jsify(value); +} + +/** + * Represents a GATT characteristic descriptor, which provides further + * information about a characteristic's value. + */ +class Descriptor extends ChromeObject { + Descriptor({String uuid, bool isLocal, Characteristic characteristic, String instanceId, ArrayBuffer value}) { + if (uuid != null) this.uuid = uuid; + if (isLocal != null) this.isLocal = isLocal; + if (characteristic != null) this.characteristic = characteristic; + if (instanceId != null) this.instanceId = instanceId; + if (value != null) this.value = value; + } + Descriptor.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + String get uuid => jsProxy['uuid']; + set uuid(String value) => jsProxy['uuid'] = value; + + bool get isLocal => jsProxy['isLocal']; + set isLocal(bool value) => jsProxy['isLocal'] = value; + + Characteristic get characteristic => _createCharacteristic(jsProxy['characteristic']); + set characteristic(Characteristic value) => jsProxy['characteristic'] = jsify(value); + + String get instanceId => jsProxy['instanceId']; + set instanceId(String value) => jsProxy['instanceId'] = value; + + ArrayBuffer get value => _createArrayBuffer(jsProxy['value']); + set value(ArrayBuffer value) => jsProxy['value'] = jsify(value); +} + +/** + * The connection properties specified during a call to [connect]. + */ +class ConnectProperties extends ChromeObject { + ConnectProperties({bool persistent}) { + if (persistent != null) this.persistent = persistent; + } + ConnectProperties.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + bool get persistent => jsProxy['persistent']; + set persistent(bool value) => jsProxy['persistent'] = value; +} + +Service _createService(JsObject jsProxy) => jsProxy == null ? null : new Service.fromProxy(jsProxy); +Characteristic _createCharacteristic(JsObject jsProxy) => jsProxy == null ? null : new Characteristic.fromProxy(jsProxy); +Descriptor _createDescriptor(JsObject jsProxy) => jsProxy == null ? null : new Descriptor.fromProxy(jsProxy); +CharacteristicProperty _createCharacteristicProperty(String value) => CharacteristicProperty.VALUES.singleWhere((ChromeEnum e) => e.value == value); +ArrayBuffer _createArrayBuffer(/*JsObject*/ jsProxy) => jsProxy == null ? null : new ArrayBuffer.fromProxy(jsProxy); diff --git a/lib/gen/bluetooth_socket.dart b/lib/gen/bluetooth_socket.dart new file mode 100644 index 00000000..2c0ce7b1 --- /dev/null +++ b/lib/gen/bluetooth_socket.dart @@ -0,0 +1,430 @@ +/* This file has been generated from bluetooth_socket.idl - do not edit */ + +/** + * Use the `chrome.bluetoothSocket` API to send and receive data to Bluetooth + * devices using RFCOMM and L2CAP connections. + */ +library chrome.bluetoothSocket; + +import '../src/common.dart'; + +/** + * Accessor for the `chrome.bluetoothSocket` namespace. + */ +final ChromeBluetoothSocket bluetoothSocket = new ChromeBluetoothSocket._(); + +class ChromeBluetoothSocket extends ChromeApi { + JsObject get _bluetoothSocket => chrome['bluetoothSocket']; + + Stream get onAccept => _onAccept.stream; + ChromeStreamController _onAccept; + + Stream get onAcceptError => _onAcceptError.stream; + ChromeStreamController _onAcceptError; + + Stream get onReceive => _onReceive.stream; + ChromeStreamController _onReceive; + + Stream get onReceiveError => _onReceiveError.stream; + ChromeStreamController _onReceiveError; + + ChromeBluetoothSocket._() { + var getApi = () => _bluetoothSocket; + _onAccept = new ChromeStreamController.oneArg(getApi, 'onAccept', _createAcceptInfo); + _onAcceptError = new ChromeStreamController.oneArg(getApi, 'onAcceptError', _createAcceptErrorInfo); + _onReceive = new ChromeStreamController.oneArg(getApi, 'onReceive', _createReceiveInfo); + _onReceiveError = new ChromeStreamController.oneArg(getApi, 'onReceiveError', _createReceiveErrorInfo); + } + + bool get available => _bluetoothSocket != null; + + /** + * Creates a Bluetooth socket. + * [properties]: The socket properties (optional). + * [callback]: Called when the socket has been created. + * + * Returns: + * Callback from the `create` method. + * [createInfo]: The result of the socket creation. + */ + Future create([BluetoothSocketProperties properties]) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createCreateInfo); + _bluetoothSocket.callMethod('create', [jsify(properties), completer.callback]); + return completer.future; + } + + /** + * Updates the socket properties. + * [socketId]: The socket identifier. + * [properties]: The properties to update. + * [callback]: Called when the properties are updated. + */ + Future update(int socketId, BluetoothSocketProperties properties) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('update', [socketId, jsify(properties), completer.callback]); + return completer.future; + } + + /** + * Enables or disables a connected socket from receiving messages from its + * peer, or a listening socket from accepting new connections. The default + * value is "false". Pausing a connected socket is typically used by an + * application to throttle data sent by its peer. When a connected socket is + * paused, no `onReceive`event is raised. When a socket is connected and + * un-paused, `onReceive` events are raised again when messages are received. + * When a listening socket is paused, new connections are accepted until its + * backlog is full then additional connection requests are refused. `onAccept` + * events are raised only when the socket is un-paused. + */ + Future setPaused(int socketId, bool paused) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('setPaused', [socketId, paused, completer.callback]); + return completer.future; + } + + /** + * Listen for connections using the RFCOMM protocol. + * [socketId]: The socket identifier. + * [uuid]: Service UUID to listen on. + * [options]: Optional additional options for the service. + * [callback]: Called when listen operation completes. + */ + Future listenUsingRfcomm(int socketId, String uuid, [ListenOptions options]) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('listenUsingRfcomm', [socketId, uuid, jsify(options), completer.callback]); + return completer.future; + } + + /** + * Listen for connections using the L2CAP protocol. + * [socketId]: The socket identifier. + * [uuid]: Service UUID to listen on. + * [options]: Optional additional options for the service. + * [callback]: Called when listen operation completes. + */ + Future listenUsingL2cap(int socketId, String uuid, [ListenOptions options]) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('listenUsingL2cap', [socketId, uuid, jsify(options), completer.callback]); + return completer.future; + } + + /** + * Connects the socket to a remote Bluetooth device. When the `connect` + * operation completes successfully, `onReceive` events are raised when data + * is received from the peer. If a network error occur while the runtime is + * receiving packets, a `onReceiveError` event is raised, at which point no + * more `onReceive` event will be raised for this socket until the + * `setPaused(false)` method is called. + * [socketId]: The socket identifier. + * [address]: The address of the Bluetooth device. + * [uuid]: The UUID of the service to connect to. + * [callback]: Called when the connect attempt is complete. + */ + Future connect(int socketId, String address, String uuid) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('connect', [socketId, address, uuid, completer.callback]); + return completer.future; + } + + /** + * Disconnects the socket. The socket identifier remains valid. + * [socketId]: The socket identifier. + * [callback]: Called when the disconnect attempt is complete. + */ + Future disconnect(int socketId) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('disconnect', [socketId, completer.callback]); + return completer.future; + } + + /** + * Disconnects and destroys the socket. Each socket created should be closed + * after use. The socket id is no longer valid as soon at the function is + * called. However, the socket is guaranteed to be closed only when the + * callback is invoked. + * [socketId]: The socket identifier. + * [callback]: Called when the `close` operation completes. + */ + Future close(int socketId) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _bluetoothSocket.callMethod('close', [socketId, completer.callback]); + return completer.future; + } + + /** + * Sends data on the given Bluetooth socket. + * [socketId]: The socket identifier. + * [data]: The data to send. + * [callback]: Called with the number of bytes sent. + * + * Returns: + * Callback from the `send` method. + * [bytesSent]: The number of bytes sent. + */ + Future send(int socketId, ArrayBuffer data) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(); + _bluetoothSocket.callMethod('send', [socketId, jsify(data), completer.callback]); + return completer.future; + } + + /** + * Retrieves the state of the given socket. + * [socketId]: The socket identifier. + * [callback]: Called when the socket state is available. + * + * Returns: + * Callback from the `getInfo` method. + * [socketInfo]: Object containing the socket information. + */ + Future getInfo(int socketId) { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createSocketInfo); + _bluetoothSocket.callMethod('getInfo', [socketId, completer.callback]); + return completer.future; + } + + /** + * Retrieves the list of currently opened sockets owned by the application. + * [callback]: Called when the list of sockets is available. + * + * Returns: + * Callback from the `getSockets` method. + * [socketInfos]: Array of object containing socket information. + */ + Future> getSockets() { + if (_bluetoothSocket == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createSocketInfo)); + _bluetoothSocket.callMethod('getSockets', [completer.callback]); + return completer.future; + } + + void _throwNotAvailable() { + throw new UnsupportedError("'chrome.bluetoothSocket' is not available"); + } +} + +class AcceptError extends ChromeEnum { + static const AcceptError SYSTEM_ERROR = const AcceptError._('system_error'); + static const AcceptError NOT_LISTENING = const AcceptError._('not_listening'); + + static const List VALUES = const[SYSTEM_ERROR, NOT_LISTENING]; + + const AcceptError._(String str): super(str); +} + +class BluetoothReceiveError extends ChromeEnum { + static const BluetoothReceiveError DISCONNECTED = const BluetoothReceiveError._('disconnected'); + static const BluetoothReceiveError SYSTEM_ERROR = const BluetoothReceiveError._('system_error'); + static const BluetoothReceiveError NOT_CONNECTED = const BluetoothReceiveError._('not_connected'); + + static const List VALUES = const[DISCONNECTED, SYSTEM_ERROR, NOT_CONNECTED]; + + const BluetoothReceiveError._(String str): super(str); +} + +/** + * The socket properties specified in the [create] or [update] function. Each + * property is optional. If a property value is not specified, a default value + * is used when calling [create], or the existing value is preserved when + * calling [update]. + */ +class BluetoothSocketProperties extends ChromeObject { + BluetoothSocketProperties({bool persistent, String name, int bufferSize}) { + if (persistent != null) this.persistent = persistent; + if (name != null) this.name = name; + if (bufferSize != null) this.bufferSize = bufferSize; + } + BluetoothSocketProperties.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + bool get persistent => jsProxy['persistent']; + set persistent(bool value) => jsProxy['persistent'] = value; + + String get name => jsProxy['name']; + set name(String value) => jsProxy['name'] = value; + + int get bufferSize => jsProxy['bufferSize']; + set bufferSize(int value) => jsProxy['bufferSize'] = value; +} + +/** + * Result of `create` call. + */ +class BluetoothCreateInfo extends ChromeObject { + BluetoothCreateInfo({int socketId}) { + if (socketId != null) this.socketId = socketId; + } + BluetoothCreateInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; +} + +/** + * Options that may be passed to the `listenUsingRfcomm` and `listenUsingL2cap` + * methods. Each property is optional with a default being used if not + * specified. + */ +class ListenOptions extends ChromeObject { + ListenOptions({int channel, int psm, int backlog}) { + if (channel != null) this.channel = channel; + if (psm != null) this.psm = psm; + if (backlog != null) this.backlog = backlog; + } + ListenOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get channel => jsProxy['channel']; + set channel(int value) => jsProxy['channel'] = value; + + int get psm => jsProxy['psm']; + set psm(int value) => jsProxy['psm'] = value; + + int get backlog => jsProxy['backlog']; + set backlog(int value) => jsProxy['backlog'] = value; +} + +/** + * Result of the `getInfo` method. + */ +class BluetoothSocketInfo extends ChromeObject { + BluetoothSocketInfo({int socketId, bool persistent, String name, int bufferSize, bool paused, bool connected, String address, String uuid}) { + if (socketId != null) this.socketId = socketId; + if (persistent != null) this.persistent = persistent; + if (name != null) this.name = name; + if (bufferSize != null) this.bufferSize = bufferSize; + if (paused != null) this.paused = paused; + if (connected != null) this.connected = connected; + if (address != null) this.address = address; + if (uuid != null) this.uuid = uuid; + } + BluetoothSocketInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; + + bool get persistent => jsProxy['persistent']; + set persistent(bool value) => jsProxy['persistent'] = value; + + String get name => jsProxy['name']; + set name(String value) => jsProxy['name'] = value; + + int get bufferSize => jsProxy['bufferSize']; + set bufferSize(int value) => jsProxy['bufferSize'] = value; + + bool get paused => jsProxy['paused']; + set paused(bool value) => jsProxy['paused'] = value; + + bool get connected => jsProxy['connected']; + set connected(bool value) => jsProxy['connected'] = value; + + String get address => jsProxy['address']; + set address(String value) => jsProxy['address'] = value; + + String get uuid => jsProxy['uuid']; + set uuid(String value) => jsProxy['uuid'] = value; +} + +/** + * Data from an `onAccept` event. + */ +class BluetoothAcceptInfo extends ChromeObject { + BluetoothAcceptInfo({int socketId, int clientSocketId}) { + if (socketId != null) this.socketId = socketId; + if (clientSocketId != null) this.clientSocketId = clientSocketId; + } + BluetoothAcceptInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; + + int get clientSocketId => jsProxy['clientSocketId']; + set clientSocketId(int value) => jsProxy['clientSocketId'] = value; +} + +/** + * Data from an `onAcceptError` event. + */ +class BluetoothAcceptErrorInfo extends ChromeObject { + BluetoothAcceptErrorInfo({int socketId, String errorMessage, AcceptError error}) { + if (socketId != null) this.socketId = socketId; + if (errorMessage != null) this.errorMessage = errorMessage; + if (error != null) this.error = error; + } + BluetoothAcceptErrorInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; + + String get errorMessage => jsProxy['errorMessage']; + set errorMessage(String value) => jsProxy['errorMessage'] = value; + + AcceptError get error => _createAcceptError(jsProxy['error']); + set error(AcceptError value) => jsProxy['error'] = jsify(value); +} + +/** + * Data from an `onReceive` event. + */ +class BluetoothReceiveInfo extends ChromeObject { + BluetoothReceiveInfo({int socketId, ArrayBuffer data}) { + if (socketId != null) this.socketId = socketId; + if (data != null) this.data = data; + } + BluetoothReceiveInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; + + ArrayBuffer get data => _createArrayBuffer(jsProxy['data']); + set data(ArrayBuffer value) => jsProxy['data'] = jsify(value); +} + +/** + * Data from an `onReceiveError` event. + */ +class BluetoothReceiveErrorInfo extends ChromeObject { + BluetoothReceiveErrorInfo({int socketId, String errorMessage, BluetoothReceiveError error}) { + if (socketId != null) this.socketId = socketId; + if (errorMessage != null) this.errorMessage = errorMessage; + if (error != null) this.error = error; + } + BluetoothReceiveErrorInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get socketId => jsProxy['socketId']; + set socketId(int value) => jsProxy['socketId'] = value; + + String get errorMessage => jsProxy['errorMessage']; + set errorMessage(String value) => jsProxy['errorMessage'] = value; + + BluetoothReceiveError get error => _createReceiveError(jsProxy['error']); + set error(BluetoothReceiveError value) => jsProxy['error'] = jsify(value); +} + +BluetoothAcceptInfo _createAcceptInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothAcceptInfo.fromProxy(jsProxy); +BluetoothAcceptErrorInfo _createAcceptErrorInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothAcceptErrorInfo.fromProxy(jsProxy); +BluetoothReceiveInfo _createReceiveInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothReceiveInfo.fromProxy(jsProxy); +BluetoothReceiveErrorInfo _createReceiveErrorInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothReceiveErrorInfo.fromProxy(jsProxy); +BluetoothCreateInfo _createCreateInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothCreateInfo.fromProxy(jsProxy); +BluetoothSocketInfo _createSocketInfo(JsObject jsProxy) => jsProxy == null ? null : new BluetoothSocketInfo.fromProxy(jsProxy); +AcceptError _createAcceptError(String value) => AcceptError.VALUES.singleWhere((ChromeEnum e) => e.value == value); +ArrayBuffer _createArrayBuffer(/*JsObject*/ jsProxy) => jsProxy == null ? null : new ArrayBuffer.fromProxy(jsProxy); +BluetoothReceiveError _createReceiveError(String value) => BluetoothReceiveError.VALUES.singleWhere((ChromeEnum e) => e.value == value); diff --git a/lib/gen/bookmarks.dart b/lib/gen/bookmarks.dart index d35cda01..29ef812d 100644 --- a/lib/gen/bookmarks.dart +++ b/lib/gen/bookmarks.dart @@ -154,13 +154,14 @@ class ChromeBookmarks extends ChromeApi { } /** - * Searches for BookmarkTreeNodes matching the given query. + * Searches for BookmarkTreeNodes matching the given query. Queries specified + * with an object produce BookmarkTreeNodes matching all specified properties. */ - Future> search(String query) { + Future> search(dynamic query) { if (_bookmarks == null) _throwNotAvailable(); var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createBookmarkTreeNode)); - _bookmarks.callMethod('search', [query, completer.callback]); + _bookmarks.callMethod('search', [jsify(query), completer.callback]); return completer.future; } diff --git a/lib/gen/browser.dart b/lib/gen/browser.dart index c4a6bdfc..f7e9d3e9 100644 --- a/lib/gen/browser.dart +++ b/lib/gen/browser.dart @@ -25,7 +25,7 @@ class ChromeBrowser extends ChromeApi { * and Chrome profile. If no browser window for the Chrome profile is opened, * a new one is opened prior to creating the new tab. The initial URL of the * new tab is specified in [options]. - * [options]: The $(ref:OpenTabOptions) for this function. + * [options]: The [OpenTabOptions] for this function. * [callback]: Called to indicate success or failure. */ Future openTab(OpenTabOptions options) { @@ -42,7 +42,7 @@ class ChromeBrowser extends ChromeApi { } /** - * Options for the $(ref:openTab) function. + * Options for the [openTab] function. */ class OpenTabOptions extends ChromeObject { OpenTabOptions({String url}) { diff --git a/lib/gen/browser_action.dart b/lib/gen/browser_action.dart index fd84ce00..cf1f15c2 100644 --- a/lib/gen/browser_action.dart +++ b/lib/gen/browser_action.dart @@ -2,9 +2,9 @@ /** * Use browser actions to put icons in the main Google Chrome toolbar, to the - * right of the address bar. In addition to its [icon](#icon), a browser action - * can also have a [tooltip](#tooltip), a [badge](#badge), and a popup. + * right of the address bar. In addition to its [icon](browserAction#icon), a + * browser action can also have a [tooltip](browserAction#tooltip), a + * [badge](browserAction#badge), and a [popup](browserAction#popups). */ library chrome.browserAction; diff --git a/lib/gen/content_settings.dart b/lib/gen/content_settings.dart index 4a30f8a5..c4be2aac 100644 --- a/lib/gen/content_settings.dart +++ b/lib/gen/content_settings.dart @@ -77,7 +77,7 @@ class ChromeContentSettings extends ChromeApi { /** * The only content type using resource identifiers is - * [contentSettings.plugins.] For more information, see [Resource + * [contentSettings.plugins]. For more information, see [Resource * Identifiers](contentSettings.html#resource-identifiers). */ class ResourceIdentifier extends ChromeObject { diff --git a/lib/gen/declarative_content.dart b/lib/gen/declarative_content.dart index f04ce1e4..db2c0138 100644 --- a/lib/gen/declarative_content.dart +++ b/lib/gen/declarative_content.dart @@ -62,10 +62,10 @@ class PageStateMatcher extends ChromeObject { } /** - * Declarative event action that shows the extension's [][pageAction page - * action] while the corresponding conditions are met. This action can be used - * without [host permissions](declare_permissions.html#host-permission), but the - * extension must have a page action. If the extension takes the + * 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](declare_permissions.html#host-permissions), but + * the extension must have a page action. If the extension takes the * [activeTab](activeTab.html) permission, a click on the page action will grant * access to the active tab. */ diff --git a/lib/gen/downloads.dart b/lib/gen/downloads.dart index 9e6a5c9f..e83d86c2 100644 --- a/lib/gen/downloads.dart +++ b/lib/gen/downloads.dart @@ -293,6 +293,7 @@ class InterruptReason extends ChromeEnum { static const InterruptReason NETWORK_TIMEOUT = const InterruptReason._('NETWORK_TIMEOUT'); static const InterruptReason NETWORK_DISCONNECTED = const InterruptReason._('NETWORK_DISCONNECTED'); static const InterruptReason NETWORK_SERVER_DOWN = const InterruptReason._('NETWORK_SERVER_DOWN'); + static const InterruptReason NETWORK_INVALID_REQUEST = const InterruptReason._('NETWORK_INVALID_REQUEST'); static const InterruptReason SERVER_FAILED = const InterruptReason._('SERVER_FAILED'); static const InterruptReason SERVER_NO_RANGE = const InterruptReason._('SERVER_NO_RANGE'); static const InterruptReason SERVER_PRECONDITION = const InterruptReason._('SERVER_PRECONDITION'); @@ -301,7 +302,7 @@ class InterruptReason extends ChromeEnum { static const InterruptReason USER_SHUTDOWN = const InterruptReason._('USER_SHUTDOWN'); static const InterruptReason CRASH = const InterruptReason._('CRASH'); - static const List VALUES = const[FILE_FAILED, FILE_ACCESS_DENIED, FILE_NO_SPACE, FILE_NAME_TOO_LONG, FILE_TOO_LARGE, FILE_VIRUS_INFECTED, FILE_TRANSIENT_ERROR, FILE_BLOCKED, FILE_SECURITY_CHECK_FAILED, FILE_TOO_SHORT, NETWORK_FAILED, NETWORK_TIMEOUT, NETWORK_DISCONNECTED, NETWORK_SERVER_DOWN, SERVER_FAILED, SERVER_NO_RANGE, SERVER_PRECONDITION, SERVER_BAD_CONTENT, USER_CANCELED, USER_SHUTDOWN, CRASH]; + static const List VALUES = const[FILE_FAILED, FILE_ACCESS_DENIED, FILE_NO_SPACE, FILE_NAME_TOO_LONG, FILE_TOO_LARGE, FILE_VIRUS_INFECTED, FILE_TRANSIENT_ERROR, FILE_BLOCKED, FILE_SECURITY_CHECK_FAILED, FILE_TOO_SHORT, NETWORK_FAILED, NETWORK_TIMEOUT, NETWORK_DISCONNECTED, NETWORK_SERVER_DOWN, NETWORK_INVALID_REQUEST, SERVER_FAILED, SERVER_NO_RANGE, SERVER_PRECONDITION, SERVER_BAD_CONTENT, USER_CANCELED, USER_SHUTDOWN, CRASH]; const InterruptReason._(String str): super(str); } @@ -415,7 +416,7 @@ class DownloadOptions extends ChromeObject { * The state of the process of downloading a file. */ class DownloadItem extends ChromeObject { - DownloadItem({int id, String url, String referrer, String filename, bool incognito, DangerType danger, String mime, String startTime, String endTime, String estimatedEndTime, State state, bool paused, bool canResume, InterruptReason error, int bytesReceived, int totalBytes, int fileSize, bool exists, String byExtensionId, String byExtensionName}) { + DownloadItem({int id, String url, String referrer, String filename, bool incognito, DangerType danger, String mime, String startTime, String endTime, String estimatedEndTime, State state, bool paused, bool canResume, InterruptReason error, num bytesReceived, num totalBytes, num fileSize, bool exists, String byExtensionId, String byExtensionName}) { if (id != null) this.id = id; if (url != null) this.url = url; if (referrer != null) this.referrer = referrer; @@ -481,14 +482,14 @@ class DownloadItem extends ChromeObject { InterruptReason get error => _createInterruptReason(jsProxy['error']); set error(InterruptReason value) => jsProxy['error'] = jsify(value); - int get bytesReceived => jsProxy['bytesReceived']; - set bytesReceived(int value) => jsProxy['bytesReceived'] = value; + num get bytesReceived => jsProxy['bytesReceived']; + set bytesReceived(num value) => jsProxy['bytesReceived'] = jsify(value); - int get totalBytes => jsProxy['totalBytes']; - set totalBytes(int value) => jsProxy['totalBytes'] = value; + num get totalBytes => jsProxy['totalBytes']; + set totalBytes(num value) => jsProxy['totalBytes'] = jsify(value); - int get fileSize => jsProxy['fileSize']; - set fileSize(int value) => jsProxy['fileSize'] = value; + num get fileSize => jsProxy['fileSize']; + set fileSize(num value) => jsProxy['fileSize'] = jsify(value); bool get exists => jsProxy['exists']; set exists(bool value) => jsProxy['exists'] = value; @@ -501,7 +502,7 @@ class DownloadItem extends ChromeObject { } class DownloadQuery extends ChromeObject { - DownloadQuery({List query, String startedBefore, String startedAfter, String endedBefore, String endedAfter, int totalBytesGreater, int totalBytesLess, String filenameRegex, String urlRegex, int limit, List orderBy, int id, String url, String filename, DangerType danger, String mime, String startTime, String endTime, State state, bool paused, InterruptReason error, int bytesReceived, int totalBytes, int fileSize, bool exists}) { + DownloadQuery({List query, String startedBefore, String startedAfter, String endedBefore, String endedAfter, num totalBytesGreater, num totalBytesLess, String filenameRegex, String urlRegex, int limit, List orderBy, int id, String url, String filename, DangerType danger, String mime, String startTime, String endTime, State state, bool paused, InterruptReason error, num bytesReceived, num totalBytes, num fileSize, bool exists}) { if (query != null) this.query = query; if (startedBefore != null) this.startedBefore = startedBefore; if (startedAfter != null) this.startedAfter = startedAfter; @@ -545,11 +546,11 @@ class DownloadQuery extends ChromeObject { String get endedAfter => jsProxy['endedAfter']; set endedAfter(String value) => jsProxy['endedAfter'] = value; - int get totalBytesGreater => jsProxy['totalBytesGreater']; - set totalBytesGreater(int value) => jsProxy['totalBytesGreater'] = value; + num get totalBytesGreater => jsProxy['totalBytesGreater']; + set totalBytesGreater(num value) => jsProxy['totalBytesGreater'] = jsify(value); - int get totalBytesLess => jsProxy['totalBytesLess']; - set totalBytesLess(int value) => jsProxy['totalBytesLess'] = value; + num get totalBytesLess => jsProxy['totalBytesLess']; + set totalBytesLess(num value) => jsProxy['totalBytesLess'] = jsify(value); String get filenameRegex => jsProxy['filenameRegex']; set filenameRegex(String value) => jsProxy['filenameRegex'] = value; @@ -593,14 +594,14 @@ class DownloadQuery extends ChromeObject { InterruptReason get error => _createInterruptReason(jsProxy['error']); set error(InterruptReason value) => jsProxy['error'] = jsify(value); - int get bytesReceived => jsProxy['bytesReceived']; - set bytesReceived(int value) => jsProxy['bytesReceived'] = value; + num get bytesReceived => jsProxy['bytesReceived']; + set bytesReceived(num value) => jsProxy['bytesReceived'] = jsify(value); - int get totalBytes => jsProxy['totalBytes']; - set totalBytes(int value) => jsProxy['totalBytes'] = value; + num get totalBytes => jsProxy['totalBytes']; + set totalBytes(num value) => jsProxy['totalBytes'] = jsify(value); - int get fileSize => jsProxy['fileSize']; - set fileSize(int value) => jsProxy['fileSize'] = value; + num get fileSize => jsProxy['fileSize']; + set fileSize(num value) => jsProxy['fileSize'] = jsify(value); bool get exists => jsProxy['exists']; set exists(bool value) => jsProxy['exists'] = value; @@ -620,18 +621,18 @@ class StringDelta extends ChromeObject { set current(String value) => jsProxy['current'] = value; } -class LongDelta extends ChromeObject { - LongDelta({int previous, int current}) { +class DoubleDelta extends ChromeObject { + DoubleDelta({num previous, num current}) { if (previous != null) this.previous = previous; if (current != null) this.current = current; } - LongDelta.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + DoubleDelta.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - int get previous => jsProxy['previous']; - set previous(int value) => jsProxy['previous'] = value; + num get previous => jsProxy['previous']; + set previous(num value) => jsProxy['previous'] = jsify(value); - int get current => jsProxy['current']; - set current(int value) => jsProxy['current'] = value; + num get current => jsProxy['current']; + set current(num value) => jsProxy['current'] = jsify(value); } class BooleanDelta extends ChromeObject { @@ -652,7 +653,7 @@ class BooleanDelta extends ChromeObject { * Encapsulates a change in a DownloadItem. */ class DownloadDelta extends ChromeObject { - DownloadDelta({int id, StringDelta url, StringDelta filename, StringDelta danger, StringDelta mime, StringDelta startTime, StringDelta endTime, StringDelta state, BooleanDelta canResume, BooleanDelta paused, StringDelta error, LongDelta totalBytes, LongDelta fileSize, BooleanDelta exists}) { + DownloadDelta({int id, StringDelta url, StringDelta filename, StringDelta danger, StringDelta mime, StringDelta startTime, StringDelta endTime, StringDelta state, BooleanDelta canResume, BooleanDelta paused, StringDelta error, DoubleDelta totalBytes, DoubleDelta fileSize, BooleanDelta exists}) { if (id != null) this.id = id; if (url != null) this.url = url; if (filename != null) this.filename = filename; @@ -703,11 +704,11 @@ class DownloadDelta extends ChromeObject { StringDelta get error => _createStringDelta(jsProxy['error']); set error(StringDelta value) => jsProxy['error'] = jsify(value); - LongDelta get totalBytes => _createLongDelta(jsProxy['totalBytes']); - set totalBytes(LongDelta value) => jsProxy['totalBytes'] = jsify(value); + DoubleDelta get totalBytes => _createDoubleDelta(jsProxy['totalBytes']); + set totalBytes(DoubleDelta value) => jsProxy['totalBytes'] = jsify(value); - LongDelta get fileSize => _createLongDelta(jsProxy['fileSize']); - set fileSize(LongDelta value) => jsProxy['fileSize'] = jsify(value); + DoubleDelta get fileSize => _createDoubleDelta(jsProxy['fileSize']); + set fileSize(DoubleDelta value) => jsProxy['fileSize'] = jsify(value); BooleanDelta get exists => _createBooleanDelta(jsProxy['exists']); set exists(BooleanDelta value) => jsProxy['exists'] = jsify(value); @@ -735,5 +736,5 @@ State _createState(String value) => State.VALUES.singleWhere((ChromeEnum e) => e InterruptReason _createInterruptReason(String value) => InterruptReason.VALUES.singleWhere((ChromeEnum e) => e.value == value); StringDelta _createStringDelta(JsObject jsProxy) => jsProxy == null ? null : new StringDelta.fromProxy(jsProxy); BooleanDelta _createBooleanDelta(JsObject jsProxy) => jsProxy == null ? null : new BooleanDelta.fromProxy(jsProxy); -LongDelta _createLongDelta(JsObject jsProxy) => jsProxy == null ? null : new LongDelta.fromProxy(jsProxy); +DoubleDelta _createDoubleDelta(JsObject jsProxy) => jsProxy == null ? null : new DoubleDelta.fromProxy(jsProxy); SuggestFilenameCallback _createSuggestFilenameCallback(JsObject jsProxy) => jsProxy == null ? null : new SuggestFilenameCallback.fromProxy(jsProxy); diff --git a/lib/gen/events.dart b/lib/gen/events.dart index 6718e3d8..c56eab2c 100644 --- a/lib/gen/events.dart +++ b/lib/gen/events.dart @@ -1,7 +1,8 @@ /* This file has been generated from events.json - do not edit */ /** - * Use the `chrome.events` API to notify you when something interesting happens. + * The `chrome.events` namespace contains common types used by APIs dispatching + * events to notify you when something interesting happens. */ library chrome.events; @@ -107,15 +108,18 @@ class ChromeEvent extends ChromeObject { * * [eventName] Name of the event this function affects. * + * [webViewInstanceId] If provided, this is an integer that uniquely identfies + * the associated with this function call. + * * [rules] Rules to be registered. These do not replace previously registered * rules. * * Returns: * Rules that were registered, the optional parameters are filled with values. */ - Future> addRules(String eventName, List rules) { + Future> addRules(String eventName, int webViewInstanceId, List rules) { var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createRule)); - jsProxy.callMethod('addRules', [eventName, jsify(rules), completer.callback]); + jsProxy.callMethod('addRules', [eventName, webViewInstanceId, jsify(rules), completer.callback]); return completer.future; } @@ -124,15 +128,18 @@ class ChromeEvent extends ChromeObject { * * [eventName] Name of the event this function affects. * + * [webViewInstanceId] If provided, this is an integer that uniquely identfies + * the associated with this function call. + * * [ruleIdentifiers] If an array is passed, only rules with identifiers * contained in this array are returned. * * Returns: * Rules that were registered, the optional parameters are filled with values. */ - Future> getRules(String eventName, [List ruleIdentifiers]) { + Future> getRules(String eventName, int webViewInstanceId, [List ruleIdentifiers]) { var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createRule)); - jsProxy.callMethod('getRules', [eventName, jsify(ruleIdentifiers), completer.callback]); + jsProxy.callMethod('getRules', [eventName, webViewInstanceId, jsify(ruleIdentifiers), completer.callback]); return completer.future; } @@ -141,12 +148,15 @@ class ChromeEvent extends ChromeObject { * * [eventName] Name of the event this function affects. * + * [webViewInstanceId] If provided, this is an integer that uniquely identfies + * the associated with this function call. + * * [ruleIdentifiers] If an array is passed, only rules with identifiers * contained in this array are unregistered. */ - Future removeRules(String eventName, [List ruleIdentifiers]) { + Future removeRules(String eventName, int webViewInstanceId, [List ruleIdentifiers]) { var completer = new ChromeCompleter.noArgs(); - jsProxy.callMethod('removeRules', [eventName, jsify(ruleIdentifiers), completer.callback]); + jsProxy.callMethod('removeRules', [eventName, webViewInstanceId, jsify(ruleIdentifiers), completer.callback]); return completer.future; } } diff --git a/lib/gen/extension.dart b/lib/gen/extension.dart index d3804f1c..0df24c66 100644 --- a/lib/gen/extension.dart +++ b/lib/gen/extension.dart @@ -21,13 +21,14 @@ class ChromeExtension extends ChromeApi { JsObject get _extension => chrome['extension']; /** - * Deprecated: please use onMessage. + * Fired when a request is sent from either an extension process or a content + * script. */ Stream get onRequest => _onRequest.stream; ChromeStreamController _onRequest; /** - * Deprecated: please use onMessageExternal. + * Fired when a request is sent from another extension. */ Stream get onRequestExternal => _onRequestExternal.stream; ChromeStreamController _onRequestExternal; @@ -55,7 +56,10 @@ class ChromeExtension extends ChromeApi { bool get inIncognitoContext => _extension['inIncognitoContext']; /** - * Deprecated: Please use sendMessage. + * Sends a single request to other listeners within the extension. Similar to + * [runtime.connect], but only sends a single request with an optional + * response. The [extension.onRequest] event is fired in each page of the + * extension. * * [extensionId] The extension ID of the extension you want to connect to. If * omitted, default is your own extension. @@ -115,10 +119,9 @@ class ChromeExtension extends ChromeApi { } /** - * Deprecated. Please use getViews({type: 'TAB'}). Returns an array of the - * JavaScript 'window' objects for each of the tabs running inside the current - * extension. If windowId is specified, returns only the 'window' objects of - * tabs attached to the specified window. + * Returns an array of the JavaScript 'window' objects for each of the tabs + * running inside the current extension. If `windowId` is specified, returns + * only the 'window' objects of tabs attached to the specified window. * * Returns: * Array of global window objects @@ -177,7 +180,8 @@ class ChromeExtension extends ChromeApi { } /** - * Deprecated: please use onMessage. + * Fired when a request is sent from either an extension process or a content + * script. */ class OnRequestEvent { /** @@ -202,7 +206,7 @@ class OnRequestEvent { } /** - * Deprecated: please use onMessageExternal. + * Fired when a request is sent from another extension. */ class OnRequestExternalEvent { /** diff --git a/lib/gen/gcm.dart b/lib/gen/gcm.dart index 8d7e50df..0c18485d 100644 --- a/lib/gen/gcm.dart +++ b/lib/gen/gcm.dart @@ -2,8 +2,8 @@ /** * Use `chrome.gcm` to enable apps and extensions to send and receive messages - * through [Google Cloud Messaging for - * Android](http://developer.android.com/google/gcm/index.html). + * through [Google Cloud + * Messaging](http://developer.android.com/google/gcm/index.html). */ library chrome.gcm; @@ -24,9 +24,10 @@ class ChromeGcm extends ChromeApi { ChromeStreamController _onMessage; /** - * Fired when a GCM server had to delete messages to the application from its - * queue in order to manage its size. The app is expected to handle that case - * gracefully, e.g. by running a full sync with its server. + * Fired when a GCM server had to delete messages sent by an app server to the + * application. See [Messages deleted + * event](cloudMessagingV2#messages_deleted_event) section of Cloud Messaging + * documentation for details on handling this event. */ Stream get onMessagesDeleted => _onMessagesDeleted.stream; ChromeStreamController _onMessagesDeleted; @@ -71,6 +72,17 @@ class ChromeGcm extends ChromeApi { return completer.future; } + /** + * Unregisters the application from GCM. + */ + Future unregister() { + if (_gcm == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _gcm.callMethod('unregister', [completer.callback]); + return completer.future; + } + /** * Sends a message according to its contents. * @@ -109,25 +121,28 @@ class GcmSendParams extends ChromeObject { set destinationId(String value) => jsProxy['destinationId'] = value; /** - * The ID of the message. It must be unique for each message. + * The ID of the message. It must be unique for each message in scope of the + * applications. See the [Cloud Messaging + * documentation](cloudMessagingV2#send_messages) for advice for picking and + * handling an ID. */ String get messageId => jsProxy['messageId']; set messageId(String value) => jsProxy['messageId'] = value; /** * Time-to-live of the message in seconds. If it is not possible to send the - * message wihtin that time an error will be raised. A time-to-live of 0 - * indicates that the message should be sent immediately or fail if it's not - * possible. The maximum and a default value of time-to-live is 2419200 - * seconds (4 weeks). + * message within that time, an onSendError event will be raised. A + * time-to-live of 0 indicates that the message should be sent immediately or + * fail if it's not possible. The maximum and a default value of time-to-live + * is 2419200 seconds (4 weeks). */ int get timeToLive => jsProxy['timeToLive']; set timeToLive(int value) => jsProxy['timeToLive'] = value; /** - * Message data to send to the server. `goog.` and `google` are disallowed as - * key prefixes. Sum of all key/value pairs should not exceed - * [MAX_MESSAGE_SIZE.] + * Message data to send to the server. Case-insensitive `goog.` and `google`, + * as well as case-sensitive `collapse_key` are disallowed as key prefixes. + * Sum of all key/value pairs should not exceed [gcm.MAX_MESSAGE_SIZE]. */ Map get data => mapify(jsProxy['data']); set data(Map value) => jsProxy['data'] = jsify(value); diff --git a/lib/gen/hid.dart b/lib/gen/hid.dart new file mode 100644 index 00000000..f1d61c65 --- /dev/null +++ b/lib/gen/hid.dart @@ -0,0 +1,203 @@ +/* This file has been generated from hid.idl - do not edit */ + +/** + * Use the `chrome.hid` API to interact with connected HID devices. This API + * provides access to HID operations from within the context of an app. Using + * this API, apps can function as drivers for hardware devices. + */ +library chrome.hid; + +import '../src/common.dart'; + +/** + * Accessor for the `chrome.hid` namespace. + */ +final ChromeHid hid = new ChromeHid._(); + +class ChromeHid extends ChromeApi { + JsObject get _hid => chrome['hid']; + + ChromeHid._(); + + bool get available => _hid != null; + + /** + * Enumerate all the connected HID devices specified by the vendorId/ + * productId/interfaceId tuple. + * [options]: The properties to search for on target devices. + * [callback]: Invoked with the `HidDeviceInfo` array on success. + */ + Future> getDevices(HidGetDevicesOptions options) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createHidDeviceInfo)); + _hid.callMethod('getDevices', [jsify(options), completer.callback]); + return completer.future; + } + + /** + * Open a connection to an HID device for communication. + * [deviceId]: The ID of the device to open. + * [callback]: Invoked with an `HidConnectInfo`. + */ + Future connect(int deviceId) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createHidConnectInfo); + _hid.callMethod('connect', [deviceId, completer.callback]); + return completer.future; + } + + /** + * Disconnect from a device. Invoking operations on a device after calling + * this is safe but has no effect. + * [connectionId]: The connection to close. + * [callback]: The callback to invoke once the device is closed. + */ + Future disconnect(int connectionId) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _hid.callMethod('disconnect', [connectionId, completer.callback]); + return completer.future; + } + + /** + * Receive an Input report from an HID device. + * + * Input reports are returned to the host through the INTERRUPT IN endpoint. + * [connectionId]: The connection from which to receive a report. + * [size]: The size of the Input report to receive. + * [callback]: The callback to invoke with received report. + * + * Returns: + * The callback to be invoked when a `receive` or `receiveFeatureReport` call + * is finished. + * [data]: The content of the report. + */ + Future receive(int connectionId, int size) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createArrayBuffer); + _hid.callMethod('receive', [connectionId, size, completer.callback]); + return completer.future; + } + + /** + * Send an Output report to an HID device. `send` will send the data on the + * first OUT endpoint, if one exists. If one does not exist, the report will + * be sent through the Control endpoint. + * + * [connectionId]: The connection to which to send a report. + * [reportId]: The report ID to use, or `0` if none. + * [data]: The report data. + * [callback]: The callback to invoke once the write is finished. + */ + Future send(int connectionId, int reportId, ArrayBuffer data) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _hid.callMethod('send', [connectionId, reportId, jsify(data), completer.callback]); + return completer.future; + } + + /** + * Receive a Feature report from the device. + * + * [connectionId]: The connection to read Input report from. + * [reportId]: The report ID, or zero if none. + * [size]: The size of the Feature report to receive. + * [callback]: The callback to invoke once the write is finished. + * + * Returns: + * The callback to be invoked when a `receive` or `receiveFeatureReport` call + * is finished. + * [data]: The content of the report. + */ + Future receiveFeatureReport(int connectionId, int reportId, int size) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createArrayBuffer); + _hid.callMethod('receiveFeatureReport', [connectionId, reportId, size, completer.callback]); + return completer.future; + } + + /** + * Send a Feature report to the device. + * + * Feature reports are sent over the Control endpoint as a Set_Report + * transfer. + * [connectionId]: The connection to read Input report from. + * [reportId]: The report ID to use, or `0` if none. + * [data]: The report data. + * [callback]: The callback to invoke once the write is finished. + */ + Future sendFeatureReport(int connectionId, int reportId, ArrayBuffer data) { + if (_hid == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _hid.callMethod('sendFeatureReport', [connectionId, reportId, jsify(data), completer.callback]); + return completer.future; + } + + void _throwNotAvailable() { + throw new UnsupportedError("'chrome.hid' is not available"); + } +} + +/** + * Returned by `getDevices` functions to describes a connected HID device. Use + * `connect` to connect to any of the returned devices. + */ +class HidDeviceInfo extends ChromeObject { + HidDeviceInfo({int deviceId, int vendorId, int productId}) { + if (deviceId != null) this.deviceId = deviceId; + if (vendorId != null) this.vendorId = vendorId; + if (productId != null) this.productId = productId; + } + HidDeviceInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get deviceId => jsProxy['deviceId']; + set deviceId(int value) => jsProxy['deviceId'] = value; + + int get vendorId => jsProxy['vendorId']; + set vendorId(int value) => jsProxy['vendorId'] = value; + + int get productId => jsProxy['productId']; + set productId(int value) => jsProxy['productId'] = value; +} + +/** + * Returned by `connect` to represent a communication session with an HID + * device. Must be closed with a call to `disconnect`. + */ +class HidConnectInfo extends ChromeObject { + HidConnectInfo({int connectionId}) { + if (connectionId != null) this.connectionId = connectionId; + } + HidConnectInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get connectionId => jsProxy['connectionId']; + set connectionId(int value) => jsProxy['connectionId'] = value; +} + +/** + * Searching criteria to enumerate devices with. + */ +class HidGetDevicesOptions extends ChromeObject { + HidGetDevicesOptions({int vendorId, int productId}) { + if (vendorId != null) this.vendorId = vendorId; + if (productId != null) this.productId = productId; + } + HidGetDevicesOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + int get vendorId => jsProxy['vendorId']; + set vendorId(int value) => jsProxy['vendorId'] = value; + + int get productId => jsProxy['productId']; + set productId(int value) => jsProxy['productId'] = value; +} + +HidDeviceInfo _createHidDeviceInfo(JsObject jsProxy) => jsProxy == null ? null : new HidDeviceInfo.fromProxy(jsProxy); +HidConnectInfo _createHidConnectInfo(JsObject jsProxy) => jsProxy == null ? null : new HidConnectInfo.fromProxy(jsProxy); +ArrayBuffer _createArrayBuffer(/*JsObject*/ jsProxy) => jsProxy == null ? null : new ArrayBuffer.fromProxy(jsProxy); diff --git a/lib/gen/i18n.dart b/lib/gen/i18n.dart index 751902ba..6a2d5e4d 100644 --- a/lib/gen/i18n.dart +++ b/lib/gen/i18n.dart @@ -22,7 +22,7 @@ class ChromeI18N extends ChromeApi { /** * Gets the accept-languages of the browser. This is different from the locale - * used by the browser; to get the locale, use `window.navigator.language`. + * used by the browser; to get the locale, use [i18n.getUILanguage]. * * Returns: * Array of the accept languages of the browser, such as en-US,en,zh-CN @@ -56,6 +56,19 @@ class ChromeI18N extends ChromeApi { return _i18n.callMethod('getMessage', [messageName, jsify(substitutions)]); } + /** + * Gets the browser UI language of the browser. This is different from + * [i18n.getAcceptLanguages] which returns the preferred user languages. + * + * Returns: + * The browser UI language code such as en-US or fr-FR. + */ + String getUILanguage() { + if (_i18n == null) _throwNotAvailable(); + + return _i18n.callMethod('getUILanguage'); + } + void _throwNotAvailable() { throw new UnsupportedError("'chrome.i18n' is not available"); } diff --git a/lib/gen/identity.dart b/lib/gen/identity.dart index cd622499..62fc5ab1 100644 --- a/lib/gen/identity.dart +++ b/lib/gen/identity.dart @@ -84,6 +84,20 @@ class ChromeIdentity extends ChromeApi { return completer.future; } + /** + * Generates a redirect URL to be used in [launchWebAuthFlow]. + * + * The generated URLs match the pattern + * `https://<app-id>.chromiumapp.org/`. + * + * [path]: The path appended to the end of the generated URL. + */ + String getRedirectURL([String path]) { + if (_identity == null) _throwNotAvailable(); + + return _identity.callMethod('getRedirectURL', [path]); + } + void _throwNotAvailable() { throw new UnsupportedError("'chrome.identity' is not available"); } diff --git a/lib/gen/input.dart b/lib/gen/input.dart index 9ce29a80..95bd8b91 100644 --- a/lib/gen/input.dart +++ b/lib/gen/input.dart @@ -142,9 +142,32 @@ class ChromeInputIme extends ChromeApi { return completer.future; } + /** + * Sends the key events. This function is expected to be used by virtual + * keyboards. When key(s) on a virtual keyboard is pressed by a user, this + * function is used to propagate that event to the system. + */ + Future sendKeyEvents(InputImeSendKeyEventsParams parameters) { + if (_input_ime == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.noArgs(); + _input_ime.callMethod('sendKeyEvents', [jsify(parameters), completer.callback]); + return completer.future; + } + + /** + * Hides the input view window, which is popped up automatically by system. If + * the input view window is already hidden, this function will do nothing. + */ + void hideInputView() { + if (_input_ime == null) _throwNotAvailable(); + + _input_ime.callMethod('hideInputView'); + } + /** * Sets the properties of the candidate window. This fails if the extension - * doesn’t own the active IME + * doesn't own the active IME */ Future setCandidateWindowProperties(InputImeSetCandidateWindowPropertiesParams parameters) { if (_input_ime == null) _throwNotAvailable(); @@ -155,7 +178,7 @@ class ChromeInputIme extends ChromeApi { } /** - * Sets the current candidate list. This fails if this extension doesn’t own + * Sets the current candidate list. This fails if this extension doesn't own * the active IME */ Future setCandidates(InputImeSetCandidatesParams parameters) { @@ -390,9 +413,10 @@ class UsageInputIme extends ChromeObject { * See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */ class KeyboardEvent extends ChromeObject { - KeyboardEvent({String type, String requestId, String key, String code, bool altKey, bool ctrlKey, bool shiftKey, bool capsLock}) { + KeyboardEvent({String type, String requestId, String extensionId, String key, String code, bool altKey, bool ctrlKey, bool shiftKey, bool capsLock}) { if (type != null) this.type = type; if (requestId != null) this.requestId = requestId; + if (extensionId != null) this.extensionId = extensionId; if (key != null) this.key = key; if (code != null) this.code = code; if (altKey != null) this.altKey = altKey; @@ -415,6 +439,12 @@ class KeyboardEvent extends ChromeObject { String get requestId => jsProxy['requestId']; set requestId(String value) => jsProxy['requestId'] = value; + /** + * The extension ID of the sender of this keyevent. + */ + String get extensionId => jsProxy['extensionId']; + set extensionId(String value) => jsProxy['extensionId'] = value; + /** * Value of the key being pressed */ @@ -471,8 +501,8 @@ class InputContext extends ChromeObject { set contextID(int value) => jsProxy['contextID'] = value; /** - * Type of value this text field edits, (Text, Number, Password, etc) - * enum of `text`, `number`, `password` + * Type of value this text field edits, (Text, Number, URL, etc) + * enum of `text`, `search`, `tel`, `url`, `email`, `number` */ String get type => jsProxy['type']; set type(String value) => jsProxy['type'] = value; @@ -613,6 +643,27 @@ class InputImeCommitTextParams extends ChromeObject { set text(String value) => jsProxy['text'] = value; } +class InputImeSendKeyEventsParams extends ChromeObject { + InputImeSendKeyEventsParams({int contextID, List keyData}) { + if (contextID != null) this.contextID = contextID; + if (keyData != null) this.keyData = keyData; + } + InputImeSendKeyEventsParams.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + /** + * ID of the context where the key events will be sent, or zero to send key + * events to non-input field. + */ + int get contextID => jsProxy['contextID']; + set contextID(int value) => jsProxy['contextID'] = value; + + /** + * Data on the key event. + */ + List get keyData => listify(jsProxy['keyData'], _createKeyboardEvent); + set keyData(List value) => jsProxy['keyData'] = jsify(value); +} + class InputImeSetCandidateWindowPropertiesParams extends ChromeObject { InputImeSetCandidateWindowPropertiesParams({String engineID, PropertiesInputIme properties}) { if (engineID != null) this.engineID = engineID; @@ -754,6 +805,6 @@ OnMenuItemActivatedEvent _createOnMenuItemActivatedEvent(String engineID, String new OnMenuItemActivatedEvent(engineID, name); OnSurroundingTextChangedEvent _createOnSurroundingTextChangedEvent(String engineID, JsObject surroundingInfo) => new OnSurroundingTextChangedEvent(engineID, mapify(surroundingInfo)); +KeyboardEvent _createKeyboardEvent(JsObject jsProxy) => jsProxy == null ? null : new KeyboardEvent.fromProxy(jsProxy); PropertiesInputIme _createPropertiesInputIme(JsObject jsProxy) => jsProxy == null ? null : new PropertiesInputIme.fromProxy(jsProxy); MenuItem _createMenuItem(JsObject jsProxy) => jsProxy == null ? null : new MenuItem.fromProxy(jsProxy); -KeyboardEvent _createKeyboardEvent(JsObject jsProxy) => jsProxy == null ? null : new KeyboardEvent.fromProxy(jsProxy); diff --git a/lib/gen/management.dart b/lib/gen/management.dart index 09398c69..709bdfa1 100644 --- a/lib/gen/management.dart +++ b/lib/gen/management.dart @@ -66,7 +66,7 @@ class ChromeManagement extends ChromeApi { * Returns information about the installed extension, app, or theme that has * the given ID. * - * [id] The ID from an item of [ExtensionInfo.] + * [id] The ID from an item of [management.ExtensionInfo]. */ Future get(String id) { if (_management == null) _throwNotAvailable(); @@ -108,7 +108,7 @@ class ChromeManagement extends ChromeApi { /** * Enables or disables an app or extension. * - * [id] This should be the id from an item of [ExtensionInfo.] + * [id] This should be the id from an item of [management.ExtensionInfo]. * * [enabled] Whether this item should be enabled or disabled. */ @@ -123,7 +123,7 @@ class ChromeManagement extends ChromeApi { /** * Uninstalls a currently installed app or extension. * - * [id] This should be the id from an item of [ExtensionInfo.] + * [id] This should be the id from an item of [management.ExtensionInfo]. */ Future uninstall(String id, [ManagementUninstallParams options]) { if (_management == null) _throwNotAvailable(); @@ -193,7 +193,7 @@ class IconInfo extends ChromeObject { * Information about an installed extension, app, or theme. */ class ExtensionInfo extends ChromeObject { - ExtensionInfo({String id, String name, String shortName, String description, String version, bool mayDisable, bool enabled, String disabledReason, String type, String appLaunchUrl, String homepageUrl, String updateUrl, bool offlineEnabled, String optionsUrl, List icons, List permissions, List hostPermissions, String installType}) { + ExtensionInfo({String id, String name, String shortName, String description, String version, bool mayDisable, bool enabled, String disabledReason, bool isApp, String type, String appLaunchUrl, String homepageUrl, String updateUrl, bool offlineEnabled, String optionsUrl, List icons, List permissions, List hostPermissions, String installType}) { if (id != null) this.id = id; if (name != null) this.name = name; if (shortName != null) this.shortName = shortName; @@ -202,6 +202,7 @@ class ExtensionInfo extends ChromeObject { if (mayDisable != null) this.mayDisable = mayDisable; if (enabled != null) this.enabled = enabled; if (disabledReason != null) this.disabledReason = disabledReason; + if (isApp != null) this.isApp = isApp; if (type != null) this.type = type; if (appLaunchUrl != null) this.appLaunchUrl = appLaunchUrl; if (homepageUrl != null) this.homepageUrl = homepageUrl; @@ -264,6 +265,12 @@ class ExtensionInfo extends ChromeObject { String get disabledReason => jsProxy['disabledReason']; set disabledReason(String value) => jsProxy['disabledReason'] = value; + /** + * True if this is an app. + */ + bool get isApp => jsProxy['isApp']; + set isApp(bool value) => jsProxy['isApp'] = value; + /** * The type of this extension, app, or theme. * enum of `extension`, `hosted_app`, `packaged_app`, `legacy_packaged_app`, diff --git a/lib/gen/media_galleries.dart b/lib/gen/media_galleries.dart index 8fce19b6..597b80f8 100644 --- a/lib/gen/media_galleries.dart +++ b/lib/gen/media_galleries.dart @@ -1,8 +1,8 @@ /* This file has been generated from media_galleries.idl - do not edit */ /** - * Use the `chrome.mediaGalleries` API to access media files (images, video, - * audio) from the user's local disks (with the user's consent). + * Use the `chrome.mediaGalleries` API to access media files (audio, images, + * video) from the user's local disks (with the user's consent). */ library chrome.mediaGalleries; @@ -17,7 +17,13 @@ final ChromeMediaGalleries mediaGalleries = new ChromeMediaGalleries._(); class ChromeMediaGalleries extends ChromeApi { JsObject get _mediaGalleries => chrome['mediaGalleries']; - ChromeMediaGalleries._(); + Stream get onScanProgress => _onScanProgress.stream; + ChromeStreamController _onScanProgress; + + ChromeMediaGalleries._() { + var getApi = () => _mediaGalleries; + _onScanProgress = new ChromeStreamController.oneArg(getApi, 'onScanProgress', _createScanProgressDetails); + } bool get available => _mediaGalleries != null; @@ -33,6 +39,60 @@ class ChromeMediaGalleries extends ChromeApi { return completer.future; } + /** + * Present a directory picker to the user and add the selected directory as a + * gallery. If the user cancels the picker, selectedFileSystemName will be + * empty. A user gesture is required for the dialog to display. Without a user + * gesture, the callback will run as though the user canceled. + * + * Returns: + * [mediaFileSystems] null + * [selectedFileSystemName] null + */ + Future addUserSelectedFolder() { + if (_mediaGalleries == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.twoArgs(AddUserSelectedFolderResult._create); + _mediaGalleries.callMethod('addUserSelectedFolder', [completer.callback]); + return completer.future; + } + + /** + * Start a scan of the user's hard disks for directories containing media. The + * scan may take a long time so progress and completion is communicated by + * events. No permission is granted as a result of the scan, see + * addScanResults. + */ + void startMediaScan() { + if (_mediaGalleries == null) _throwNotAvailable(); + + _mediaGalleries.callMethod('startMediaScan'); + } + + /** + * Cancel any pending media scan. Well behaved apps should provide a way for + * the user to cancel scans they start. + */ + void cancelMediaScan() { + if (_mediaGalleries == null) _throwNotAvailable(); + + _mediaGalleries.callMethod('cancelMediaScan'); + } + + /** + * Show the user the scan results and let them add any or all of them as + * galleries. This should be used after the 'finish' onScanProgress() event + * has happened. All galleries the app has access to are returned, not just + * the newly added galleries. + */ + Future> addScanResults() { + if (_mediaGalleries == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createDOMFileSystem)); + _mediaGalleries.callMethod('addScanResults', [completer.callback]); + return completer.future; + } + /** * Get metadata about a specific media file system. */ @@ -42,6 +102,29 @@ class ChromeMediaGalleries extends ChromeApi { return _createMediaFileSystemMetadata(_mediaGalleries.callMethod('getMediaFileSystemMetadata', [jsify(mediaFileSystem)])); } + /** + * Get metadata for all available media galleries. + */ + Future> getAllMediaFileSystemMetadata() { + if (_mediaGalleries == null) _throwNotAvailable(); + + var completer = new ChromeCompleter>.oneArg((e) => listify(e, _createMediaFileSystemMetadata)); + _mediaGalleries.callMethod('getAllMediaFileSystemMetadata', [completer.callback]); + return completer.future; + } + + /** + * Gets the media-specific metadata for a media file. This should work for + * files in media galleries as well as other DOM filesystems. + */ + Future getMetadata(Blob mediaFile, [MediaMetadataOptions options]) { + if (_mediaGalleries == null) _throwNotAvailable(); + + var completer = new ChromeCompleter.oneArg(_createMediaMetadata); + _mediaGalleries.callMethod('getMetadata', [jsify(mediaFile), jsify(options), completer.callback]); + return completer.future; + } + void _throwNotAvailable() { throw new UnsupportedError("'chrome.mediaGalleries' is not available"); } @@ -57,6 +140,26 @@ class GetMediaFileSystemsInteractivity extends ChromeEnum { const GetMediaFileSystemsInteractivity._(String str): super(str); } +class GetMetadataType extends ChromeEnum { + static const GetMetadataType ALL = const GetMetadataType._('all'); + static const GetMetadataType MIME_TYPE_ONLY = const GetMetadataType._('mimeTypeOnly'); + + static const List VALUES = const[ALL, MIME_TYPE_ONLY]; + + const GetMetadataType._(String str): super(str); +} + +class ScanProgressType extends ChromeEnum { + static const ScanProgressType START = const ScanProgressType._('start'); + static const ScanProgressType CANCEL = const ScanProgressType._('cancel'); + static const ScanProgressType FINISH = const ScanProgressType._('finish'); + static const ScanProgressType ERROR = const ScanProgressType._('error'); + + static const List VALUES = const[START, CANCEL, FINISH, ERROR]; + + const ScanProgressType._(String str): super(str); +} + class MediaFileSystemsDetails extends ChromeObject { MediaFileSystemsDetails({GetMediaFileSystemsInteractivity interactive}) { if (interactive != null) this.interactive = interactive; @@ -67,13 +170,24 @@ class MediaFileSystemsDetails extends ChromeObject { set interactive(GetMediaFileSystemsInteractivity value) => jsProxy['interactive'] = jsify(value); } +class MediaMetadataOptions extends ChromeObject { + MediaMetadataOptions({GetMetadataType metadataType}) { + if (metadataType != null) this.metadataType = metadataType; + } + MediaMetadataOptions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + GetMetadataType get metadataType => _createGetMetadataType(jsProxy['metadataType']); + set metadataType(GetMetadataType value) => jsProxy['metadataType'] = jsify(value); +} + class MediaFileSystemMetadata extends ChromeObject { - MediaFileSystemMetadata({String name, String galleryId, String deviceId, bool isRemovable, bool isMediaDevice}) { + MediaFileSystemMetadata({String name, String galleryId, String deviceId, bool isRemovable, bool isMediaDevice, bool isAvailable}) { if (name != null) this.name = name; if (galleryId != null) this.galleryId = galleryId; if (deviceId != null) this.deviceId = deviceId; if (isRemovable != null) this.isRemovable = isRemovable; if (isMediaDevice != null) this.isMediaDevice = isMediaDevice; + if (isAvailable != null) this.isAvailable = isAvailable; } MediaFileSystemMetadata.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); @@ -91,8 +205,117 @@ class MediaFileSystemMetadata extends ChromeObject { bool get isMediaDevice => jsProxy['isMediaDevice']; set isMediaDevice(bool value) => jsProxy['isMediaDevice'] = value; + + bool get isAvailable => jsProxy['isAvailable']; + set isAvailable(bool value) => jsProxy['isAvailable'] = value; +} + +class ScanProgressDetails extends ChromeObject { + ScanProgressDetails({ScanProgressType type, int galleryCount, int audioCount, int imageCount, int videoCount}) { + if (type != null) this.type = type; + if (galleryCount != null) this.galleryCount = galleryCount; + if (audioCount != null) this.audioCount = audioCount; + if (imageCount != null) this.imageCount = imageCount; + if (videoCount != null) this.videoCount = videoCount; + } + ScanProgressDetails.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + ScanProgressType get type => _createScanProgressType(jsProxy['type']); + set type(ScanProgressType value) => jsProxy['type'] = jsify(value); + + int get galleryCount => jsProxy['galleryCount']; + set galleryCount(int value) => jsProxy['galleryCount'] = value; + + int get audioCount => jsProxy['audioCount']; + set audioCount(int value) => jsProxy['audioCount'] = value; + + int get imageCount => jsProxy['imageCount']; + set imageCount(int value) => jsProxy['imageCount'] = value; + + int get videoCount => jsProxy['videoCount']; + set videoCount(int value) => jsProxy['videoCount'] = value; +} + +class MediaMetadata extends ChromeObject { + MediaMetadata({String mimeType, int height, int width, num duration, int rotation, String album, String artist, String comment, String copyright, int disc, String genre, String language, String title, int track}) { + if (mimeType != null) this.mimeType = mimeType; + if (height != null) this.height = height; + if (width != null) this.width = width; + if (duration != null) this.duration = duration; + if (rotation != null) this.rotation = rotation; + if (album != null) this.album = album; + if (artist != null) this.artist = artist; + if (comment != null) this.comment = comment; + if (copyright != null) this.copyright = copyright; + if (disc != null) this.disc = disc; + if (genre != null) this.genre = genre; + if (language != null) this.language = language; + if (title != null) this.title = title; + if (track != null) this.track = track; + } + MediaMetadata.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + String get mimeType => jsProxy['mimeType']; + set mimeType(String value) => jsProxy['mimeType'] = value; + + int get height => jsProxy['height']; + set height(int value) => jsProxy['height'] = value; + + int get width => jsProxy['width']; + set width(int value) => jsProxy['width'] = value; + + num get duration => jsProxy['duration']; + set duration(num value) => jsProxy['duration'] = jsify(value); + + int get rotation => jsProxy['rotation']; + set rotation(int value) => jsProxy['rotation'] = value; + + String get album => jsProxy['album']; + set album(String value) => jsProxy['album'] = value; + + String get artist => jsProxy['artist']; + set artist(String value) => jsProxy['artist'] = value; + + String get comment => jsProxy['comment']; + set comment(String value) => jsProxy['comment'] = value; + + String get copyright => jsProxy['copyright']; + set copyright(String value) => jsProxy['copyright'] = value; + + int get disc => jsProxy['disc']; + set disc(int value) => jsProxy['disc'] = value; + + String get genre => jsProxy['genre']; + set genre(String value) => jsProxy['genre'] = value; + + String get language => jsProxy['language']; + set language(String value) => jsProxy['language'] = value; + + String get title => jsProxy['title']; + set title(String value) => jsProxy['title'] = value; + + int get track => jsProxy['track']; + set track(int value) => jsProxy['track'] = value; +} + +/** + * The return type for [addUserSelectedFolder]. + */ +class AddUserSelectedFolderResult { + static AddUserSelectedFolderResult _create(mediaFileSystems, selectedFileSystemName) { + return new AddUserSelectedFolderResult._(listify(mediaFileSystems, _createDOMFileSystem), selectedFileSystemName); + } + + List mediaFileSystems; + String selectedFileSystemName; + + AddUserSelectedFolderResult._(this.mediaFileSystems, this.selectedFileSystemName); } +ScanProgressDetails _createScanProgressDetails(JsObject jsProxy) => jsProxy == null ? null : new ScanProgressDetails.fromProxy(jsProxy); FileSystem _createDOMFileSystem(JsObject jsProxy) => jsProxy == null ? null : new CrFileSystem.fromProxy(jsProxy); MediaFileSystemMetadata _createMediaFileSystemMetadata(JsObject jsProxy) => jsProxy == null ? null : new MediaFileSystemMetadata.fromProxy(jsProxy); +MediaMetadata _createMediaMetadata(JsObject jsProxy) => jsProxy == null ? null : new MediaMetadata.fromProxy(jsProxy); GetMediaFileSystemsInteractivity _createGetMediaFileSystemsInteractivity(String value) => GetMediaFileSystemsInteractivity.VALUES.singleWhere((ChromeEnum e) => e.value == value); +GetMetadataType _createGetMetadataType(String value) => GetMetadataType.VALUES.singleWhere((ChromeEnum e) => e.value == value); +ScanProgressType _createScanProgressType(String value) => ScanProgressType.VALUES.singleWhere((ChromeEnum e) => e.value == value); diff --git a/lib/gen/notifications.dart b/lib/gen/notifications.dart index 93e13cad..8d500020 100644 --- a/lib/gen/notifications.dart +++ b/lib/gen/notifications.dart @@ -28,12 +28,16 @@ class ChromeNotifications extends ChromeApi { Stream get onPermissionLevelChanged => _onPermissionLevelChanged.stream; ChromeStreamController _onPermissionLevelChanged; + Stream get onShowSettings => _onShowSettings.stream; + ChromeStreamController _onShowSettings; + ChromeNotifications._() { var getApi = () => _notifications; _onClosed = new ChromeStreamController.twoArgs(getApi, 'onClosed', _createOnClosedEvent); _onClicked = new ChromeStreamController.oneArg(getApi, 'onClicked', selfConverter); _onButtonClicked = new ChromeStreamController.twoArgs(getApi, 'onButtonClicked', _createOnButtonClickedEvent); _onPermissionLevelChanged = new ChromeStreamController.oneArg(getApi, 'onPermissionLevelChanged', _createPermissionLevel); + _onShowSettings = new ChromeStreamController.noArgs(getApi, 'onShowSettings'); } bool get available => _notifications != null; diff --git a/lib/gen/permissions.dart b/lib/gen/permissions.dart index 80317d48..395ff968 100644 --- a/lib/gen/permissions.dart +++ b/lib/gen/permissions.dart @@ -2,8 +2,8 @@ /** * Use the `chrome.permissions` API to request [declared optional - * permissions](#manifest) at run time rather than install time, so users - * understand why the permissions are needed and grant only those that are + * 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. */ library chrome.permissions; @@ -110,13 +110,18 @@ class Permissions extends ChromeObject { Permissions.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); /** - * List of named permissions (does not include hosts or origins). + * List of named permissions (does not include hosts or origins). Anything + * listed here must appear in the `optional_permissions` list in the manifest. */ List get permissions => listify(jsProxy['permissions']); set permissions(List value) => jsProxy['permissions'] = jsify(value); /** - * List of origin permissions. + * List of origin permissions. Anything listed here must be a subset of a host + * that appears in the `optional_permissions` list in the manifest. For + * example, if `http://\*.example.com/` or `http:///` appears in + * `optional_permissions`, you can request an origin of + * `http://help.example.com/`. Any path is ignored. */ List get origins => listify(jsProxy['origins']); set origins(List value) => jsProxy['origins'] = jsify(value); diff --git a/lib/gen/processes.dart b/lib/gen/processes.dart index 24bae88f..f7a2090e 100644 --- a/lib/gen/processes.dart +++ b/lib/gen/processes.dart @@ -155,11 +155,13 @@ class OnExitedEvent { * An object containing information about one of the browser's processes. */ class Process extends ChromeObject { - Process({int id, int osProcessId, String type, String profile, List tabs, var cpu, var network, var privateMemory, var jsMemoryAllocated, var jsMemoryUsed, var sqliteMemory, var fps, Cache imageCache, Cache scriptCache, Cache cssCache}) { + Process({int id, int osProcessId, String title, String type, String profile, int naclDebugPort, List tabs, var cpu, var network, var privateMemory, var jsMemoryAllocated, var jsMemoryUsed, var sqliteMemory, var fps, Cache imageCache, Cache scriptCache, Cache cssCache}) { if (id != null) this.id = id; if (osProcessId != null) this.osProcessId = osProcessId; + if (title != null) this.title = title; if (type != null) this.type = type; if (profile != null) this.profile = profile; + if (naclDebugPort != null) this.naclDebugPort = naclDebugPort; if (tabs != null) this.tabs = tabs; if (cpu != null) this.cpu = cpu; if (network != null) this.network = network; @@ -186,6 +188,12 @@ class Process extends ChromeObject { int get osProcessId => jsProxy['osProcessId']; set osProcessId(int value) => jsProxy['osProcessId'] = value; + /** + * The title of the process as seen in the task manager. + */ + String get title => jsProxy['title']; + set title(String value) => jsProxy['title'] = value; + /** * The type of process. * enum of `browser`, `renderer`, `extension`, `notification`, `plugin`, @@ -200,6 +208,13 @@ class Process extends ChromeObject { String get profile => jsProxy['profile']; set profile(String value) => jsProxy['profile'] = value; + /** + * The debugging port for Native Client processes. Zero for other process + * types and for NaCl processes that do not have debugging enabled. + */ + int get naclDebugPort => jsProxy['naclDebugPort']; + set naclDebugPort(int value) => jsProxy['naclDebugPort'] = value; + /** * Array of Tab IDs that have a page rendered by this process. The list will * be non-empty for renderer processes only. diff --git a/lib/gen/proxy.dart b/lib/gen/proxy.dart index 5e62c62f..6462ccc7 100644 --- a/lib/gen/proxy.dart +++ b/lib/gen/proxy.dart @@ -55,7 +55,7 @@ class ProxyServer extends ChromeObject { /** * The scheme (protocol) of the proxy server itself. Defaults to 'http'. - * enum of `http`, `https`, `socks4`, `socks5` + * enum of `http`, `https`, `quic`, `socks4`, `socks5` */ String get scheme => this.jsProxy['scheme']; set scheme(String value) => this.jsProxy['scheme'] = value; diff --git a/lib/gen/runtime.dart b/lib/gen/runtime.dart index 9c942355..35421f8e 100644 --- a/lib/gen/runtime.dart +++ b/lib/gen/runtime.dart @@ -185,10 +185,10 @@ class ChromeRuntime extends ChromeApi { * up server-side data, do analytics, and implement surveys. Maximum 255 * characters. */ - void setUninstallUrl(String url) { + void setUninstallURL(String url) { if (_runtime == null) _throwNotAvailable(); - _runtime.callMethod('setUninstallUrl', [url]); + _runtime.callMethod('setUninstallURL', [url]); } /** @@ -228,19 +228,23 @@ class ChromeRuntime extends ChromeApi { } /** - * Attempts to connect to other listeners within the extension/app (such as + * Attempts to connect 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. 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.] + * 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]. * - * [extensionId] The ID of the extension/app you want to connect to. If - * omitted, default is your own extension. + * [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). * * Returns: * Port through which messages can be sent and received. The port's - * [][runtime.Port onDisconnect] event is fired if the extension/app does not - * exist. + * $(ref:runtime.Port onDisconnect) event is fired if the extension/app does + * not exist. */ Port connect([String extensionId, RuntimeConnectParams connectInfo]) { if (_runtime == null) _throwNotAvailable(); @@ -263,15 +267,18 @@ class ChromeRuntime extends ChromeApi { } /** - * Sends a single message to onMessage event listeners within the extension - * (or another extension/app). Similar to chrome.runtime.connect, but only - * sends a single message with an optional response. The [runtime.onMessage] - * event is fired in each extension page of the extension. Note that - * extensions cannot send messages to content scripts using this method. To - * send messages to content scripts, use [tabs.sendMessage.] + * Sends a single message to event listeners within your extension/app or a + * different extension/app. Similar to [runtime.connect] but only sends a + * single message, with an optional response. If sending to your extension, + * the [runtime.onMessage] event will be fired in each page, or + * [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 [tabs.sendMessage]. * - * [extensionId] The extension ID of the extension you want to connect to. If - * omitted, default is your own extension. + * [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). * * Returns: * The JSON response object sent by the handler of the message. If an error @@ -294,7 +301,7 @@ class ChromeRuntime extends ChromeApi { * [message] The message that will be passed to the native messaging host. * * Returns: - * The response message send by the native messaging host. If an error occurs + * The response message sent by the native messaging host. If an error occurs * while connecting to the native messaging host, the callback will be called * with no arguments and [runtime.lastError] will be set to the error message. */ diff --git a/lib/gen/serial.dart b/lib/gen/serial.dart index f3bc6b26..1833c4bc 100644 --- a/lib/gen/serial.dart +++ b/lib/gen/serial.dart @@ -255,13 +255,25 @@ class ReceiveError extends ChromeEnum { } class DeviceInfo extends ChromeObject { - DeviceInfo({String path}) { + DeviceInfo({String path, int vendorId, int productId, String displayName}) { if (path != null) this.path = path; + if (vendorId != null) this.vendorId = vendorId; + if (productId != null) this.productId = productId; + if (displayName != null) this.displayName = displayName; } DeviceInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); String get path => jsProxy['path']; set path(String value) => jsProxy['path'] = value; + + int get vendorId => jsProxy['vendorId']; + set vendorId(int value) => jsProxy['vendorId'] = value; + + int get productId => jsProxy['productId']; + set productId(int value) => jsProxy['productId'] = value; + + String get displayName => jsProxy['displayName']; + set displayName(String value) => jsProxy['displayName'] = value; } class ConnectionOptions extends ChromeObject { diff --git a/lib/gen/sessions.dart b/lib/gen/sessions.dart index 5a30dc91..1696c9b7 100644 --- a/lib/gen/sessions.dart +++ b/lib/gen/sessions.dart @@ -23,7 +23,8 @@ class ChromeSessions extends ChromeApi { bool get available => _sessions != null; /** - * The maximum number of [Session] that will be included in a requested list. + * The maximum number of [sessions.Session] that will be included in a + * requested list. */ int get MAX_SESSION_RESULTS => _sessions['MAX_SESSION_RESULTS']; @@ -47,10 +48,10 @@ class ChromeSessions extends ChromeApi { * Retrieves all devices with synced sessions. * * Returns: - * The list of [Device] objects for each synced session, sorted in order from - * device with most recently modified session to device with least recently - * modified session. [tabs.Tab] objects are sorted by recency in the - * [windows.Window] of the [Session] objects. + * The list of [sessions.Device] objects for each synced session, sorted in + * order from device with most recently modified session to device with least + * recently modified session. [tabs.Tab] objects are sorted by recency in the + * [windows.Window] of the [sessions.Session] objects. */ Future> getDevices([Filter filter]) { if (_sessions == null) _throwNotAvailable(); @@ -68,7 +69,8 @@ class ChromeSessions extends ChromeApi { * restore. * * Returns: - * A [Session] containing the restored [windows.Window] or [tabs.Tab] object. + * A [sessions.Session] containing the restored [windows.Window] or [tabs.Tab] + * object. */ Future restore([String sessionId]) { if (_sessions == null) _throwNotAvailable(); @@ -92,7 +94,7 @@ class Filter extends ChromeObject { /** * The maximum number of entries to be fetched in the requested list. Omit * this parameter to fetch the maximum number of entries - * ([MAX_SESSION_RESULTS]). + * ([sessions.MAX_SESSION_RESULTS]). */ int get maxResults => jsProxy['maxResults']; set maxResults(int value) => jsProxy['maxResults'] = value; @@ -115,14 +117,14 @@ class Session extends ChromeObject { /** * The [tabs.Tab], if this entry describes a tab. Either this or - * [Session.window] will be set. + * [sessions.Session.window] will be set. */ Tab get tab => _createTab(jsProxy['tab']); set tab(Tab value) => jsProxy['tab'] = jsify(value); /** * The [windows.Window], if this entry describes a window. Either this or - * [Session.tab] will be set. + * [sessions.Session.tab] will be set. */ Window get window => _createWindow(jsProxy['window']); set window(Window value) => jsProxy['window'] = jsify(value); diff --git a/lib/gen/sync_file_system.dart b/lib/gen/sync_file_system.dart index 9a327e91..3309fb7f 100644 --- a/lib/gen/sync_file_system.dart +++ b/lib/gen/sync_file_system.dart @@ -38,7 +38,13 @@ class ChromeSyncFileSystem extends ChromeApi { * Returns a syncable filesystem backed by Google Drive. The returned * `FileSystem` instance can be operated on in the same way as the * Temporary and Persistant file systems (see http://www.w3.org/TR/file-system-api/). + * href="http://www.w3.org/TR/file-system-api/">http://www.w3.org/TR/file-system-api/), + * except that the filesystem object returned for Sync FileSystem does + * NOT support directory operations (yet). You can get a list of file + * entries by reading the root directory (by creating + * a new DirectoryReader), but cannot create a new directory in it. + * * Calling this multiple times from the same app will return the same handle * to the same file system. * diff --git a/lib/gen/system.dart b/lib/gen/system.dart index ada31914..a0b7ba92 100644 --- a/lib/gen/system.dart +++ b/lib/gen/system.dart @@ -61,11 +61,49 @@ class ChromeSystemCpu extends ChromeApi { } } +/** + * Counters for assessing CPU utilization. Each field is monotonically + * increasing while the processor is powered on. Values are in milliseconds. + */ +class CpuTime extends ChromeObject { + CpuTime({num user, num kernel, num idle, num total}) { + if (user != null) this.user = user; + if (kernel != null) this.kernel = kernel; + if (idle != null) this.idle = idle; + if (total != null) this.total = total; + } + CpuTime.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + num get user => jsProxy['user']; + set user(num value) => jsProxy['user'] = jsify(value); + + num get kernel => jsProxy['kernel']; + set kernel(num value) => jsProxy['kernel'] = jsify(value); + + num get idle => jsProxy['idle']; + set idle(num value) => jsProxy['idle'] = jsify(value); + + num get total => jsProxy['total']; + set total(num value) => jsProxy['total'] = jsify(value); +} + +class ProcessorInfo extends ChromeObject { + ProcessorInfo({CpuTime usage}) { + if (usage != null) this.usage = usage; + } + ProcessorInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + CpuTime get usage => _createCpuTime(jsProxy['usage']); + set usage(CpuTime value) => jsProxy['usage'] = jsify(value); +} + class CpuInfo extends ChromeObject { - CpuInfo({int numOfProcessors, String archName, String modelName}) { + CpuInfo({int numOfProcessors, String archName, String modelName, List features, List processors}) { if (numOfProcessors != null) this.numOfProcessors = numOfProcessors; if (archName != null) this.archName = archName; if (modelName != null) this.modelName = modelName; + if (features != null) this.features = features; + if (processors != null) this.processors = processors; } CpuInfo.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); @@ -77,9 +115,17 @@ class CpuInfo extends ChromeObject { String get modelName => jsProxy['modelName']; set modelName(String value) => jsProxy['modelName'] = value; + + List get features => listify(jsProxy['features']); + set features(List value) => jsProxy['features'] = jsify(value); + + List get processors => listify(jsProxy['processors'], _createProcessorInfo); + set processors(List value) => jsProxy['processors'] = jsify(value); } CpuInfo _createCpuInfo(JsObject jsProxy) => jsProxy == null ? null : new CpuInfo.fromProxy(jsProxy); +CpuTime _createCpuTime(JsObject jsProxy) => jsProxy == null ? null : new CpuTime.fromProxy(jsProxy); +ProcessorInfo _createProcessorInfo(JsObject jsProxy) => jsProxy == null ? null : new ProcessorInfo.fromProxy(jsProxy); /** * Use the `system.display` API to query display metadata. diff --git a/lib/gen/tabs.dart b/lib/gen/tabs.dart index 28470512..8d5f1cb6 100644 --- a/lib/gen/tabs.dart +++ b/lib/gen/tabs.dart @@ -7,6 +7,7 @@ library chrome.tabs; import 'runtime.dart'; +import 'types.dart'; import 'windows.dart'; import '../src/common.dart'; @@ -36,19 +37,21 @@ class ChromeTabs extends ChromeApi { * Fired when a tab is moved within a window. Only one move event is fired, * representing the tab the user directly moved. Move events are not fired for * the other tabs that must move in response. This event is not fired when a - * tab is moved between windows. For that, see [onDetached.] + * tab is moved between windows. For that, see [tabs.onDetached]. */ Stream get onMoved => _onMoved.stream; ChromeStreamController _onMoved; /** - * Deprecated. Please use onActivated. + * Fires when the selected tab in a window changes. */ Stream get onSelectionChanged => _onSelectionChanged.stream; ChromeStreamController _onSelectionChanged; /** - * Deprecated. Please use onActivated. + * Fires when the selected tab in a window changes. Note that the tab's URL + * may not be set at the time this event fired, but you can listen to + * [tabs.onUpdated] events to be notified when a URL is set. */ Stream get onActiveChanged => _onActiveChanged.stream; ChromeStreamController _onActiveChanged; @@ -62,7 +65,7 @@ class ChromeTabs extends ChromeApi { ChromeStreamController _onActivated; /** - * Deprecated. Please use onHighlighted. + * Fired when the highlighted or selected tabs in a window changes. */ Stream get onHighlightChanged => _onHighlightChanged.stream; ChromeStreamController _onHighlightChanged; @@ -160,7 +163,10 @@ class ChromeTabs extends ChromeApi { } /** - * Deprecated: Please use sendMessage. + * Sends a single request to the content script(s) in the specified tab, with + * an optional callback to run when a response is sent back. The + * [extension.onRequest] event is fired in each content script running in the + * specified tab for the current extension. * * Returns: * The JSON response object sent by the handler of the request. If an error @@ -195,8 +201,7 @@ class ChromeTabs extends ChromeApi { } /** - * Deprecated. Please use query({'active': true}). Gets the tab that is - * selected in the specified window. + * Gets the tab that is selected in the specified window. * * [windowId] Defaults to the [current window](windows.html#current-window). */ @@ -209,8 +214,7 @@ class ChromeTabs extends ChromeApi { } /** - * Deprecated. Please use query({'windowId': windowId}). Gets details about - * all tabs in the specified window. + * Gets details about all tabs in the specified window. * * [windowId] Defaults to the [current window](windows.html#current-window). */ @@ -374,14 +378,11 @@ class ChromeTabs extends ChromeApi { * [windowId] The target window. Defaults to the [current * window](windows.html#current-window). * - * [options] Set parameters of image capture, such as the format of the - * resulting image. - * * Returns: * A data URL which encodes an image of the visible area of the captured tab. * May be assigned to the 'src' property of an HTML Image element for display. */ - Future captureVisibleTab([int windowId, TabsCaptureVisibleTabParams options]) { + Future captureVisibleTab([int windowId, ImageDetails options]) { if (_tabs == null) _throwNotAvailable(); var completer = new ChromeCompleter.oneArg(); @@ -454,7 +455,7 @@ class OnUpdatedEvent { * Fired when a tab is moved within a window. Only one move event is fired, * representing the tab the user directly moved. Move events are not fired for * the other tabs that must move in response. This event is not fired when a tab - * is moved between windows. For that, see [onDetached.] + * is moved between windows. For that, see [tabs.onDetached]. */ class TabsOnMovedEvent { final int tabId; @@ -465,7 +466,7 @@ class TabsOnMovedEvent { } /** - * Deprecated. Please use onActivated. + * Fires when the selected tab in a window changes. */ class OnSelectionChangedEvent { /** @@ -479,7 +480,9 @@ class OnSelectionChangedEvent { } /** - * Deprecated. Please use onActivated. + * Fires when the selected tab in a window changes. Note that the tab's URL may + * not be set at the time this event fired, but you can listen to + * [tabs.onUpdated] events to be notified when a URL is set. */ class OnActiveChangedEvent { /** @@ -539,11 +542,12 @@ class OnReplacedEvent { } class Tab extends ChromeObject { - Tab({int id, int index, int windowId, int openerTabId, bool highlighted, bool active, bool pinned, String url, String title, String favIconUrl, String status, bool incognito, int width, int height, String sessionId}) { + Tab({int id, int index, int windowId, int openerTabId, bool selected, bool highlighted, bool active, bool pinned, String url, String title, String favIconUrl, String status, bool incognito, int width, int height, String sessionId}) { if (id != null) this.id = id; if (index != null) this.index = index; if (windowId != null) this.windowId = windowId; if (openerTabId != null) this.openerTabId = openerTabId; + if (selected != null) this.selected = selected; if (highlighted != null) this.highlighted = highlighted; if (active != null) this.active = active; if (pinned != null) this.pinned = pinned; @@ -586,6 +590,12 @@ class Tab extends ChromeObject { int get openerTabId => jsProxy['openerTabId']; set openerTabId(int value) => jsProxy['openerTabId'] = value; + /** + * Whether the tab is selected. + */ + bool get selected => jsProxy['selected']; + set selected(bool value) => jsProxy['selected'] = value; + /** * Whether the tab is highlighted. */ @@ -716,11 +726,12 @@ class TabsConnectParams extends ChromeObject { } class TabsCreateParams extends ChromeObject { - TabsCreateParams({int windowId, int index, String url, bool active, bool pinned, int openerTabId}) { + TabsCreateParams({int windowId, int index, String url, bool active, bool selected, bool pinned, int openerTabId}) { if (windowId != null) this.windowId = windowId; if (index != null) this.index = index; if (url != null) this.url = url; if (active != null) this.active = active; + if (selected != null) this.selected = selected; if (pinned != null) this.pinned = pinned; if (openerTabId != null) this.openerTabId = openerTabId; } @@ -756,6 +767,13 @@ class TabsCreateParams extends ChromeObject { bool get active => jsProxy['active']; set active(bool value) => jsProxy['active'] = value; + /** + * Whether the tab should become the selected tab in the window. Defaults to + * [true] + */ + bool get selected => jsProxy['selected']; + set selected(bool value) => jsProxy['selected'] = value; + /** * Whether the tab should be pinned. Defaults to [false] */ @@ -878,10 +896,11 @@ class TabsHighlightParams extends ChromeObject { } class TabsUpdateParams extends ChromeObject { - TabsUpdateParams({String url, bool active, bool highlighted, bool pinned, int openerTabId}) { + TabsUpdateParams({String url, bool active, bool highlighted, bool selected, bool pinned, int openerTabId}) { if (url != null) this.url = url; if (active != null) this.active = active; if (highlighted != null) this.highlighted = highlighted; + if (selected != null) this.selected = selected; if (pinned != null) this.pinned = pinned; if (openerTabId != null) this.openerTabId = openerTabId; } @@ -906,6 +925,12 @@ class TabsUpdateParams extends ChromeObject { bool get highlighted => jsProxy['highlighted']; set highlighted(bool value) => jsProxy['highlighted'] = value; + /** + * Whether the tab should be selected. + */ + bool get selected => jsProxy['selected']; + set selected(bool value) => jsProxy['selected'] = value; + /** * Whether the tab should be pinned. */ @@ -954,30 +979,6 @@ class TabsReloadParams extends ChromeObject { set bypassCache(bool value) => jsProxy['bypassCache'] = value; } -class TabsCaptureVisibleTabParams extends ChromeObject { - TabsCaptureVisibleTabParams({String format, int quality}) { - if (format != null) this.format = format; - if (quality != null) this.quality = quality; - } - TabsCaptureVisibleTabParams.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); - - /** - * The format of the resulting image. Default is jpeg. - * enum of `jpeg`, `png` - */ - String get format => jsProxy['format']; - set format(String value) => jsProxy['format'] = value; - - /** - * When format is 'jpeg', controls the quality of the resulting image. This - * value is ignored for PNG images. As quality is decreased, the resulting - * image will have more visual artifacts, and the number of bytes needed to - * store it will decrease. - */ - int get quality => jsProxy['quality']; - set quality(int value) => jsProxy['quality'] = value; -} - Tab _createTab(JsObject jsProxy) => jsProxy == null ? null : new Tab.fromProxy(jsProxy); OnUpdatedEvent _createOnUpdatedEvent(int tabId, JsObject changeInfo, JsObject tab) => new OnUpdatedEvent(tabId, mapify(changeInfo), _createTab(tab)); diff --git a/lib/gen/tts.dart b/lib/gen/tts.dart index 377cbf04..be0033a4 100644 --- a/lib/gen/tts.dart +++ b/lib/gen/tts.dart @@ -99,8 +99,8 @@ class ChromeTts extends ChromeApi { * Gets an array of all available voices. * * Returns: - * Array of [TtsVoice] objects representing the available voices for speech - * synthesis. + * Array of [tts.TtsVoice] objects representing the available voices for + * speech synthesis. */ Future> getVoices() { if (_tts == null) _throwNotAvailable(); @@ -160,10 +160,11 @@ class TtsEvent extends ChromeObject { * A description of a voice available for speech synthesis. */ class TtsVoice extends ChromeObject { - TtsVoice({String voiceName, String lang, String gender, String extensionId, List eventTypes}) { + TtsVoice({String voiceName, String lang, String gender, bool remote, String extensionId, List eventTypes}) { if (voiceName != null) this.voiceName = voiceName; if (lang != null) this.lang = lang; if (gender != null) this.gender = gender; + if (remote != null) this.remote = remote; if (extensionId != null) this.extensionId = extensionId; if (eventTypes != null) this.eventTypes = eventTypes; } @@ -189,6 +190,13 @@ class TtsVoice extends ChromeObject { String get gender => jsProxy['gender']; set gender(String value) => jsProxy['gender'] = value; + /** + * If true, the synthesis engine is a remote network resource. It may be + * higher latency and may incur bandwidth costs. + */ + bool get remote => jsProxy['remote']; + set remote(bool value) => jsProxy['remote'] = value; + /** * The ID of the extension providing this voice. */ diff --git a/lib/gen/types.dart b/lib/gen/types.dart index 79eb84a5..09ba80b6 100644 --- a/lib/gen/types.dart +++ b/lib/gen/types.dart @@ -69,6 +69,33 @@ class ChromeSetting extends ChromeObject { } } +/** + * Details about the format and quality of an image. + */ +class ImageDetails extends ChromeObject { + ImageDetails({String format, int quality}) { + if (format != null) this.format = format; + if (quality != null) this.quality = quality; + } + ImageDetails.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); + + /** + * The format of the resulting image. Default is `"jpeg"`. + * enum of `jpeg`, `png` + */ + String get format => jsProxy['format']; + set format(String value) => jsProxy['format'] = value; + + /** + * When format is `"jpeg"`, controls the quality of the resulting image. This + * value is ignored for PNG images. As quality is decreased, the resulting + * image will have more visual artifacts, and the number of bytes needed to + * store it will decrease. + */ + int get quality => jsProxy['quality']; + set quality(int value) => jsProxy['quality'] = value; +} + class TypesGetParams extends ChromeObject { TypesGetParams({bool incognito}) { if (incognito != null) this.incognito = incognito; diff --git a/lib/gen/wallpaper.dart b/lib/gen/wallpaper.dart index 6046f93f..be4bb634 100644 --- a/lib/gen/wallpaper.dart +++ b/lib/gen/wallpaper.dart @@ -1,7 +1,7 @@ /* This file has been generated from wallpaper.json - do not edit */ /** - * none + * Use the `chrome.wallpaper` API to change the ChromeOS wallpaper. */ library chrome.wallpaper; @@ -20,7 +20,12 @@ class ChromeWallpaper extends ChromeApi { bool get available => _wallpaper != null; /** - * Sets wallpaper to the image from url with specified layout + * Sets wallpaper to the image at _url_ or _wallpaperData_ with the specified + * _layout_ + * + * Returns: + * The jpeg encoded wallpaper thumbnail. It is generated by resizing the + * wallpaper to 128x60. */ Future setWallpaper(WallpaperSetWallpaperParams details) { if (_wallpaper == null) _throwNotAvailable(); @@ -52,7 +57,7 @@ class WallpaperSetWallpaperParams extends ChromeObject { set wallpaperData(var value) => jsProxy['wallpaperData'] = jsify(value); /** - * The url of online wallpaper. + * The URL of the wallpaper to be set. */ String get url => jsProxy['url']; set url(String value) => jsProxy['url'] = value; @@ -65,7 +70,7 @@ class WallpaperSetWallpaperParams extends ChromeObject { set layout(String value) => jsProxy['layout'] = value; /** - * The file name of saved wallpaper. + * The file name of the saved wallpaper. */ String get name => jsProxy['name']; set name(String value) => jsProxy['name'] = value; diff --git a/lib/gen/web_request.dart b/lib/gen/web_request.dart index da29b1c5..4d66a491 100644 --- a/lib/gen/web_request.dart +++ b/lib/gen/web_request.dart @@ -216,9 +216,13 @@ class BlockingResponse extends ChromeObject { set cancel(bool value) => jsProxy['cancel'] = value; /** - * Only used as a response to the onBeforeRequest event. If set, the original - * request is prevented from being sent and is instead redirected to the given - * URL. + * Only used as a response to the onBeforeRequest and onHeadersReceived + * events. If set, the original request is prevented from being sent/completed + * and is instead redirected to the given URL. Redirections to non-HTTP + * schemes such as data: are allowed. Redirects initiated by a redirect action + * use the original request method for the redirect, with one exception: If + * the redirect is initiated at the onHeadersReceived stage, then the redirect + * will be issued using the GET method. */ String get redirectUrl => jsProxy['redirectUrl']; set redirectUrl(String value) => jsProxy['redirectUrl'] = value; diff --git a/meta/apis.json b/meta/apis.json index b5453150..00e4ceeb 100644 --- a/meta/apis.json +++ b/meta/apis.json @@ -5,11 +5,15 @@ "app.window", "audio", "bluetooth", + "bluetoothLowEnergy", + "bluetoothSocket", "browser", + "commands", "contextMenus", "events", "fileSystem", "gcm", + "hid", "i18n", "identity", "idle", diff --git a/meta/overrides.json b/meta/overrides.json index 5f653f84..5e9510e7 100644 --- a/meta/overrides.json +++ b/meta/overrides.json @@ -16,6 +16,14 @@ "renameClass": { "bluetooth.Device": "BluetoothDevice", + "bluetoothSocket.AcceptErrorInfo": "BluetoothAcceptErrorInfo", + "bluetoothSocket.AcceptInfo": "BluetoothAcceptInfo", + "bluetoothSocket.CreateInfo": "BluetoothCreateInfo", + "bluetoothSocket.ReceiveError": "BluetoothReceiveError", + "bluetoothSocket.ReceiveErrorInfo": "BluetoothReceiveErrorInfo", + "bluetoothSocket.ReceiveInfo": "BluetoothReceiveInfo", + "bluetoothSocket.SocketInfo": "BluetoothSocketInfo", + "bluetoothSocket.SocketProperties": "BluetoothSocketProperties", "serial.Device": "SerialDevice", "serial.ReadInfo": "SerialReadInfo", @@ -41,6 +49,8 @@ "syncFileSystem.DOMFileSystem": "FileSystem", "mediaGalleries.DOMFileSystem": "FileSystem", + "hid.GetDevicesOptions": "HidGetDevicesOptions", + "events.Event": "ChromeEvent", "runtime.Event": "ChromeEvent" } diff --git a/tool/chrome_idl_convert.dart b/tool/chrome_idl_convert.dart index 030c49a6..338733a5 100644 --- a/tool/chrome_idl_convert.dart +++ b/tool/chrome_idl_convert.dart @@ -255,6 +255,11 @@ class IDLConverter { new RegExp(r"\|(\w+)\|"), (Match m) => "[${m.group(1)}]"); + // $(ref:sessions) ==> [sessions] + str = str.replaceAllMapped( + new RegExp(r"\$\(ref:([\.\w]*)\)"), + (Match m) => "[${m.group(1)}]"); + // $ref:runtime.onConnect ==> [runtime.onConnect] str = str.replaceAllMapped( new RegExp(r"\$ref:([\.\w]*\w)"), diff --git a/tool/src/src_gen.dart b/tool/src/src_gen.dart index e6e49613..f26d6126 100644 --- a/tool/src/src_gen.dart +++ b/tool/src/src_gen.dart @@ -35,6 +35,8 @@ class DartGenerator { } docs = wrap(docs.trim(), colBoundary - _indent.length - 3); + docs = docs.replaceAll('*/', '/'); + docs = docs.replaceAll('/*', r'/\*'); if (!docs.contains('\n') && preferSingle) { _writeln("/// ${docs}", true); diff --git a/tool/src/utils.dart b/tool/src/utils.dart index df716c41..382dcd88 100644 --- a/tool/src/utils.dart +++ b/tool/src/utils.dart @@ -67,6 +67,11 @@ String convertHtmlToDartdoc(String str) { str = str.replaceAll('

', ''); str = str.replaceAll('

', ''); + // $(ref:sessions) ==> [sessions] + str = str.replaceAllMapped( + new RegExp(r"\$\(ref:([\.\w]*)\)"), + (Match m) => "[${m.group(1)}]"); + // $ref:runtime.onConnect ==> [runtime.onConnect] str = str.replaceAllMapped( new RegExp(r"\$ref:([\.\w]*)"),