OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** @fileoverview Externs generated from namespace: fileManagerPrivate */ |
| 6 |
| 7 /** |
| 8 * @typedef {{ |
| 9 * scale1xUrl: string, |
| 10 * scale2xUrl: string |
| 11 * }} |
| 12 */ |
| 13 var ImageSet; |
| 14 |
| 15 /** |
| 16 * @typedef {{ |
| 17 * taskId: string, |
| 18 * title: string, |
| 19 * iconUrl: string, |
| 20 * isDefault: boolean |
| 21 * }} |
| 22 */ |
| 23 var FileTask; |
| 24 |
| 25 /** |
| 26 * @typedef {{ |
| 27 * fileSize: (number|undefined), |
| 28 * lastModifiedTime: (number|undefined), |
| 29 * thumbnailUrl: (string|undefined), |
| 30 * imageWidth: (number|undefined), |
| 31 * imageHeight: (number|undefined), |
| 32 * imageRotation: (number|undefined), |
| 33 * isPinned: (boolean|undefined), |
| 34 * isPresent: (boolean|undefined), |
| 35 * isHosted: (boolean|undefined), |
| 36 * isAvailableOffline: (boolean|undefined), |
| 37 * isAvailableWhenMetered: (boolean|undefined), |
| 38 * customIconUrl: (string|undefined), |
| 39 * contentMimeType: (string|undefined), |
| 40 * sharedWithMe: (boolean|undefined), |
| 41 * shared: (boolean|undefined) |
| 42 * }} |
| 43 */ |
| 44 var EntryProperties; |
| 45 |
| 46 /** |
| 47 * @typedef {{ |
| 48 * totalSize: number, |
| 49 * remainingSize: number |
| 50 * }} |
| 51 */ |
| 52 var MountPointSizeStats; |
| 53 |
| 54 /** |
| 55 * @typedef {{ |
| 56 * profileId: string, |
| 57 * displayName: string, |
| 58 * isCurrentProfile: boolean |
| 59 * }} |
| 60 */ |
| 61 var ProfileInfo; |
| 62 |
| 63 /** |
| 64 * @typedef {{ |
| 65 * volumeId: string, |
| 66 * fileSystemId: (string|undefined), |
| 67 * extensionId: (string|undefined), |
| 68 * volumeLabel: (string|undefined), |
| 69 * profile: ProfileInfo, |
| 70 * sourcePath: (string|undefined), |
| 71 * volumeType: string, |
| 72 * deviceType: (string|undefined), |
| 73 * devicePath: (string|undefined), |
| 74 * isParentDevice: (boolean|undefined), |
| 75 * isReadOnly: boolean, |
| 76 * mountCondition: (string|undefined) |
| 77 * }} |
| 78 */ |
| 79 var VolumeMetadata; |
| 80 |
| 81 /** |
| 82 * @typedef {{ |
| 83 * eventType: string, |
| 84 * status: string, |
| 85 * volumeMetadata: VolumeMetadata, |
| 86 * shouldNotify: boolean |
| 87 * }} |
| 88 */ |
| 89 var MountCompletedEvent; |
| 90 |
| 91 /** |
| 92 * @typedef {{ |
| 93 * fileUrl: string, |
| 94 * transferState: string, |
| 95 * transferType: string, |
| 96 * processed: (number|undefined), |
| 97 * total: (number|undefined), |
| 98 * num_total_jobs: number |
| 99 * }} |
| 100 */ |
| 101 var FileTransferStatus; |
| 102 |
| 103 /** |
| 104 * @typedef {{ |
| 105 * type: string, |
| 106 * fileUrl: string |
| 107 * }} |
| 108 */ |
| 109 var DriveSyncErrorEvent; |
| 110 |
| 111 /** |
| 112 * @typedef {{ |
| 113 * type: string, |
| 114 * sourceUrl: (string|undefined), |
| 115 * destinationUrl: (string|undefined), |
| 116 * size: (number|undefined), |
| 117 * error: (string|undefined) |
| 118 * }} |
| 119 */ |
| 120 var CopyProgressStatus; |
| 121 |
| 122 /** |
| 123 * @typedef {{ |
| 124 * fileUrl: string, |
| 125 * canceled: boolean |
| 126 * }} |
| 127 */ |
| 128 var FileTransferCancelStatus; |
| 129 |
| 130 /** |
| 131 * @typedef {{ |
| 132 * url: string, |
| 133 * changes: Array |
| 134 * }} |
| 135 */ |
| 136 var FileChange; |
| 137 |
| 138 /** |
| 139 * @typedef {{ |
| 140 * eventType: string, |
| 141 * entry: Object, |
| 142 * changedFiles: (Array|undefined) |
| 143 * }} |
| 144 */ |
| 145 var FileWatchEvent; |
| 146 |
| 147 /** |
| 148 * @typedef {{ |
| 149 * driveEnabled: boolean, |
| 150 * cellularDisabled: boolean, |
| 151 * hostedFilesDisabled: boolean, |
| 152 * use24hourClock: boolean, |
| 153 * allowRedeemOffers: boolean |
| 154 * }} |
| 155 */ |
| 156 var Preferences; |
| 157 |
| 158 /** |
| 159 * @typedef {{ |
| 160 * cellularDisabled: (boolean|undefined), |
| 161 * hostedFilesDisabled: (boolean|undefined) |
| 162 * }} |
| 163 */ |
| 164 var PreferencesChange; |
| 165 |
| 166 /** |
| 167 * @typedef {{ |
| 168 * query: string, |
| 169 * nextFeed: string |
| 170 * }} |
| 171 */ |
| 172 var SearchParams; |
| 173 |
| 174 /** |
| 175 * @typedef {{ |
| 176 * query: string, |
| 177 * types: string, |
| 178 * maxResults: number |
| 179 * }} |
| 180 */ |
| 181 var SearchMetadataParams; |
| 182 |
| 183 /** |
| 184 * @typedef {{ |
| 185 * entry: Object, |
| 186 * highlightedBaseName: string |
| 187 * }} |
| 188 */ |
| 189 var SearchResult; |
| 190 |
| 191 /** |
| 192 * @typedef {{ |
| 193 * type: string, |
| 194 * reason: (string|undefined) |
| 195 * }} |
| 196 */ |
| 197 var DriveConnectionState; |
| 198 |
| 199 /** |
| 200 * @typedef {{ |
| 201 * type: string, |
| 202 * devicePath: string |
| 203 * }} |
| 204 */ |
| 205 var DeviceEvent; |
| 206 |
| 207 /** |
| 208 * @const |
| 209 */ |
| 210 chrome.fileManagerPrivate = {}; |
| 211 |
| 212 /** |
| 213 * Logout the current user for navigating to the re-authentication screen for |
| 214 * the Google account. |
| 215 */ |
| 216 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {}; |
| 217 |
| 218 /** |
| 219 * Cancels file selection. |
| 220 */ |
| 221 chrome.fileManagerPrivate.cancelDialog = function() {}; |
| 222 |
| 223 /** |
| 224 * Executes file browser task over selected files. |taskId| The unique |
| 225 * identifier of task to execute. |fileUrls| Array of file URLs |callback| |
| 226 * @param {string} taskId |
| 227 * @param {Array} fileUrls |
| 228 * @param {Function=} callback |result| Result of the task execution. |
| 229 */ |
| 230 chrome.fileManagerPrivate.executeTask = function(taskId, fileUrls, callback) {}; |
| 231 |
| 232 /** |
| 233 * Sets the default task for the supplied MIME types and suffixes of the |
| 234 * supplied file URLs. Lists of MIME types and URLs may contain duplicates. |
| 235 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array |
| 236 * of selected file URLs to extract suffixes from. |mimeTypes| Array of |
| 237 * selected file MIME types. |callback| |
| 238 * @param {string} taskId |
| 239 * @param {Array} fileUrls |
| 240 * @param {Array=} mimeTypes |
| 241 * @param {Function=} callback Callback that does not take arguments. |
| 242 */ |
| 243 chrome.fileManagerPrivate.setDefaultTask = function(taskId, fileUrls, mimeTypes,
callback) {}; |
| 244 |
| 245 /** |
| 246 * Gets the list of tasks that can be performed over selected files. |fileUrls| |
| 247 * Array of selected file URLs |callback| |
| 248 * @param {Array} fileUrls |
| 249 * @param {Function} callback |tasks| The list of matched file URL patterns for |
| 250 * this task. |
| 251 */ |
| 252 chrome.fileManagerPrivate.getFileTasks = function(fileUrls, callback) {}; |
| 253 |
| 254 /** |
| 255 * Gets localized strings and initialization data. |callback| |
| 256 * @param {Function} callback |result| Hash containing the string assets. |
| 257 */ |
| 258 chrome.fileManagerPrivate.getStrings = function(callback) {}; |
| 259 |
| 260 /** |
| 261 * Adds file watch. |fileUrl| URL of file to watch |callback| |
| 262 * @param {string} fileUrl |
| 263 * @param {Function} callback |success| True when file watch is successfully |
| 264 * added. |
| 265 */ |
| 266 chrome.fileManagerPrivate.addFileWatch = function(fileUrl, callback) {}; |
| 267 |
| 268 /** |
| 269 * Removes file watch. |fileUrl| URL of watched file to remove |callback| |
| 270 * @param {string} fileUrl |
| 271 * @param {Function} callback |success| True when file watch is successfully |
| 272 * removed. |
| 273 */ |
| 274 chrome.fileManagerPrivate.removeFileWatch = function(fileUrl, callback) {}; |
| 275 |
| 276 /** |
| 277 * Requests access to a file system volume. |volumeId| The ID of the file |
| 278 * system volume to request. The volume ID is delivered to JavaScript as |
| 279 * part of VolumeMetadata. By specifying "compatible", this function |
| 280 * behaves in the compatible mode, where the returned FileSystem object |
| 281 * gives access to all file system volumes such as Downloads folder and |
| 282 * removal media like SD cards (i.e. all volumes are provided inside the |
| 283 * single FileSystem object). In the new "per-volume FileSystem object |
| 284 * model" crbug.com/322305, a separate FileSystem object is created for |
| 285 * each volume. "compatible" parameter will be removed once Files.app is |
| 286 * switched to the per-volume FileSystem object model. |callback| |
| 287 * @param {string} volumeId |
| 288 * @param {Function} callback |fileSystem| A DOMFileSystem instance for local |
| 289 * file system access. null if the caller has no appropriate permissions. |
| 290 */ |
| 291 chrome.fileManagerPrivate.requestFileSystem = function(volumeId, callback) {}; |
| 292 |
| 293 /** |
| 294 * Selects multiple files. |selectedPaths| Array of selected paths |
| 295 * |shouldReturnLocalPath| true if paths need to be resolved to local paths. |
| 296 * |callback| |
| 297 * @param {Array} selectedPaths |
| 298 * @param {boolean} shouldReturnLocalPath |
| 299 * @param {Function} callback Callback that does not take arguments. |
| 300 */ |
| 301 chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLoca
lPath, callback) {}; |
| 302 |
| 303 /** |
| 304 * Selects a file. |selectedPath| A selected path |index| Index of Filter |
| 305 * |forOpening| true if paths are selected for opening. false if for saving. |
| 306 * |shouldReturnLocalPath| true if paths need to be resolved to local paths. |
| 307 * |callback| |
| 308 * @param {string} selectedPath |
| 309 * @param {number} index |
| 310 * @param {boolean} forOpening |
| 311 * @param {boolean} shouldReturnLocalPath |
| 312 * @param {Function} callback Callback that does not take arguments. |
| 313 */ |
| 314 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening,
shouldReturnLocalPath, callback) {}; |
| 315 |
| 316 /** |
| 317 * Requests additional properties for files. |fileUrls| list of URLs of files |
| 318 * |callback| |
| 319 * @param {Array} fileUrls |
| 320 * @param {Function} callback |entryProperties| A dictionary containing |
| 321 * properties of the requested entries. |
| 322 */ |
| 323 chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, callback) {}; |
| 324 |
| 325 /** |
| 326 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin. |
| 327 * |pin| Pass true to pin the file. |callback| Completion callback. |
| 328 * $(ref:runtime.lastError) will be set if there was an error. |
| 329 * @param {string} fileUrl |
| 330 * @param {boolean} pin |
| 331 * @param {Function=} callback Callback that does not take arguments. |
| 332 */ |
| 333 chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {}; |
| 334 |
| 335 /** |
| 336 * Resolves file entries in the isolated file system and returns corresponding |
| 337 * entries in the external file system mounted to Chrome OS file manager |
| 338 * backend. If resolving entry fails, the entry will be just ignored and the |
| 339 * corresponding entry does not appear in the result. |
| 340 * @param {Array} entries |
| 341 * @param {Function} callback |entryUrl| URL of an entry in a normal file |
| 342 * system. |
| 343 */ |
| 344 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {
}; |
| 345 |
| 346 /** |
| 347 * Mount a resource or a file. |source| Mount point source. For compressed |
| 348 * files it is relative file path within external file system |callback| |
| 349 * @param {string} source |
| 350 * @param {Function} callback |sourcePath| Source path of the mount. |
| 351 */ |
| 352 chrome.fileManagerPrivate.addMount = function(source, callback) {}; |
| 353 |
| 354 /** |
| 355 * Unmounts a mounted resource. |volumeId| An ID of the volume. |
| 356 * @param {string} volumeId |
| 357 */ |
| 358 chrome.fileManagerPrivate.removeMount = function(volumeId) {}; |
| 359 |
| 360 /** |
| 361 * Get the list of mounted volumes. |callback| |
| 362 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata |
| 363 * representing mounted volumes. |
| 364 */ |
| 365 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {}; |
| 366 |
| 367 /** |
| 368 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files |
| 369 * for which ongoing transfer should be canceled. If this is absent, all |
| 370 * jobs are canceled. |callback| |
| 371 * @param {Array=} fileUrls |
| 372 * @param {Function=} callback |fileTransferCancelStatuses| The list of |
| 373 * FileTransferCancelStatus. |
| 374 */ |
| 375 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {}; |
| 376 |
| 377 /** |
| 378 * Starts to copy an entry. If the source is a directory, the copy is done |
| 379 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL |
| 380 * of the destination directory. |newName| Name of the new entry. It shouldn't |
| 381 * contain '/'. |callback| Completion callback. |
| 382 * @param {string} sourceUrl |
| 383 * @param {string} parent |
| 384 * @param {string} newName |
| 385 * @param {Function} callback |copyId| ID of the copy task. Can be used to |
| 386 * identify the progress, and to cancel the task. |
| 387 */ |
| 388 chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callb
ack) {}; |
| 389 |
| 390 /** |
| 391 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled. |
| 392 * |callback| Completion callback of the cancel. |
| 393 * @param {number} copyId |
| 394 * @param {Function=} callback Callback that does not take arguments. |
| 395 */ |
| 396 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {}; |
| 397 |
| 398 /** |
| 399 * Retrieves total and remaining size of a mount point. |volumeId| ID of the |
| 400 * volume to be checked. |callback| |
| 401 * @param {string} volumeId |
| 402 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will |
| 403 * be undefined if stats could not be determined. |
| 404 */ |
| 405 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {}; |
| 406 |
| 407 /** |
| 408 * Formats a mounted volume. |volumeId| ID of the volume to be formatted. |
| 409 * @param {string} volumeId |
| 410 */ |
| 411 chrome.fileManagerPrivate.formatVolume = function(volumeId) {}; |
| 412 |
| 413 /** |
| 414 * Retrieves file manager preferences. |callback| |
| 415 * @param {Function} callback |
| 416 */ |
| 417 chrome.fileManagerPrivate.getPreferences = function(callback) {}; |
| 418 |
| 419 /** |
| 420 * Sets file manager preferences. |changeInfo| |
| 421 * @param {PreferencesChange} changeInfo |
| 422 */ |
| 423 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {}; |
| 424 |
| 425 /** |
| 426 * Performs drive content search. |searchParams| |callback| |
| 427 * @param {SearchParams} searchParams |
| 428 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains |
| 429 * next chunk of the search result. Should be sent to the next searchDrive |
| 430 * request to perform incremental search. |
| 431 */ |
| 432 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {}; |
| 433 |
| 434 /** |
| 435 * Performs drive metadata search. |searchParams| |callback| |
| 436 * @param {SearchMetadataParams} searchParams |
| 437 * @param {Function} callback |
| 438 */ |
| 439 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback)
{}; |
| 440 |
| 441 /** |
| 442 * Create a zip file for the selected files. |dirURL| URL of the directory |
| 443 * containing the selected files. |selectionUrls| URLs of the selected files. |
| 444 * The files must be under the directory specified by dirURL. |destName| |
| 445 * Name of the destination zip file. The zip file will be created under the |
| 446 * directory specified by dirURL. |callback| |
| 447 * @param {string} dirURL |
| 448 * @param {Array} selectionUrls |
| 449 * @param {string} destName |
| 450 * @param {Function=} callback |
| 451 */ |
| 452 chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destNam
e, callback) {}; |
| 453 |
| 454 /** |
| 455 * Retrieves the state of the current drive connection. |callback| |
| 456 * @param {Function} callback |
| 457 */ |
| 458 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {}; |
| 459 |
| 460 /** |
| 461 * Checks whether the path name length fits in the limit of the filesystem. |
| 462 * |parent_directory_url| The URL of the parent directory entry. |name| The |
| 463 * name of the file. |callback| Called back when the check is finished. |
| 464 * @param {string} parent_directory_url |
| 465 * @param {string} name |
| 466 * @param {Function} callback |result| true if the length is in the valid |
| 467 * range, false otherwise. |
| 468 */ |
| 469 chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url
, name, callback) {}; |
| 470 |
| 471 /** |
| 472 * Changes the zoom factor of the Files.app. |operation| Zooming mode. |
| 473 * @param {string} operation |
| 474 */ |
| 475 chrome.fileManagerPrivate.zoom = function(operation) {}; |
| 476 |
| 477 /** |
| 478 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should |
| 479 * be refetched instead of using the cached one. |callback| |
| 480 * @param {boolean} refresh |
| 481 * @param {Function} callback |accessToken| OAuth2 access token, or an empty |
| 482 * string if failed to fetch. |
| 483 */ |
| 484 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {}; |
| 485 |
| 486 /** |
| 487 * Requests a Webstore API OAuth2 access token. |callback| |
| 488 * @param {Function} callback |accessToken| OAuth2 access token, or an empty |
| 489 * string if failed to fetch. |
| 490 */ |
| 491 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {}; |
| 492 |
| 493 /** |
| 494 * Requests a share dialog url for the specified file. |url| Url for the file. |
| 495 * |callback| |
| 496 * @param {string} url |
| 497 * @param {Function} callback |url| Result url. |
| 498 */ |
| 499 chrome.fileManagerPrivate.getShareUrl = function(url, callback) {}; |
| 500 |
| 501 /** |
| 502 * Requests a download url to download the file contents. |url| Url for the |
| 503 * file. |callback| |
| 504 * @param {string} url |
| 505 * @param {Function} callback |url| Result url. |
| 506 */ |
| 507 chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {}; |
| 508 |
| 509 /** |
| 510 * Requests to share drive files. |url| URL of a file to be shared. |shareType| |
| 511 * Type of access that is getting granted. |
| 512 * @param {string} url |
| 513 * @param {string} shareType |
| 514 * @param {Function} callback Callback that does not take arguments. |
| 515 */ |
| 516 chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback)
{}; |
| 517 |
| 518 /** |
| 519 * Requests to install a webstore item. |item_id| The id of the item to |
| 520 * install. |silentInstallation| False to show installation prompt. True not to |
| 521 * show. |callback| |
| 522 * @param {string} itemId |
| 523 * @param {boolean} silentInstallation |
| 524 * @param {Function} callback Callback that does not take arguments. |
| 525 */ |
| 526 chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallat
ion, callback) {}; |
| 527 |
| 528 /** |
| 529 * Obtains a list of profiles that are logged-in. |
| 530 * @param {Function} callback |profiles| List of profile information. |
| 531 * |runningProfile| ID of the profile that runs the application instance. |
| 532 * |showingProfile| ID of the profile that shows the application window. |
| 533 */ |
| 534 chrome.fileManagerPrivate.getProfiles = function(callback) {}; |
| 535 |
| 536 /** |
| 537 * Moves the window to other user's desktop. |
| 538 * @param {string} profileId |
| 539 * @param {Function=} callback Callback that does not take arguments. |
| 540 */ |
| 541 chrome.fileManagerPrivate.visitDesktop = function(profileId, callback) {}; |
| 542 |
| 543 /** |
| 544 * Opens inspector window. |type| InspectionType which specifies how to open |
| 545 * inspector. |
| 546 * @param {string} type |
| 547 */ |
| 548 chrome.fileManagerPrivate.openInspector = function(type) {}; |
| 549 |
| 550 /** @type {!ChromeEvent} */ |
| 551 chrome.fileManagerPrivate.onMountCompleted; |
| 552 |
| 553 /** @type {!ChromeEvent} */ |
| 554 chrome.fileManagerPrivate.onFileTransfersUpdated; |
| 555 |
| 556 /** @type {!ChromeEvent} */ |
| 557 chrome.fileManagerPrivate.onCopyProgress; |
| 558 |
| 559 /** @type {!ChromeEvent} */ |
| 560 chrome.fileManagerPrivate.onDirectoryChanged; |
| 561 |
| 562 /** @type {!ChromeEvent} */ |
| 563 chrome.fileManagerPrivate.onPreferencesChanged; |
| 564 |
| 565 /** @type {!ChromeEvent} */ |
| 566 chrome.fileManagerPrivate.onDriveConnectionStatusChanged; |
| 567 |
| 568 /** @type {!ChromeEvent} */ |
| 569 chrome.fileManagerPrivate.onDeviceChanged; |
| 570 |
| 571 /** @type {!ChromeEvent} */ |
| 572 chrome.fileManagerPrivate.onDriveSyncError; |
| 573 |
| 574 |
OLD | NEW |