1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134
|
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// fileManagerPrivate API.
// This is a private API used by the file manager on ChromeOS. The API can
// roughly be divided into two parts: functions and events.
//
// Functions: The Functions interface defines a number of privileged operations
// that allow File Manager to execute tasks not available via public APIs. Most
// of the time this is due to the fact that enabling those tasks via public APIs
// would allow malicious applications to either take control of the hardware
// or leak private information about the user. None of these API must be exposed
// in any public services.
//
// Events: The Event interface defines a number of events that are supported
// by the API. These events allow one to register, in JavaScript, a listener
// that is invoked with event's parameters, every time the event is observed
// by the file_manager::EventRouter.
//
// Both the functions and events interface are only available to clients that
// are explicitly granted permission to use the fileManagerPrivate API. This
// API is not available to any client without code reviewed changes
// (eg. via _api_features.json)
//
// CAVEAT: An application A registering as a listener to any events must assume
// that an application B can listen to any events that are destined for A, where
// A and B are any applications that are granted access to fileManagerPrivate.
// For example, if applications A and B listen to onDirectoryChanged events on
// two unique paths, they both receive events about changes in either path. This
// is due to the fact that events are broadcasted to ALL listeners. It is the
// responsibility of the listener to discard events not destined for it. It is
// also the responsibility of all listeners not to log information transmitted
// in those events, as it may record in logs information that is private to a
// given user (e.g., the full paths and name of a given file). This API is
// designed with the assumption that all users are equal in terms of their
// permission to observe events, call the function interface and access the file
// system of the device. As the API is only used by Chrome OS' File Manager, and
// the File Manager is being used by the user to access their own files, this
// assumption holds true.
//
// The API defined in this file may use W3C Entry object (FileEntry and
// DirectoryEntry). Since these cannot be directly sent or received by the C++
// code, there exists an additional layer, in file_manager_private_internal.idl,
// that provides translation from or to W3C Entry objects.
[platforms=("chromeos"),
implemented_in="chrome/browser/ash/extensions/file_manager/file_manager_private_api_functions.h"]
namespace fileManagerPrivate {
// Type of the mounted volume.
enum VolumeType { drive, downloads, removable, archive, provided, mtp,
media_view, crostini, android_files, documents_provider,
testing, smb, system_internal, guest_os };
// Device type. Available if this is removable volume.
enum DeviceType { usb, sd, optical, mobile, unknown };
// List of device connection statuses.
enum DeviceConnectionState {OFFLINE, ONLINE};
// List of connection types of drive.
enum DriveConnectionStateType {OFFLINE, METERED, ONLINE};
// List of reasons of DriveConnectionStateType.
enum DriveOfflineReason {NOT_READY, NO_NETWORK, NO_SERVICE};
// Additional information of the context the volume was mounted.
enum MountContext { user, auto };
// Is the event raised for mounting or unmounting.
enum MountCompletedEventType { mount, unmount };
// Event type that tells listeners if mount was successful or an error
// occurred. It also specifies the error.
enum MountError {
success,
in_progress,
unknown_error,
internal_error,
invalid_argument,
invalid_path,
path_already_mounted,
path_not_mounted,
directory_creation_failed,
invalid_mount_options,
insufficient_permissions,
mount_program_not_found,
mount_program_failed,
invalid_device_path,
unknown_filesystem,
unsupported_filesystem,
need_password,
cancelled,
busy
};
// Filesystem to format to.
enum FormatFileSystemType { vfat, exfat, ntfs };
// File transfer progress state.
enum TransferState { in_progress, queued, completed, failed };
// The response when starting installing a Linux package.
enum InstallLinuxPackageStatus {
started,
failed,
install_already_active
};
// Specifies type of event that is raised.
enum FileWatchEventType { changed, error };
// Specifies type of change in file watch event.
enum ChangeType { add_or_update, delete };
// The type of entry that is needed. Default to ALL.
enum SearchType { EXCLUDE_DIRECTORIES, SHARED_WITH_ME, OFFLINE, ALL };
// Zooming mode.
enum ZoomOperationType { in, out, reset };
// Specifies how to open inspector.
enum InspectionType {
// Open inspector for foreground page.
normal,
// Open inspector for foreground page and bring focus to the console.
console,
// Open inspector for foreground page in inspect element mode.
element,
// Open inspector for background page.
background
};
// Device event type.
enum DeviceEventType {
// If the device is disabled by preference.
disabled,
// Device is removed.
removed,
// Device is hard unplugged.
hard_unplugged,
// Format started.
format_start,
// Format succeeded.
format_success,
// Format failed.
format_fail,
// Rename started.
rename_start,
// Rename succeeded.
rename_success,
// Rename failed.
rename_fail,
// Partition started.
partition_start,
// Partition succeeded.
partition_success,
// Partition failed.
partition_fail
};
// Drive sync error type.
// Keep it synced with DriveError::Type in drivefs.mojom.
enum DriveSyncErrorType {
// Request to delete a file without permission.
delete_without_permission,
// Google Drive is temporarily unavailable.
service_unavailable,
// There is no server space for the user to sync a file.
no_server_space,
// There is no server space for the organization to sync a file.
no_server_space_organization,
// There is no local space to sync a file.
no_local_space,
// There is no space left on a shared drive.
no_shared_drive_space,
// Miscellaneous errors other than listed above.
misc
};
// Drive confirm dialog type.
// Keep it synced with DialogReason::Type in drivefs.mojom.
enum DriveConfirmDialogType {
// Request to enable Docs Offline to allow saving hosted files offline.
enable_docs_offline
};
// Possible result of dialog displayed as a result of the onDriveConfirmDialog
// event. Sent back to the browser via notifyDriveDialogResult().
enum DriveDialogResult {
// The dialog was not displayed to the user.
not_displayed,
// The user accepted the action proposed by the dialog.
accept,
// The user rejected the action proposed by the dialog.
reject,
// The user closed the dialog without selecting an option.
dismiss
};
// Result of task execution. If changing, update the strings used in
// ui/file_manager/file_manager/foreground/js/file_tasks.js
enum TaskResult {
// The task execution succeeded and a new window/tab was opened on the current
// desktop.
opened,
// The task execution succeeded and the message was sent to the proper
// extension or app. This could result in a window being opened on a different
// desktop.
message_sent,
// The task execution failed.
failed,
// No URL is specified.
empty,
// The task was a |plugin_vm| task, and the file was in an unshared directory
failed_plugin_vm_directory_not_shared
};
// Drive share type.
enum DriveShareType {
can_edit,
can_comment,
can_view
};
// Names of properties for getEntryProperties().
enum EntryPropertyName {
size,
modificationTime,
modificationByMeTime,
thumbnailUrl,
croppedThumbnailUrl,
imageWidth,
imageHeight,
imageRotation,
pinned,
present,
hosted,
availableOffline,
availableWhenMetered,
dirty,
customIconUrl,
contentMimeType,
sharedWithMe,
shared,
starred,
externalFileUrl,
alternateUrl,
shareUrl,
canCopy,
canDelete,
canRename,
canAddChildren,
canShare,
canPin,
isMachineRoot,
isExternalMedia,
isArbitrarySyncFolder,
syncStatus,
progress,
shortcut,
syncCompletedTime
};
// Source of the volume data.
enum Source {
file,
device,
network,
system
};
// Recent file sources allowed in getRecentFiles().
enum SourceRestriction {
// Allows any source.
any_source,
// Allows source with native local file system only.
native_source
};
// File categories to filter results from getRecentFiles().
enum FileCategory {
all,
audio,
image,
video,
document
};
enum CrostiniEventType {
enable,
disable,
share,
unshare,
drop_failed_plugin_vm_directory_not_shared
};
enum ProviderSource {
file,
device,
network
};
enum SharesheetLaunchSource {
context_menu,
sharesheet_button,
unknown
};
enum IoTaskState {
queued,
scanning,
in_progress,
paused,
success,
error,
need_password,
cancelled
};
enum IoTaskType {
copy,
delete,
empty_trash,
extract,
move,
restore,
restore_to_destination,
trash,
zip
};
enum PolicyErrorType {
dlp,
enterprise_connectors,
dlp_warning_timeout
};
enum PolicyDialogType {
warning,
error
};
enum RecentDateBucket {
today,
yesterday,
earlier_this_week,
earlier_this_month,
earlier_this_year,
older
};
enum VmType { termina, plugin_vm, borealis, bruschetta, arcvm };
enum UserType {
// User doesn't belong to any organization.
unmanaged,
// User is a member of an organization.
organization
};
enum DlpLevel {
// Report every action to the admin, doesn't affect the user.
report,
// Warn the user on every action.
warn,
// Block the user on every action.
block,
// No restriction.
allow
};
enum SyncStatus {
// No sync status available for file.
not_found,
// File is queued up for syncing.
queued,
// File is currently being synced.
in_progress,
// File is done syncing.
completed,
// There was an error syncing the file.
error
};
// Describes how admin policy affects the default task in a ResultingTasks.
// See chrome/browser/ash/file_manager/file_tasks.h for details.
enum PolicyDefaultHandlerStatus {
default_handler_assigned_by_policy,
incorrect_assignment
};
// Describes the stage the bulk pinning manager is in. This enum should be kept
// in sync with chromeos/ash/components/drivefs/mojom/pin_manager_types.mojom.
enum BulkPinStage {
// Initial stage.
stopped,
// Paused because of unfavorable network conditions.
paused_offline,
// Paused due to battery saver mode active.
paused_battery_saver,
// In-progress stages.
getting_free_space,
listing_files,
syncing,
// Final success stage.
success,
// Final error stages.
not_enough_space,
cannot_get_free_space,
cannot_list_files,
cannot_enable_docs_offline
};
// The default location/volume that the user should use.
// It's usually MyFiles. When SkyVault is enabled the admin might
// choose between Google Drive and OneDrive.
// NOTE: This is independent of the Downloads folder which is mostly used
// in the browser.
enum DefaultLocation {
my_files,
google_drive,
onedrive
};
// The value of the SkyVault LocalFilesMigrationDestination policy.
enum MigrationDestination {
not_specified,
google_drive,
onedrive,
delete
};
// These three fields together uniquely identify a task.
dictionary FileTaskDescriptor {
DOMString appId;
DOMString taskType;
DOMString actionId;
};
// A file task represents an action that the file manager can perform over the
// currently selected files. See chrome/browser/ash/file_manager/file_tasks.h
// for details about how file tasks are handled.
dictionary FileTask {
// Unique identifier for the task.
FileTaskDescriptor descriptor;
// Task title (ex. App name).
DOMString title;
// Task icon url (from chrome://extension-icon/...)
DOMString? iconUrl;
// True if this task is a default task for the selected files.
boolean? isDefault;
// True if this task is from generic file handler. Generic file handler is a
// file handler which handles any type of files (e.g. extensions: ["*"],
// types: ["*/*"]). Partial wild card (e.g. types: ["image/*"]) is not
// generic file handler.
boolean? isGenericFileHandler;
// True if this is task is blocked by Data Leak Prevention (DLP).
boolean? isDlpBlocked;
};
// Represents a set of tasks capable of handling file entries.
// See chrome/browser/ash/file_manager/file_tasks.h for details.
dictionary ResultingTasks {
FileTask[] tasks;
// Note that this field is non-null if and only if at least one entry has been affected by policy.
PolicyDefaultHandlerStatus? policyDefaultHandlerStatus;
};
// Additional entry properties.
dictionary EntryProperties {
// Size of this file.
double? size;
// Timestamp of entry update time, in milliseconds past the epoch.
double? modificationTime;
// Timestamp of entry update time by me, in milliseconds past the epoch.
double? modificationByMeTime;
// Date bucket calculated by |modificationTime| or |modificationByMeTime|.
RecentDateBucket? recentDateBucket;
// URL to the Drive thumbnail image for this file.
DOMString? thumbnailUrl;
// URL to the Drive cropped thumbnail image for this file.
DOMString? croppedThumbnailUrl;
// Width, if the entry is an image.
long? imageWidth;
// Height, if the entry is an image.
long? imageHeight;
// Rotation in clockwise degrees, if the entry is an image.
long? imageRotation;
// True if the file is pinned in cache.
boolean? pinned;
// True if the file is present in cache.
boolean? present;
// True if the file is hosted on a server instead of local.
boolean? hosted;
// True if the file is available offline.
boolean? availableOffline;
// True if the file is available on metered connection.
boolean? availableWhenMetered;
// True if the file has local change (has not been fully synced to the cloud).
boolean? dirty;
// URL to the custom icon for this file.
DOMString? customIconUrl;
// Drive MIME type for this file.
DOMString? contentMimeType;
// True if the entry is labeled as shared-with-me.
boolean? sharedWithMe;
// True if the entry is labeled as shared (either from me to others or to me
// by others.)
boolean? shared;
// True if the entry is starred by the user.
boolean? starred;
// externalfile:// URL to open the file in browser.
DOMString? externalFileUrl;
// https:// URL to open the file or folder in the Drive website.
DOMString? alternateUrl;
// https:// URL to open the file or folder in the Drive website with the
// sharing dialog open.
DOMString? shareUrl;
// True if the entry can be copied by the user.
boolean? canCopy;
// True if the entry can be deleted by the user.
boolean? canDelete;
// True if the entry can be renamed by the user.
boolean? canRename;
// True if the entry can have children added to it by the user (directories
// only).
boolean? canAddChildren;
// True if the entry can be shared by the user.
boolean? canShare;
// True if the entry can be pinned by the user.
boolean? canPin;
// True if the entry is a machine root for backup and sync.
boolean? isMachineRoot;
// True if the entry is a external media folder, that contains one time only
// uploads for USB devices, SD cards etc.
boolean? isExternalMedia;
// True if the entry is an arbitrary sync folder.
boolean? isArbitrarySyncFolder;
// Sync status for files tracked by different cloud filesystem providers.
SyncStatus? syncStatus;
// Progress representing some ongoing operation with the file.
// E.g., pasting, syncing. Note: currently, this is exclusively being used
// for Drive syncing.
double? progress;
// Time in milliseconds since the epoch when the file last received a
// "completed" sync status.
double? syncCompletedTime;
// True if the entry is a shortcut.
boolean? shortcut;
};
// Information about total and remaining size on the mount point.
dictionary MountPointSizeStats {
// Approximate total available size on the mount point.
double totalSize;
// Approximate remaining available size on the mount point.
double remainingSize;
};
dictionary SearchDriveResponse {
// Search results.
[instanceOf=Entry] object[] entries;
// ID of the feed that contains next chunk of the search result.
// Should be sent to the next searchDrive request to perform
// incremental search.
DOMString nextFeed;
};
// Free and total space available in Drive relative to both the user and their
// organization, if they belong to one.
dictionary DriveQuotaMetadata {
UserType userType;
// How much space the individual user, or shared drive has used.
double usedBytes;
// The individual user, or shared drive limit. -1 means infinite.
double totalBytes;
// The following two fields only have meaning if user_type is kOrganization.
// Whether the organization has exceeded its storage limit.
boolean organizationLimitExceeded;
// Name of the organization the user belongs to.
DOMString organizationName;
};
// Information about a profile.
dictionary ProfileInfo {
// Profile ID. This is currently e-mail address of the profile.
DOMString profileId;
// The name of the profile for display purpose.
DOMString displayName;
// True if the profile is the one running the current file manager instance.
// TODO(hirono): Remove the property because of the design change of
// multi-profile suuport.
boolean isCurrentProfile;
};
// The return data for getProfiles() API.
dictionary ProfilesResponse {
// List of profile information.
ProfileInfo[] profiles;
// ID of the profile that runs the application instance.
DOMString currentProfileId;
// ID of the profile that shows the application window.
DOMString displayedProfileId;
};
// Represents an icon in multiple dimensions. All are optional.
dictionary IconSet {
DOMString? icon16x16Url;
DOMString? icon32x32Url;
};
// Mounted disk volume metadata.
dictionary VolumeMetadata {
// ID of the disk volume.
DOMString volumeId;
// Id the provided file system (for provided file systems).
DOMString? fileSystemId;
// ID of the provider, if the volume is backed by FSP.
DOMString? providerId;
// Source of the volume's data.
Source source;
// Label of the volume (if available).
DOMString? volumeLabel;
// Description of the profile where the volume belongs.
// TODO(hirono): Remove the property because of the design change of
// multi-profile support.
ProfileInfo profile;
// The path to the mounted device, archive file or network resource.
DOMString? sourcePath;
// Type of the mounted volume.
VolumeType volumeType;
// Device type. Available if this is removable volume.
DeviceType? deviceType;
// Path to identify the device. This is consistent with DeviceEvent's
// devicePath.
DOMString? devicePath;
// Whether the device is parent or not (i.e. sdb rather than sdb1).
boolean? isParentDevice;
// Flag that specifies if volume is mounted in read-only mode.
boolean isReadOnly;
// Flag that specifies if the device is write-protected.
// Valid only for the volumes of removable device partitions.
boolean isReadOnlyRemovableDevice;
// Flag that specifies whether the volume contains media.
boolean hasMedia;
// Flag that specifies whether the volume is configurable.
boolean configurable;
// Flag that specifies whether the volume is watchable.
boolean watchable;
// Additional data about mount, for example, that the filesystem is not
// supported.
MountError? mountCondition;
// Context in which the volume has been mounted.
MountContext? mountContext;
// File system type indentifier.
DOMString? diskFileSystemType;
// Icons for the volume.
IconSet iconSet;
// Drive label of the volume. Removable partitions that belong to the
// same physical removable device share the same drive label.
DOMString? driveLabel;
// The path on the remote host where this volume is mounted, for crostini this
// is the user's homedir (/home/<username>).
DOMString? remoteMountPath;
// Flag that specifies whether the volume is hidden from the user.
boolean hidden;
// Type of the VM which owns this volume.
VmType? vmType;
};
// Payload data for mount event.
dictionary MountCompletedEvent {
// Is the event raised for mounting or unmounting.
MountCompletedEventType eventType;
// Event type that tells listeners if mount was successful or an error
// occurred. It also specifies the error.
MountError status;
// Metadata of the mounted volume.
VolumeMetadata volumeMetadata;
// Whether the volume event should be notified or not.
boolean shouldNotify;
};
// Payload data for aggregate file transfer status updates.
dictionary FileTransferStatus {
// URL of file that is being transferred.
DOMString fileUrl;
// File transfer progress state.
TransferState transferState;
// Approximated completed portion of the transfer operation.
double processed;
// Approximated total size of transfer operation.
double total;
// Total number of jobs.
long numTotalJobs;
// Indicates whether a notification should be shown for the transfer update.
boolean showNotification;
// If true, hide when a job is completed when there are zero jobs in
// progress. Otherwise, hide when one job is in progress.
boolean hideWhenZeroJobs;
};
// Information about the syncing state of an individual file.
dictionary SyncState {
// URL of file that is being transferred.
DOMString fileUrl;
// File transfer progress state.
SyncStatus syncStatus;
// Transfer progress so far. Ranges from 0 to 1.
double progress;
};
// Error during the drive sync.
dictionary DriveSyncErrorEvent {
// Error type.
DriveSyncErrorType type;
// File URL of the entry that the error happens to.
DOMString fileUrl;
// Shared drive name if the error relates to a shared drive.
DOMString? sharedDrive;
};
// Confirmation dialog from Drive asking the user to accept or reject an
// action.
dictionary DriveConfirmDialogEvent {
// Dialog type.
DriveConfirmDialogType type;
// File URL of the entry associated with the dialog.
DOMString fileUrl;
};
// Detailed information of change.
dictionary FileChange {
// URL of changed file (or directory).
DOMString url;
// Type of change, which may be multiple.
ChangeType[] changes;
};
// Directory change notification details.
dictionary FileWatchEvent {
// Specifies type of event that is raised.
FileWatchEventType eventType;
// An Entry object which represents a changed directory. The conversion into a
// kind of FileEntry object is done in
// file_browser_handler_custom_bindings.cc. For filesystem API's Entry
// interface, see <a
// href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
// interface</a>.
[instanceOf=Entry] object entry;
// Detailed change information of change. It would be null if the detailed
// information is not available.
FileChange[]? changedFiles;
};
// Parameters passed to fileManagerPrivateInternal.getVolumeRoot function.
dictionary GetVolumeRootOptions {
// The ID of the requested volume.
DOMString volumeId;
// Whether the requested file system should be writable. The default is
// read-only.
boolean? writable;
};
dictionary Preferences {
boolean driveEnabled;
boolean driveSyncEnabledOnMeteredNetwork;
boolean searchSuggestEnabled;
boolean use24hourClock;
DOMString timezone;
boolean arcEnabled;
boolean arcRemovableMediaAccessEnabled;
DOMString[] folderShortcuts;
boolean trashEnabled;
double officeFileMovedOneDrive;
double officeFileMovedGoogleDrive;
boolean driveFsBulkPinningAvailable;
boolean driveFsBulkPinningEnabled;
boolean localUserFilesAllowed;
DefaultLocation defaultLocation;
MigrationDestination skyVaultMigrationDestination;
DOMString? skyVaultMigrationStartTime;
};
dictionary PreferencesChange {
boolean? driveSyncEnabledOnMeteredNetwork;
boolean? arcEnabled;
boolean? arcRemovableMediaAccessEnabled;
DOMString[]? folderShortcuts;
boolean? driveFsBulkPinningEnabled;
};
dictionary SearchParams {
// Search query.
DOMString query;
// The category of files to which the search is limited.
FileCategory? category;
// The minimum modified time of the files to be returned
double? modifiedTimestamp;
// 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.
DOMString nextFeed;
};
dictionary SearchMetadataParams {
// Optional root directory from which to start the search. If not present,
// the search begins at the local root.
[instanceOf=DirectoryEntry] object? rootDir;
// Search query. It can be empty. Any filename matches to an empty query.
DOMString query;
// The type of entry that is needed. Default to ALL.
SearchType types;
// Maximum number of results.
long maxResults;
// Modified timestamp. The file must have modified timestamp more recent
// than this to be included in results.
double? modifiedTimestamp;
// The category of files to which the search is limited.
FileCategory? category;
};
// Entry and Drive-related properties representing a search result.
dictionary DriveMetadataSearchResult {
// 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 <a
// href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
// interface</a>.
[instanceOf=Entry] object entry;
// The base name of a Drive file that matched the search query. The matched
// sub strings are highlighted with <b> element. Meta characters are escaped
// like <.
DOMString highlightedBaseName;
// Whether the file is available while offline. May be unset if not
// applicable.
boolean? availableOffline;
};
dictionary DriveConnectionState {
DriveConnectionStateType type;
// Reasons of offline.
DriveOfflineReason? reason;
};
// Device event dispatched to listeners of onDeviceChaged. See also
// DeviceEventType to know when the event dispatched.
dictionary DeviceEvent {
// Event type of the device event.
DeviceEventType type;
// Device path to identify the device.
DOMString devicePath;
// Human readable label for the device.
DOMString deviceLabel;
};
// Describes an installed provider.
dictionary Provider {
// ID of the provider.
DOMString providerId;
// Set of icons for the provider.
IconSet iconSet;
// Name of the provider.
DOMString name;
// Whether supports configuration dialog.
boolean configurable;
// Whether supports watching entries.
boolean watchable;
// Whether supports mounting multiple instances.
boolean multipleMounts;
// Source of file systems' data.
ProviderSource source;
};
// chrome/common/extensions/api/file_system_provider.idl:Action
// Information about an action for an entry.
dictionary FileSystemProviderAction {
// The identifier of the action. Any string or $(ref:CommonActionId) for
// common actions.
DOMString id;
// The title of the action. It may be ignored for common actions.
DOMString? title;
};
// Information about a Linux package in response to GetLinuxPackageInfo.
dictionary LinuxPackageInfo {
DOMString name;
DOMString version;
// A one-line summary of the project. Almost always present.
DOMString? summary;
// A longer description of the project. Almost always present.
DOMString? description;
};
// Payload data for crostini event.
dictionary CrostiniEvent {
// Is the event raised for enable, disable, share, or unshare.
CrostiniEventType eventType;
// VM that this event relates to.
DOMString vmName;
// Name of the container this event relates to.
DOMString containerName;
// Paths that have been shared or unshared.
[instanceOf=Entry] object[] entries;
};
dictionary CrostiniSharedPathResponse {
// Entries shared with crostini container.
[instanceOf=Entry] object[] entries;
// true the first time this is called for the session.
boolean firstForSession;
};
// Represents an Android app (activity).
dictionary AndroidApp {
// Name of the app to be shown to the user (e.g. Photos).
DOMString name;
// Package name (e.g. com.google.android.apps.photos).
DOMString packageName;
// Activity name (e.g. .PhotosPickerActivity).
DOMString activityName;
// App icon.
IconSet? iconSet;
};
dictionary StreamInfo {
// The stream type e.g., "mp3", "h264", "ogg".
DOMString type;
// An unfiltered string->string dictionary of tags from the stream.
object tags;
};
dictionary AttachedImages {
// Data encoded as a dataURL.
DOMString data;
// Data type.
DOMString type;
};
dictionary MediaMetadata {
// Content mime type.
DOMString mimeType;
// Defined for video. In pixels.
long? height;
long? width;
// Defined for audio and video. In seconds.
double? duration;
// Defined for video. In degrees.
long? rotation;
// Defined for audio and video.
DOMString? album;
DOMString? artist;
DOMString? comment;
DOMString? copyright;
long? disc;
DOMString? genre;
DOMString? language;
DOMString? title;
long? track;
// All the metadata in the media file. For formats with multiple streams,
// stream order is preserved. Container metadata is the first stream.
StreamInfo[] rawTags;
// Raw images embedded in the media file. This is most often audio album
// art or video thumbnails.
AttachedImages[] attachedImages;
};
dictionary HoldingSpaceState {
// File system URLs of items pinned to the holding space.
DOMString[] itemUrls;
};
dictionary OpenWindowParams {
// The desired target directory when opening a new window. If omitted Files
// app displays the default directory: MyFiles.
DOMString? currentDirectoryURL;
// The URL for a file or directory to be selected once a new window is
// spawned.
DOMString? selectionURL;
};
dictionary IoTaskParams {
// Destination folder for tasks that require one. Not required by |delete|
// task.
[instanceOf=DirectoryEntry] object? destinationFolder;
// Password used for unpacking encrypted archives.
DOMString? password;
// Whether to display a notification in the UI. This does not stop the
// IOProgressStatus event propagating instead it provides a true boolean on
// the event that the UI can choose to show / hide the notification.
boolean? showNotification;
};
// Holds information about data protection policy errors, see file_manager::io_task::PolicyError.
dictionary PolicyError {
// Type of the error.
PolicyErrorType type;
// The number of files blocked by the policy.
long policyFileCount;
// The name of the first blocked file. Used for notifications.
DOMString fileName;
// Normally the review button is only shown when `policyFileCount` is >1, this option allows to force
// the display of the review button irrespective of other conditions.
boolean alwaysShowReview;
};
// IO task state::PAUSED name conflict parameters, see file_manager::io_task::ConflictPauseParams.
dictionary ConflictPauseParams {
// The conflict file name.
DOMString? conflictName;
// True if the conflict file name is a directory.
boolean? conflictIsDirectory;
// Set true if there are potentially multiple conflicted file names.
boolean? conflictMultiple;
// The conflict copy or move target URL.
DOMString? conflictTargetUrl;
};
// IO task state::PAUSED policy parameters, see file_manager::io_task::PolicyPauseParams.
dictionary PolicyPauseParams {
// One of DLP or Enterprise Connectors.
PolicyErrorType type;
// The number of files under warning restriction.
long policyFileCount;
// The name of the first file under warning restriction. Used for notifications.
DOMString fileName;
// Normally the review button is only shown when `policyFileCount` is >1, this option allows to force
// the display of the review button irrespective of other conditions.
boolean alwaysShowReview;
};
// IO task state::PAUSED parameters, see file_manager::io_task::PauseParams.
dictionary PauseParams {
// Set iff pausing due to name conflict.
ConflictPauseParams? conflictParams;
// Set iff pausing due to policy.
PolicyPauseParams? policyParams;
};
// Resume IO Task parameters, see file_manager::io_task::ConflictResumeParams.
dictionary ConflictResumeParams {
// How to resolve a CopyOrMoveIOTask file name conflict: either 'keepboth'
// or 'replace'.
DOMString? conflictResolve;
// Set true if conflictResolve should apply to future file name conflicts.
boolean? conflictApplyToAll;
};
// Resume IO Task parameters, see file_manager::io_task::PolicyResumeParams.
dictionary PolicyResumeParams {
PolicyErrorType type;
};
// Resume IO Task parameters, see file_manager::io_task::ResumeParams.
dictionary ResumeParams {
// Set iff paused due to name conflict.
ConflictResumeParams? conflictParams;
// Set iff paused due to policy.
PolicyResumeParams? policyParams;
};
// IO Task Progress status, see file_manager::io_task::ProgressStatus.
dictionary ProgressStatus {
// Type of the task sending the progress.
IoTaskType type;
// Current state of the task sending the progress.
IoTaskState state;
// Type of policy error that occurred, if any.
// Used only if Data Leak Prevention or Enterprise Connectors policies apply.
PolicyError? policyError;
// Name of the first source entry.
DOMString sourceName;
// Number of remaining entries to be processed.
long numRemainingItems;
// Total number of entries to be processed.
long itemCount;
// Name of the destination folder for operations that transfer files to a
// directory (e.g. copy or move).
DOMString destinationName;
// ProgressStatus over all |sources|.
long bytesTransferred;
// Total size of all |sources|.
long totalBytes;
// The task id for this progress status.
long taskId;
// The estimate time to finish the operation.
double remainingSeconds;
// Number of sources scanned. Only used when in SCANNING state.
// When scanning files, the progress is roughly the percentage of the
// number of scanned items out of the total items. This isn't always
// accurate, e.g. when uploading entire folders or because some items
// are not scanned at all. The goal is to show the user that some
// progress is happening.
long sourcesScanned;
// Whether notifications should be shown on progress status.
boolean showNotification;
// The name of the last error that happened.
DOMString errorName;
// I/O task state::PAUSED parameters.
PauseParams? pauseParams;
// The files affected by the IOTask. Currently only returned for TrashIOTask.
[instanceOf=Entry] object[]? outputs;
// List of files skipped during the operation because we couldn't decrypt
// them.
DOMString[] skippedEncryptedFiles;
// Volume id of the destination for operations that transfer files to a
// directory (e.g. copy or move).
DOMString destinationVolumeId;
};
dictionary DlpMetadata {
// The source URL of the file, if it's been downloaded.
DOMString sourceUrl;
// True if there is any DLP policy on the file, false otherwise.
boolean isDlpRestricted;
// True if the file cannot be accessed by a specific destination,
// which is passed when collecting the metadata.
boolean isRestrictedForDestination;
};
dictionary DlpRestrictionDetails {
// The level for which the restriction is enforced.
DlpLevel level;
// List of URLs for which the restriction is enforced.
DOMString[] urls;
// List of components for which the restriction is enforced.
VolumeType[] components;
};
dictionary DialogCallerInformation {
// The URL of the caller.
DOMString? url;
// The component type of the caller.
VolumeType? component;
};
// A Guest OS that supports guest->host file sharing. This definition should
// match the one in file_manager_private.js.
dictionary MountableGuest {
// The ID of this guest, used to identify it in calls to the backend.
long id;
// The localised display name of this guest as e.g. shown in the sidebar.
DOMString displayName;
// The type of the VM backing this guest.
VmType vmType;
};
dictionary ParsedTrashInfoFile {
// The entry that the trashed file should be restored to. This does not exist
// but is used to identify whether the parent location still exists and
// identify the file name to restore to.
[instanceOf=Entry] object restoreEntry;
// The file name for the .trashinfo.
DOMString trashInfoFileName;
// The date the file was originally deleted.
double deletionDate;
};
// The current progress of the bulk pinning manager. This is a subset of the
// Progress struct in chromeos/ash/components/drivefs/drivefs_pinning_manager.h
dictionary BulkPinProgress {
// The stage the bulk pin manager is in.
BulkPinStage stage;
// Estimated amount of free space on the stateful partition in bytes.
double freeSpaceBytes;
// Estimated amount of free space required in order to successfully complete
// pinning.
double requiredSpaceBytes;
// Estimated amount of bytes remaining to be downloaded in order to
// successfully complete pinning.
double bytesToPin;
// Bytes that have been downloaded so far.
double pinnedBytes;
// Total number of files to pin.
long filesToPin;
// Show the total number of files enumerated during the Listing files stage.
long listedFiles;
// Estimated time remaining to pin all the `bytesToPin`.
double remainingSeconds;
// Should the bulk-pinning manager actually pin files, or should it stop after
// checking the space requirements?
boolean shouldPin;
// Has the bulk-pinning manager ever emptied its set of tracked items?
boolean emptiedQueue;
};
// Represents a custom view of files to be displayed.
dictionary MaterializedView {
// Unique indentifier for the view.
long viewId;
// Name of the view displayed to the user.
DOMString name;
};
// Used by EntryData to store the file system of the entry.
dictionary FileSystemData {
// Name of the file system. Will be unique.
DOMString name;
// File system URL of the root entry of the file system.
DOMString rootUrl;
};
// Representation of an entry as a replacement for File/Directory Entries.
dictionary EntryData {
// File system URL of the entry.
DOMString entryUrl;
// If false, the entry is a file.
boolean isDirectory;
// Localized name of the entry for display.
DOMString name;
// Information about the filesystem the entry is located in.
FileSystemData filesystem;
};
// Callback that does not take arguments.
callback SimpleCallback = void();
// |result| Boolean result returned by the invoked function.
callback BooleanCallback = void(boolean result);
// |result| Result of the task execution.
callback ExecuteTaskCallback = void(TaskResult result);
// |resultingTasks| The list of matched file entries for this task.
callback GetFileTasksCallback = void(ResultingTasks resultingTasks);
// |result| Mime type of the file.
callback GetMimeTypeCallback = void(DOMString result);
// |result| Content sniffed mime type of the file.
callback GetContentMimeTypeCallback = void(DOMString result);
// |result| Metadata of the Audio or Video file.
callback GetContentMetadataCallback = void(MediaMetadata result);
// |result| Hash containing the string assets.
callback GetStringsCallback = void(object result);
// |success| True when file watch is successfully added.
callback AddFileWatchCallback = void(optional boolean success);
// |success| True when file watch is successfully removed.
callback RemoveFileWatchCallback = void(optional boolean success);
// |entryProperties| A dictionary containing properties of the requested
// entries.
callback GetEntryPropertiesCallback =
void(EntryProperties[] entryProperties);
// |sourcePath| Source path of the mount.
callback AddMountCallback = void(DOMString sourcePath);
// |volumeMetadataList| The list of VolumeMetadata representing mounted volumes.
callback GetVolumeMetadataListCallback =
void(VolumeMetadata[] volumeMetadataList);
// |disallowedEntries| A list of files not allowed to be transfered.
callback GetDisallowedTransfersCallback =
void([instanceOf=Entry] object[] disallowedEntries);
// |dlpMetadata| A list of DlpMetadata containing DLP information about
// the entries.
callback GetDlpMetadataCallback =
void(DlpMetadata[] dlpMetadata);
// |restrictionDetails| A list of DlpRestrictionDetails containing
// summarized restriction information about an entry.
callback GetDlpRestrictionDetailsCallback =
void(DlpRestrictionDetails[] restrictionDetails);
// |blockedComponents| A list of components (subset of VolumeType) to which
// transferring an Entry is blocked by Data Leak Prevention (DLP) policy.
callback GetDlpBlockedComponentsCallback = void(VolumeType[] blockedComponents);
// |caller| Either the URL or a component (subset of VolumeType) of
// the caller that created the dialog (Save As/File Picker).
callback GetDialogCallerCallback = void(DialogCallerInformation caller);
// |taskId| ID of the task that was started. Can be used to cancel ongoing task.
callback IOTaskIdCallback = void(long taskId);
// |sizeStats| Name/value pairs of size stats. Will be undefined if stats could
// not be determined.
callback GetSizeStatsCallback = void(optional MountPointSizeStats sizeStats);
// |driveQuotaMetadata| Name/value pairs of drive quota metadata. Will be
// undefined if quota metadata could not be determined.
callback GetDriveQuotaMetadataCallback = void(optional DriveQuotaMetadata driveQuotaMetadata);
callback GetPreferencesCallback = void(Preferences result);
// |entries|
// |nextFeed| ID of the feed that contains next chunk of the search result.
// Should be sent to the next searchDrive request to perform
// incremental search.
callback SearchDriveCallback = void(SearchDriveResponse response);
callback SearchDriveMetadataCallback =
void(DriveMetadataSearchResult[] results);
callback SearchFilesCallback = void([instanceOf=Entry] object[] entries);
// |paths| A map of hash to array of drive paths. The array can be empty
// if the corresponding file is not found. However, the array will only
// contain at most one path per hash.
callback SearchFilesByHashesCallback = void(object paths);
callback GetDeviceConnectionStateCallback = void(DeviceConnectionState result);
callback GetDriveConnectionStateCallback = void(DriveConnectionState result);
// |result| true if the length is in the valid range, false otherwise.
callback ValidatePathNameLengthCallback = void(boolean result);
callback GetProfilesCallback = void(ProfilesResponse response);
// |entries| External entries.
callback ResolveEntriesCallback =
void([instanceOf=Entry] object[] entries);
// |checksum| Result checksum.
callback ComputeChecksumCallback = void(DOMString checksum);
// |extensions| List of providers.
callback GetProvidersCallback = void(Provider[] extensions);
// |actions| List of actions.
callback GetCustomActionsCallback = void(FileSystemProviderAction[] actions);
// |size| result size.
callback GetDirectorySizeCallback = void(double size);
// |entries| Recently modified entries.
callback GetRecentFilesCallback = void([instanceOf=Entry] object[] entries);
// |rootDir| The root directory of the volume to which access was requested.
callback GetVolumeRootCallback =
void([instanceOf=DirectoryEntry] object rootDir);
callback GetCrostiniSharedPathsCallback =
void(CrostiniSharedPathResponse response);
// |linux_package_info| Package info for the queried package.
callback GetLinuxPackageInfoCallback =
void(LinuxPackageInfo linux_package_info);
callback InstallLinuxPackageCallback = void(InstallLinuxPackageStatus status);
// |apps| List of Android picker apps.
callback GetAndroidPickerAppsCallback = void(AndroidApp[] apps);
// |state| Describes the current holding space state.
callback HoldingSpaceStateCallback = void(HoldingSpaceState state);
// |guests| List of Guest OSs which have available mounts.
callback ListMountableGuestsCallback = void(MountableGuest[] guest);
callback ParseTrashInfoFilesCallback = void(ParsedTrashInfoFile[] files);
callback GetBulkPinProgressCallback = void(BulkPinProgress progress);
callback GetMaterializedViewsCallback = void(MaterializedView[] views);
callback ReadMaterializedViewCallback = void(EntryData[] files);
interface Functions {
// Cancels file selection.
static void cancelDialog();
// Executes file browser task over selected files.
// |descriptor| The unique identifier of task to execute.
// |entries| Array of entries
// |callback|
[nocompile, doesNotSupportPromises]
static void executeTask(FileTaskDescriptor descriptor,
[instanceOf=Entry] object[] entries,
ExecuteTaskCallback callback);
// Sets the default task for the supplied MIME types and path extensions.
// Lists of MIME types and URLs may contain duplicates. Additionally, the
// list of MIME types can be empty.
// |descriptor| The unique identifier of task to mark as default.
// |entries| Array of selected entries to extract path extensions from.
// |mimeTypes| Array of selected file MIME types.
// |callback|
[nocompile, doesNotSupportPromises]
static void setDefaultTask(FileTaskDescriptor descriptor,
[instanceOf=Entry] object[] entries,
DOMString[] mimeTypes,
SimpleCallback callback);
// Gets the list of tasks that can be performed over selected files.
// |entries| Array of selected entries
// |dlpSourceUrls| Array of source URLs corresponding to the entries, used to
// check Data Leak Prevention (DLP) restrictions
// |callback|
[nocompile, doesNotSupportPromises]
static void getFileTasks([instanceOf=Entry] object[] entries,
DOMString[] dlpSourceUrls,
GetFileTasksCallback callback);
// Gets the MIME type of an entry.
// |entry| The entry to be checked.
// |callback|
static void getMimeType(DOMString url,
GetMimeTypeCallback callback);
// Gets the content sniffed MIME type of a file.
// |fileEntry| The file entry to be checked.
// |callback|
[nocompile, doesNotSupportPromises]
static void getContentMimeType([instanceOf=FileEntry] object fileEntry,
GetContentMimeTypeCallback callback);
// Gets metadata from an Audio or Video file.
// |fileEntry| The file entry to be checked.
// |mimeType| Content sniffed mimeType of the file.
// |includeImages| False returns metadata tags only. True returns
// metadata tags and metadata (thumbnail) images.
// |callback|
[nocompile, doesNotSupportPromises]
static void getContentMetadata([instanceOf=FileEntry] object fileEntry,
DOMString mimeType,
boolean includeImages,
GetContentMetadataCallback callback);
// Gets localized strings and initialization data.
// |callback|
[doesNotSupportPromises]
static void getStrings(GetStringsCallback callback);
// Adds file watch.
// |entry| Entry to watch
// |callback|
[nocompile, doesNotSupportPromises]
static void addFileWatch([instanceOf=Entry] object entry,
AddFileWatchCallback callback);
// Removes file watch.
// |entry| Watched entry
// |callback|
[nocompile, doesNotSupportPromises]
static void removeFileWatch([instanceOf=Entry] object entry,
RemoveFileWatchCallback callback);
// Enables the extenal file scheme necessary to initiate drags to the browser
// window for files on the external backend.
static void enableExternalFileScheme();
// Requests granting R/W permissions for the passed entries. It's a best
// effort operation. Some files may not be granted access if the url is
// invalid or not backed by the external file system.
// |entryUrls| Urls for the entries to be accessed.
// |callback|
[doesNotSupportPromises]
static void grantAccess(DOMString[] entryUrls, SimpleCallback callback);
// Selects multiple files.
// |selectedPaths| Array of selected paths
// |shouldReturnLocalPath| true if paths need to be resolved to local paths.
// |callback|
[doesNotSupportPromises]
static void selectFiles(DOMString[] selectedPaths,
boolean shouldReturnLocalPath,
SimpleCallback callback);
// Selects a file.
// |selectedPath| A selected path
// |index| Index of Filter
// |forOpening| true if paths are selected for opening. false if for saving.
// |shouldReturnLocalPath| true if paths need to be resolved to local paths.
// |callback|
[doesNotSupportPromises]
static void selectFile(DOMString selectedPath,
long index,
boolean forOpening,
boolean shouldReturnLocalPath,
SimpleCallback callback);
// Requests additional properties for files.
// |entries| list of entries
// |names| list of requested properties by their names.
// |callback| Completion callback. May return less than requested properties
// if some are not available. In the same time, it can return properties
// which were not requested (if it's cheap to compute them).
[nocompile, doesNotSupportPromises]
static void getEntryProperties(
[instanceOf=Entry] object[] entries,
EntryPropertyName[] names,
GetEntryPropertiesCallback callback);
// Pins/unpins a Drive file in the cache.
// |entry| Entry to pin/unpin.
// |pin| Pass true to pin the file.
// |callback| Completion callback. $(ref:runtime.lastError) will be set if
// there was an error.
[nocompile, doesNotSupportPromises]
static void pinDriveFile([instanceOf=Entry] object entry,
boolean pin,
SimpleCallback callback);
// Resolves entries in the isolated file system and returns corresponding
// entries in the external file system mounted to Chrome OS file manager
// backend. If resolving entry fails, the entry will be just ignored and the
// corresponding entry does not appear in the result.
[nocompile, doesNotSupportPromises]
static void resolveIsolatedEntries(
[instanceOf=Entry] object[] entries,
ResolveEntriesCallback callback);
// Mounts a resource or an archive.
// |fileUrl| Mount point source.
// |password| Optional password to decrypt the archive.
// |callback| Callback called with the source path of the mount.
[doesNotSupportPromises]
static void addMount(DOMString fileUrl, optional DOMString password,
AddMountCallback callback);
// Cancels an archive mounting operation.
// |fileUrl| Mount point source. Should be same as the one passed to addMount.
// |callback|
[doesNotSupportPromises]
static void cancelMounting(DOMString fileUrl, SimpleCallback callback);
// Unmounts a mounted resource.
// |volumeId| An ID of the volume.
[doesNotSupportPromises]
static void removeMount(DOMString volumeId, SimpleCallback callback);
// Get the list of mounted volumes.
// |callback|
[doesNotSupportPromises]
static void getVolumeMetadataList(GetVolumeMetadataListCallback callback);
// Returns the list of files not allowed to be transfered.
// |entries| List of the source entries to be transfered.
// |destinationEntry| Entry for the destination (parent) directory.
// |isMove| True if the operation is move, false otherwise.
// |callback| Result callback.
[nocompile, doesNotSupportPromises]
static void getDisallowedTransfers(
[instanceOf=Entry] object[] entries,
[instanceOf=DirectoryEntry] object destinationEntry,
boolean isMove,
GetDisallowedTransfersCallback callback);
// Returns the list of DlpMetadata containing DLP information
// about the entries.
// |entries| List of the source entries to be checked.
// |callback| Result callback.
[nocompile, doesNotSupportPromises]
static void getDlpMetadata(
[instanceOf=Entry] object[] entries,
GetDlpMetadataCallback callback);
// Retrieves Data Leak Prevention (DLP) restriction details.
// |sourceUrl| Source URL of the Entry for which the details should be shown.
// |callback| Result callback.
[doesNotSupportPromises]
static void getDlpRestrictionDetails(
DOMString sourceUrl,
GetDlpRestrictionDetailsCallback callback);
// Retrieves the list of components to which the transfer of an Entry
// is blocked by Data Leak Prevention (DLP) policy.
// |sourceUrl| Source URL of the Entry that should be checked.
// |callback| Result callback.
[doesNotSupportPromises]
static void getDlpBlockedComponents(
DOMString sourceUrl,
GetDlpBlockedComponentsCallback callback);
// Retrieves the caller that created the dialog (Save As/File Picker).
// |callback| Result callback.
[doesNotSupportPromises]
static void getDialogCaller(GetDialogCallerCallback callback);
// Retrieves total and remaining size of a mount point.
// |volumeId| ID of the volume to be checked.
// |callback|
[doesNotSupportPromises]
static void getSizeStats(DOMString volumeId, GetSizeStatsCallback callback);
// Retrieves metadata about the user's Drive volume's quota.
// |entry| If entry is within a Shared Drive, then the applicable shared
// drive quota is returned, else the overall Drive quota is returned.
// |callback|
[nocompile, doesNotSupportPromises]
static void getDriveQuotaMetadata([instanceOf=Entry] object entry,
GetDriveQuotaMetadataCallback callback);
// Formats a mounted volume.
// |volumeId| ID of the volume to be formatted.
// |filesystem| Filesystem type to be formatted to.
// |volumeLabel| Label of the drive after formatting.
static void formatVolume(DOMString volumeId,
FormatFileSystemType filesystem,
DOMString volumeLabel);
// Deletes partitions of removable device, creates a new partition and format
// it.
// |deviceStoragePath| Storage path of the device to be formatted.
// |filesystem| Filesystem type to be formatted to.
// |volumeLabel| Label of the drive after formatting.
static void singlePartitionFormat(DOMString deviceStoragePath,
FormatFileSystemType filesystem,
DOMString volumeLabel);
// Renames a mounted volume.
// |volumeId| ID of the volume to be renamed.
// |newName| New name of the target volume.
static void renameVolume(DOMString volumeId, DOMString newName);
// Retrieves file manager preferences.
// |callback|
[doesNotSupportPromises]
static void getPreferences(GetPreferencesCallback callback);
// Sets file manager preferences.
// |changeInfo|
static void setPreferences(PreferencesChange changeInfo);
// Performs drive content search.
// |searchParams|
// |callback|
[doesNotSupportPromises]
static void searchDrive(SearchParams searchParams,
SearchDriveCallback callback);
// Performs drive metadata search.
// |searchParams|
// |callback|
[doesNotSupportPromises]
static void searchDriveMetadata(SearchMetadataParams searchParams,
SearchDriveMetadataCallback callback);
// Search files in MyFiles.
[nocompile, doesNotSupportPromises]
static void searchFiles(SearchMetadataParams searchParams,
SearchFilesCallback callback);
// Retrieves the current device connection status.
// |callback|
[doesNotSupportPromises]
static void getDeviceConnectionState(GetDeviceConnectionStateCallback callback);
// Retrieves the state of the current drive connection.
// |callback|
[doesNotSupportPromises]
static void getDriveConnectionState(GetDriveConnectionStateCallback callback);
// Checks whether the path name length fits in the limit of the filesystem.
// |parentEntry| The entry of the parent directory entry.
// |name| The name of the file.
// |callback| Called back when the check is finished.
[nocompile, doesNotSupportPromises]
static void validatePathNameLength(
[instanceOf=DirectoryEntry] object parentEntry,
DOMString name,
ValidatePathNameLengthCallback callback);
// Changes the zoom factor of the Files app.
// |operation| Zooming mode.
static void zoom(ZoomOperationType operation);
// Obtains a list of profiles that are logged-in.
[doesNotSupportPromises]
static void getProfiles(GetProfilesCallback callback);
// Opens inspector window.
// |type| InspectionType which specifies how to open inspector.
static void openInspector(InspectionType type);
// Opens page in Settings window.
// |subPage| Name of a subPage to show.
static void openSettingsSubpage(DOMString subPage);
// Returns list of available providers.
[doesNotSupportPromises]
static void getProviders(GetProvidersCallback callback);
// Requests adding a new provided file system. On failure, sets
// $(ref:runtime.lastError).
[doesNotSupportPromises]
static void addProvidedFileSystem(DOMString providerId,
SimpleCallback callback);
// Requests configuring an existing volume. On failure, sets
// $(ref:runtime.lastError).
[doesNotSupportPromises]
static void configureVolume(DOMString volumeId, SimpleCallback callback);
// Requests list of custom actions for the specified entries. On failure, sets
// $(ref:runtime.lastError).
[nocompile, doesNotSupportPromises]
static void getCustomActions([instanceOf=Entry] object[] entries,
GetCustomActionsCallback callback);
// Executes a custom action for a set of entries. On failure, sets
// $(ref:runtime.lastError).
[nocompile, doesNotSupportPromises]
static void executeCustomAction([instanceOf=Entry] object[] entries,
DOMString actionId,
SimpleCallback callback);
// Get the total size of a directory.
// |entry| Entry of the target directory.
// |callback|
[nocompile, doesNotSupportPromises]
static void getDirectorySize([instanceOf=DirectoryEntry] object entry,
GetDirectorySizeCallback callback);
// Gets recently modified files across file systems.
// |restriction| Flag to restrict sources of recent files.
// |fileType| Requested file type to filter recent files.
// |query| When not empty, removes files with non-matching names.
// |cutoffDays| Specifies oldest modification time.
// |callback| Called with zero or more matched files.
[nocompile, doesNotSupportPromises]
static void getRecentFiles(SourceRestriction restriction,
DOMString query,
long cutoffDays,
FileCategory fileCategory,
boolean invalidateCache,
GetRecentFilesCallback callback);
// Requests the root directory of the volume with the ID specified in
// |options.volumeId|.
[nocompile, doesNotSupportPromises]
static void getVolumeRoot(GetVolumeRootOptions options,
GetVolumeRootCallback callback);
// Starts and mounts crostini container.
// |callback|
[doesNotSupportPromises]
static void mountCrostini(SimpleCallback callback);
// Shares paths with crostini container.
// |vmName| VM to share path with.
// |entries| Entries of the files or directories to share.
// |persist| If true, shares will persist across restarts.
// |callback|
[nocompile, doesNotSupportPromises]
static void sharePathsWithCrostini(DOMString vmName,
[instanceOf=Entry] object[] entries,
boolean persist,
SimpleCallback callback);
// Unshares path with crostini container.
// |vmName| VM to unshare path from.
// |entry| Entry of the file or directory to unshare.
// |callback|
[nocompile, doesNotSupportPromises]
static void unsharePathWithCrostini(DOMString vmName,
[instanceOf=Entry] object entry,
SimpleCallback callback);
// Returns list of paths shared with crostini container.
// |observeFirstForSession| If true, callback provides whether this is the
// |vmName| VM to get shared paths of.
// first time this function has been called with observeFirstForSession true.
[nocompile, doesNotSupportPromises]
static void getCrostiniSharedPaths(boolean observeFirstForSession,
DOMString vmName,
GetCrostiniSharedPathsCallback callback);
// Requests information about a Linux package. |entry| is a .deb file.
[nocompile, doesNotSupportPromises]
static void getLinuxPackageInfo([instanceOf=Entry] object entry,
GetLinuxPackageInfoCallback callback);
// Starts installation of a Linux package.
[nocompile, doesNotSupportPromises]
static void installLinuxPackage([instanceOf=Entry] object entry,
InstallLinuxPackageCallback callback);
// Imports a Crostini Image File (.tini). This overrides the existing Linux
// apps and files.
[nocompile]
static void importCrostiniImage([instanceOf=Entry] object entry);
// Returns a list of Android picker apps to be shown in file selector.
[doesNotSupportPromises]
static void getAndroidPickerApps(DOMString[] extensions,
GetAndroidPickerAppsCallback callback);
// Called when the user selects an Android picker app in file selector.
[doesNotSupportPromises]
static void selectAndroidPickerApp(AndroidApp androidApp,
SimpleCallback callback);
// Return true if sharesheet contains share targets for entries.
// |entries| Array of selected entries
// |callback| is called with error in case of failure and with no arguments
// if successfully launched the Sharesheet dialog, but before user has
// finished the sharing.
static void sharesheetHasTargets(DOMString[] fileUrls,
BooleanCallback callback);
// Invoke Sharesheet for selected files.
// |entries| Array of selected entries.
// |launchSource| Source from which sharesheet was invoked.
// |dlpSourceUrls| Array of source URLs corresponding to the entries, used to
// check Data Leak Prevention (DLP) restrictions
// |callback|
static void invokeSharesheet(DOMString[] fileUrls,
SharesheetLaunchSource launchSource,
DOMString[] dlpSourceUrls,
SimpleCallback callback);
// Adds or removes a list of entries to temporary holding space. Any entries
// whose current holding space state matches the intended state will be
// skipped.
// |entries| The list of entries whose holding space needs to be updated.
// |add| Whether items should be added or removed from the holding space.
// |callback| Completion callback.
[nocompile, doesNotSupportPromises]
static void toggleAddedToHoldingSpace([instanceOf=Entry] object[] entries,
boolean added,
optional SimpleCallback callback);
// Retrieves the current holding space state, for example the list of items
// the holding space currently contains.
// |callback| The result callback.
[doesNotSupportPromises]
static void getHoldingSpaceState(HoldingSpaceStateCallback callback);
// Returns true via `callback` if tablet mode is enabled, false otherwise.
[doesNotSupportPromises]
static void isTabletModeEnabled(BooleanCallback callback);
// Notifies the browser of the result of a dialog displayed earlier as a
// result of the onDriveConfirmDialog event.
static void notifyDriveDialogResult(DriveDialogResult result);
// Creates a new Files app window in the directory provided in `params`.
[doesNotSupportPromises]
static void openWindow(OpenWindowParams params, BooleanCallback callback);
// Opens the feedback report window.
static void sendFeedback();
// Starts an I/O task of type |type| on |entries|. Task type specific
// parameters are passed via |params|.
[nocompile, doesNotSupportPromises]
static void startIOTask(
IoTaskType type,
[instanceOf=Entry] object[] entries,
IoTaskParams params,
optional IOTaskIdCallback callback);
// Cancels an I/O task by id. Task ids are communicated to the Files App in
// each I/O task's progress status.
static void cancelIOTask(long taskId);
// Resumes an I/O task by id. Task ids are communicated to the Files App in
// each I/O task's progress status.
static void resumeIOTask(long taskId, ResumeParams params);
// Notifies the browser that any info still stored about an already completed
// I/O task identified by |taskId| can be cleared.
[doesNotSupportPromises]
static void dismissIOTask(long taskId, SimpleCallback callback);
// Shows a policy dialog for a task. Task ids are communicated to the Files
// App in each I/O task's progress status.
[doesNotSupportPromises]
static void showPolicyDialog(
long taskId,
PolicyDialogType type,
SimpleCallback callback);
// Makes I/O tasks in state::PAUSED emit (broadcast) their current I/O task
// progress status.
[doesNotSupportPromises]
static void progressPausedTasks(SimpleCallback callback);
// Lists mountable Guest OSs.
[doesNotSupportPromises]
static void listMountableGuests(ListMountableGuestsCallback callback);
// Starts and mounts the target Guest OS.
// |callback|
[doesNotSupportPromises]
static void mountGuest(long id, SimpleCallback callback);
// Tells DriveFS to update its cached pin states of hosted files (once).
static void pollDriveHostedFilePinStates();
// Opens the dialog to manage the currently syncing folders.
static void openManageSyncSettings();
// Validates and parses the supplied `entries` as .trashinfo files.
[nocompile, doesNotSupportPromises]
static void parseTrashInfoFiles([instanceOf=Entry] object[] entries,
ParseTrashInfoFilesCallback callback);
// Returns the current progress of the bulk pinning manager.
[doesNotSupportPromises]
static void getBulkPinProgress(GetBulkPinProgressCallback callback);
// Starts calculating the space required to pin all the items in a users My
// drive.
[doesNotSupportPromises]
static void calculateBulkPinRequiredSpace(SimpleCallback callback);
// Returns a list of views that can be displayed to the user.
static void getMaterializedViews(GetMaterializedViewsCallback callback);
// Returns the list of entries contained in the view identified by `viewId`.
static void readMaterializedView(long viewId,
ReadMaterializedViewCallback callback);
};
// Events supported by fileManagerPrivate API. These events are broadcasted.
// See the note at the top of the file with regards implications of event
// broadcasting to applications that can use fileManagerPrivate Event API.
interface Events {
static void onMountCompleted(MountCompletedEvent event);
static void onFileTransfersUpdated(FileTransferStatus event);
static void onPinTransfersUpdated(FileTransferStatus event);
static void onIndividualFileTransfersUpdated(SyncState[] event);
static void onDirectoryChanged(FileWatchEvent event);
static void onPreferencesChanged();
static void onDeviceConnectionStatusChanged(DeviceConnectionState state);
static void onDriveConnectionStatusChanged();
static void onDeviceChanged(DeviceEvent event);
static void onDriveSyncError(DriveSyncErrorEvent event);
static void onDriveConfirmDialog(DriveConfirmDialogEvent event);
static void onAppsUpdated();
static void onCrostiniChanged(CrostiniEvent event);
static void onTabletModeChanged(boolean enabled);
static void onIOTaskProgressStatus(ProgressStatus status);
// Event broadcast when the list of Guest OSs that support Guest->Host file
// sharing changes.
static void onMountableGuestsChanged(MountableGuest[] guests);
static void onBulkPinProgress(BulkPinProgress progress);
};
};
|