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.
5 /** @fileoverview Externs generated from namespace: fileManagerPrivate */
19 * size: (number|undefined),
20 * modificationTime: (number|undefined),
21 * thumbnailUrl: (string|undefined),
22 * croppedThumbnailUrl: (string|undefined),
23 * externalFileUrl: (string|undefined),
24 * imageWidth: (number|undefined),
25 * imageHeight: (number|undefined),
26 * imageRotation: (number|undefined),
27 * pinned: (boolean|undefined),
28 * present: (boolean|undefined),
29 * hosted: (boolean|undefined),
30 * dirty: (boolean|undefined),
31 * availableOffline: (boolean|undefined),
32 * availableWhenMetered: (boolean|undefined),
33 * customIconUrl: (string|undefined),
34 * contentMimeType: (string|undefined),
35 * sharedWithMe: (boolean|undefined),
36 * shared: (boolean|undefined)
44 * remainingSize: number
47 var MountPointSizeStats;
52 * displayName: string,
53 * isCurrentProfile: boolean
61 * fileSystemId: (string|undefined),
62 * extensionId: (string|undefined),
64 * volumeLabel: (string|undefined),
65 * profile: ProfileInfo,
66 * sourcePath: (string|undefined),
68 * deviceType: (string|undefined),
69 * devicePath: (string|undefined),
70 * isParentDevice: (boolean|undefined),
71 * isReadOnly: boolean,
73 * configurable: boolean,
75 * mountCondition: (string|undefined),
76 * mountContext: (string|undefined)
85 * volumeMetadata: VolumeMetadata,
86 * shouldNotify: boolean
89 var MountCompletedEvent;
94 * transferState: string,
95 * transferType: string,
98 * num_total_jobs: number
101 var FileTransferStatus;
109 var DriveSyncErrorEvent;
114 * sourceUrl: (string|undefined),
115 * destinationUrl: (string|undefined),
116 * size: (number|undefined),
117 * error: (string|undefined)
120 var CopyProgressStatus;
134 * changedFiles: (Array|undefined)
141 * driveEnabled: boolean,
142 * cellularDisabled: boolean,
143 * hostedFilesDisabled: boolean,
144 * searchSuggestEnabled: boolean,
145 * use24hourClock: boolean,
146 * allowRedeemOffers: boolean
153 * cellularDisabled: (boolean|undefined),
154 * hostedFilesDisabled: (boolean|undefined)
157 var PreferencesChange;
174 var SearchMetadataParams;
179 * highlightedBaseName: string
187 * reason: (string|undefined)
190 var DriveConnectionState;
202 * extensionId: string,
204 * configurable: boolean,
205 * watchable: boolean,
206 * multipleMounts: boolean,
210 var ProvidingExtension;
215 * title: (string|undefined)
223 chrome.fileManagerPrivate = {};
226 * Logout the current user for navigating to the re-authentication screen for
227 * the Google account.
229 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
232 * Cancels file selection.
234 chrome.fileManagerPrivate.cancelDialog = function() {};
237 * Executes file browser task over selected files. |taskId| The unique
238 * identifier of task to execute. |entries| Array of file entries |callback|
239 * @param {string} taskId
240 * @param {!Array<!Entry>} entries
241 * @param {function((boolean|undefined))} callback |result| Result of the task
244 chrome.fileManagerPrivate.executeTask = function(taskId, entries, callback) {};
247 * Sets the default task for the supplied MIME types and path extensions.
248 * Lists of MIME types and URLs may contain duplicates.
249 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array
250 * of selected file URLs to extract path extensions from. |mimeTypes| Array of
251 * selected file MIME types. |callback|
252 * @param {string} taskId
253 * @param {!Array<!Entry>} entries
254 * @param {!Array<string>} mimeTypes
255 * @param {!function()} callback Callback that does not take arguments.
257 chrome.fileManagerPrivate.setDefaultTask = function(taskId, entries, mimeTypes,
261 * Gets the list of tasks that can be performed over selected files. |entries|
262 * Array of selected entries |callback|
263 * @param {!Array<!Entry>} entries
264 * @param {function((!Array<!FileTask>|undefined))} callback |tasks| The list of
265 * matched file URL patterns for this task.
267 chrome.fileManagerPrivate.getFileTasks = function(entries, callback) {};
270 * Gets localized strings and initialization data. |callback|
271 * @param {function((!Object|undefined))} callback |result| Hash containing the
274 chrome.fileManagerPrivate.getStrings = function(callback) {};
277 * Adds file watch. |entry| Entry of file to watch |callback|
278 * @param {!Entry} entry
279 * @param {function((boolean|undefined))} callback |success| True when file
280 * watch is successfully added.
282 chrome.fileManagerPrivate.addFileWatch = function(entry, callback) {};
285 * Removes file watch. |entry| Entry of watched file to remove |callback|
286 * @param {!Entry} entry
287 * @param {function((boolean|undefined))} callback |success| True when file
288 * watch is successfully
291 chrome.fileManagerPrivate.removeFileWatch = function(entry, callback) {};
294 * Enables the extenal file scheme necessary to initiate drags to the browser
295 * window for files on the external backend.
297 chrome.fileManagerPrivate.enableExternalFileScheme = function() {};
300 * Requests R/W access to the specified entries as |entryUrls|. Note, that only
301 * files backed by external file system backend will be granted the access.
302 * @param {!Array<string>} entryUrls
303 * @param {function()} callback Completion callback.
305 chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};
308 * Selects multiple files. |selectedPaths| Array of selected paths
309 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
311 * @param {!Array<string>} selectedPaths
312 * @param {boolean} shouldReturnLocalPath
313 * @param {function()} callback Callback that does not take arguments.
315 chrome.fileManagerPrivate.selectFiles = function(selectedPaths,
316 shouldReturnLocalPath, callback) {};
319 * Selects a file. |selectedPath| A selected path |index| Index of Filter
320 * |forOpening| true if paths are selected for opening. false if for saving.
321 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
323 * @param {string} selectedPath
324 * @param {number} index
325 * @param {boolean} forOpening
326 * @param {boolean} shouldReturnLocalPath
327 * @param {function()} callback Callback that does not take arguments.
329 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening,
330 shouldReturnLocalPath, callback) {};
333 * Requests additional properties for files. |fileUrls| list of URLs of files
335 * @param {!Array<!Entry>} entries
336 * @param {!Array<string>} names
337 * @param {function((!Array<!EntryProperties>|undefined))} callback
338 * |entryProperties| A dictionary containing properties of the requested
341 chrome.fileManagerPrivate.getEntryProperties = function(entries, names,
345 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
346 * |pin| Pass true to pin the file. |callback| Completion callback.
347 * $(ref:runtime.lastError) will be set if there was an error.
348 * @param {!Entry} entry
349 * @param {boolean} pin
350 * @param {function()} callback Callback that does not take arguments.
352 chrome.fileManagerPrivate.pinDriveFile = function(entry, pin, callback) {};
355 * Resolves file entries in the isolated file system and returns corresponding
356 * entries in the external file system mounted to Chrome OS file manager
357 * backend. If resolving entry fails, the entry will be just ignored and the
358 * corresponding entry does not appear in the result.
359 * @param {!Array<!Entry>} entries
360 * @param {function((!Array<!Entry>|undefined))} callback Completion callback
361 * with resolved entries.
363 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries,
367 * Mount a resource or a file. |source| Mount point source. For compressed
368 * files it is relative file path within external file system |callback|
369 * @param {string} source
370 * @param {function((string|undefined))} callback Callback with source path of
373 chrome.fileManagerPrivate.addMount = function(source, callback) {};
376 * Unmounts a mounted resource. |volumeId| An ID of the volume.
377 * @param {string} volumeId
379 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
382 * Get the list of mounted volumes. |callback|
383 * @param {function((!Array<!VolumeMetadata>|undefined))} callback Callback with
384 * the list of VolumeMetadata representing mounted volumes.
386 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
389 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
390 * for which ongoing transfer should be canceled.
391 * @param {!Array<string>} fileUrls
392 * @param {function()} callback
394 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};
397 * Cancels all ongoing file transfers.
398 * @param {function()} callback
400 chrome.fileManagerPrivate.cancelAllFileTransfers = function(callback) {};
403 * Starts to copy an entry. If the source is a directory, the copy is done
404 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| Entry
405 * of the destination directory. |newName| Name of the new entry. It must not
406 * contain '/'. |callback| Completion callback.
407 * @param {!Entry} entry
408 * @param {!DirectoryEntry} parentEntry
409 * @param {string} newName
410 * @param {function((number|undefined))} callback |copyId| ID of the copy task.
411 * Can be used to identify the progress, and to cancel the task.
413 chrome.fileManagerPrivate.startCopy = function(entry, parentEntry, newName,
417 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
418 * |callback| Completion callback of the cancel.
419 * @param {number} copyId
420 * @param {function()} callback Callback that does not take arguments.
422 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
425 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
426 * volume to be checked. |callback|
427 * @param {string} volumeId
428 * @param {function((!MountPointSizeStats|undefined))} callback Name/value pairs
429 * of size stats. Will be undefined if stats could not be determined.
431 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
434 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
435 * @param {string} volumeId
437 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
440 * Retrieves file manager preferences. |callback|
441 * @param {function((!Preferences|undefined))} callback
443 chrome.fileManagerPrivate.getPreferences = function(callback) {};
446 * Sets file manager preferences. |changeInfo|
447 * @param {PreferencesChange} changeInfo
449 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
452 * Performs drive content search. |searchParams| |callback|
453 * @param {SearchParams} searchParams
454 * @param {function((!Array<Entry>|undefined), (string|undefined))} callback
455 * Entries and ID of the feed that contains next chunk of the search result.
456 * Should be sent to the next searchDrive request to perform incremental search.
458 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
461 * Performs drive metadata search. |searchParams| |callback|
462 * @param {SearchMetadataParams} searchParams
463 * @param {function((!Array<!SearchResult>|undefined))} callback
465 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams,
469 * Search for files in the given volume, whose content hash matches the list of
471 * @param {string} volumeId
472 * @param {!Array<string>} hashes
473 * @param {function((!Object<string, !Array<string>>|undefined))} callback
475 chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes,
479 * Create a zip file for the selected files. |parentEntry| Entry of the
480 * directory containing the selected files. |entries| Selected entries.
481 * The files must be under the directory specified by |parentEntry|. |destName|
482 * Name of the destination zip file. The zip file will be created under the
483 * directory specified by |parentEntry|.
484 * @param {!DirectoryEntry} parentEntry
485 * @param {!Array<!Entry>} entries
486 * @param {string} destName
487 * @param {function((boolean|undefined))} callback
489 chrome.fileManagerPrivate.zipSelection = function(parentEntry, entries,
490 destName, callback) {};
493 * Retrieves the state of the current drive connection. |callback|
494 * @param {function((!DriveConnectionState|undefined))} callback
496 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
499 * Checks whether the path name length fits in the limit of the filesystem.
500 * |parentEntry| The parent directory entry. |name| The name of the file.
501 * |callback| Called back when the check is finished.
502 * @param {!DirectoryEntry} parentEntry
503 * @param {string} name
504 * @param {function((boolean|undefined))} callback |result| true if the length
505 * is in the valid range, false otherwise.
507 chrome.fileManagerPrivate.validatePathNameLength = function(
508 parentEntry, name, callback) {};
511 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
512 * @param {string} operation
514 chrome.fileManagerPrivate.zoom = function(operation) {};
517 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
518 * be refetched instead of using the cached one. |callback|
519 * @param {boolean} refresh
520 * @param {function((string|undefined))} callback |accessToken| OAuth2 access
521 * token, or an empty string if failed to fetch.
523 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
526 * Requests a Webstore API OAuth2 access token. |callback|
527 * @param {function((string|undefined))} callback |accessToken| OAuth2 access
528 * token, or an empty string if failed to fetch.
530 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
533 * Requests a share dialog url for the specified file.
534 * @param {!Entry} entry
535 * @param {function((string|undefined))} callback Callback with the result url.
537 chrome.fileManagerPrivate.getShareUrl = function(entry, callback) {};
540 * Requests a download url to download the file contents.
541 * @param {!Entry} entry
542 * @param {function((string|undefined))} callback Callback with the result url.
544 chrome.fileManagerPrivate.getDownloadUrl = function(entry, callback) {};
547 * Requests to share drive files.
548 * @param {!Entry} entry
549 * @param {string} shareType
550 * @param {function()} callback Callback that does not take arguments.
552 chrome.fileManagerPrivate.requestDriveShare = function(entry, shareType,
556 * Requests to install a webstore item. |item_id| The id of the item to
557 * install. |silentInstallation| False to show installation prompt. True not to
559 * @param {string} itemId
560 * @param {boolean} silentInstallation
561 * @param {function()} callback Callback that does not take arguments.
563 chrome.fileManagerPrivate.installWebstoreItem = function(itemId,
564 silentInstallation, callback) {};
567 * Obtains a list of profiles that are logged-in.
568 * @param {function((!Array<!ProfileInfo>|undefined), (string|undefined),
569 * (string|undefined))} callback Callback with list of profile information,
570 * |runningProfile| ID of the profile that runs the application instance.
571 * |showingProfile| ID of the profile that shows the application window.
573 chrome.fileManagerPrivate.getProfiles = function(callback) {};
576 * Opens inspector window. |type| InspectionType which specifies how to open
578 * @param {string} type
580 chrome.fileManagerPrivate.openInspector = function(type) {};
583 * Computes an MD5 checksum for the given file.
584 * @param {!Entry} entry
585 * @param {function((string|undefined))} callback
587 chrome.fileManagerPrivate.computeChecksum = function(entry, callback) {};
590 * Gets the MIME type of a file.
591 * @param {!Entry} entry
592 * @param {function((string|undefined))} callback Callback that MIME type of the
595 chrome.fileManagerPrivate.getMimeType = function(entry, callback) {};
598 * Gets a flag indicating whether user metrics reporting is enabled.
599 * @param {function((boolean|undefined))} callback
601 chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
604 * Sets a tag on a file or a directory. Only Drive files are supported.
605 * @param {!Entry} entry
606 * @param {string} visibility 'private' or 'public'
607 * @param {string} key
608 * @param {string} value
609 * @param {function()} callback
611 chrome.fileManagerPrivate.setEntryTag = function(entry, visibility, key,
615 * Gets a flag indicating whether PiexLoader is enabled.
616 * @param {function((boolean|undefined))} callback
618 chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};
621 * Returns list of available providing extensions.
622 * @param {function((!Array<!ProvidingExtension>|undefined))} callback
624 chrome.fileManagerPrivate.getProvidingExtensions = function(callback) {};
627 * Requests adding a new provided file system. If not possible, then an error
628 * via chrome.runtime.lastError is returned.
629 * @param {string} extensionId
630 * @param {function()} callback
632 chrome.fileManagerPrivate.addProvidedFileSystem =
633 function(extensionId, callback) {};
636 * Requests configuring an existing file system. If not possible, then returns
637 * an error via chrome.runtime.lastError.
638 * @param {string} volumeId
639 * @param {function()} callback
641 chrome.fileManagerPrivate.configureVolume = function(volumeId, callback) {};
644 * Requests fetching list of actions for the specified entry. If not possible,
645 * then returns an error via chrome.runtime.lastError.
646 * @param {!Entry} entry
647 * @param {function((!Array<!EntryAction>|undefined))} callback
649 chrome.fileManagerPrivate.getEntryActions = function(entry, callback) {};
652 * Executes the action on the specified entry. If not possible, then returns an
653 * error via chrome.runtime.lastError.
654 * @param {!Entry} entry
655 * @param {string} actionId
656 * @param {function()} callback
658 chrome.fileManagerPrivate.executeAction = function(
659 entry, actionId, callback) {};
661 /** @type {!ChromeEvent} */
662 chrome.fileManagerPrivate.onMountCompleted;
664 /** @type {!ChromeEvent} */
665 chrome.fileManagerPrivate.onFileTransfersUpdated;
667 /** @type {!ChromeEvent} */
668 chrome.fileManagerPrivate.onCopyProgress;
670 /** @type {!ChromeEvent} */
671 chrome.fileManagerPrivate.onDirectoryChanged;
673 /** @type {!ChromeEvent} */
674 chrome.fileManagerPrivate.onPreferencesChanged;
676 /** @type {!ChromeEvent} */
677 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
679 /** @type {!ChromeEvent} */
680 chrome.fileManagerPrivate.onDeviceChanged;
682 /** @type {!ChromeEvent} */
683 chrome.fileManagerPrivate.onDriveSyncError;