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,
154 * cellularDisabled: (boolean|undefined),
155 * hostedFilesDisabled: (boolean|undefined)
158 var PreferencesChange;
175 var SearchMetadataParams;
180 * highlightedBaseName: string
188 * reason: (string|undefined)
191 var DriveConnectionState;
203 * extensionId: string,
205 * configurable: boolean,
206 * watchable: boolean,
207 * multipleMounts: boolean,
211 var ProvidingExtension;
216 * title: (string|undefined)
224 chrome.fileManagerPrivate = {};
227 * Logout the current user for navigating to the re-authentication screen for
228 * the Google account.
230 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
233 * Cancels file selection.
235 chrome.fileManagerPrivate.cancelDialog = function() {};
238 * Executes file browser task over selected files. |taskId| The unique
239 * identifier of task to execute. |entries| Array of file entries |callback|
240 * @param {string} taskId
241 * @param {!Array<!Entry>} entries
242 * @param {function((boolean|undefined))} callback |result| Result of the task
245 chrome.fileManagerPrivate.executeTask = function(taskId, entries, callback) {};
248 * Sets the default task for the supplied MIME types and path extensions.
249 * Lists of MIME types and entries may contain duplicates.
250 * |taskId| The unique identifier of task to mark as default. |entries| Array
251 * of selected file entries to extract path extensions from. |mimeTypes| Array
252 * of selected file MIME types. |callback|
253 * @param {string} taskId
254 * @param {!Array<!Entry>} entries
255 * @param {!Array<string>} mimeTypes
256 * @param {!function()} callback Callback that does not take arguments.
258 chrome.fileManagerPrivate.setDefaultTask = function(taskId, entries, mimeTypes,
262 * Gets the list of tasks that can be performed over selected files. |entries|
263 * Array of selected entries |callback|
264 * @param {!Array<!Entry>} entries
265 * @param {function((!Array<!FileTask>|undefined))} callback |tasks| The list of
266 * matched file entries for this task.
268 chrome.fileManagerPrivate.getFileTasks = function(entries, callback) {};
271 * Gets localized strings and initialization data. |callback|
272 * @param {function((!Object|undefined))} callback |result| Hash containing the
275 chrome.fileManagerPrivate.getStrings = function(callback) {};
278 * Adds file watch. |entry| Entry of file to watch |callback|
279 * @param {!Entry} entry
280 * @param {function((boolean|undefined))} callback |success| True when file
281 * watch is successfully added.
283 chrome.fileManagerPrivate.addFileWatch = function(entry, callback) {};
286 * Removes file watch. |entry| Entry of watched file to remove |callback|
287 * @param {!Entry} entry
288 * @param {function((boolean|undefined))} callback |success| True when file
289 * watch is successfully
292 chrome.fileManagerPrivate.removeFileWatch = function(entry, callback) {};
295 * Enables the extenal file scheme necessary to initiate drags to the browser
296 * window for files on the external backend.
298 chrome.fileManagerPrivate.enableExternalFileScheme = function() {};
301 * Requests R/W access to the specified entries as |entryUrls|. Note, that only
302 * files backed by external file system backend will be granted the access.
303 * @param {!Array<string>} entryUrls
304 * @param {function()} callback Completion callback.
306 chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};
309 * Selects multiple files. |selectedPaths| Array of selected paths
310 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
312 * @param {!Array<string>} selectedPaths
313 * @param {boolean} shouldReturnLocalPath
314 * @param {function()} callback Callback that does not take arguments.
316 chrome.fileManagerPrivate.selectFiles = function(selectedPaths,
317 shouldReturnLocalPath, callback) {};
320 * Selects a file. |selectedPath| A selected path |index| Index of Filter
321 * |forOpening| true if paths are selected for opening. false if for saving.
322 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
324 * @param {string} selectedPath
325 * @param {number} index
326 * @param {boolean} forOpening
327 * @param {boolean} shouldReturnLocalPath
328 * @param {function()} callback Callback that does not take arguments.
330 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening,
331 shouldReturnLocalPath, callback) {};
334 * Requests additional properties for files. |entries| list of entries of files
336 * @param {!Array<!Entry>} entries
337 * @param {!Array<string>} names
338 * @param {function((!Array<!EntryProperties>|undefined))} callback
339 * |entryProperties| A dictionary containing properties of the requested
342 chrome.fileManagerPrivate.getEntryProperties = function(entries, names,
346 * Pins/unpins a Drive file in the cache. |entry| Entry of a file to pin/unpin.
347 * |pin| Pass true to pin the file. |callback| Completion callback.
348 * $(ref:runtime.lastError) will be set if there was an error.
349 * @param {!Entry} entry
350 * @param {boolean} pin
351 * @param {function()} callback Callback that does not take arguments.
353 chrome.fileManagerPrivate.pinDriveFile = function(entry, pin, callback) {};
356 * Resolves file entries in the isolated file system and returns corresponding
357 * entries in the external file system mounted to Chrome OS file manager
358 * backend. If resolving entry fails, the entry will be just ignored and the
359 * corresponding entry does not appear in the result.
360 * @param {!Array<!Entry>} entries
361 * @param {function((!Array<!Entry>|undefined))} callback Completion callback
362 * with resolved entries.
364 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries,
368 * Mount a resource or a file. |source| Mount point source. For compressed
369 * files it is relative file path within external file system |callback|
370 * @param {string} source
371 * @param {function((string|undefined))} callback Callback with source path of
374 chrome.fileManagerPrivate.addMount = function(source, callback) {};
377 * Unmounts a mounted resource. |volumeId| An ID of the volume.
378 * @param {string} volumeId
380 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
383 * Get the list of mounted volumes. |callback|
384 * @param {function((!Array<!VolumeMetadata>|undefined))} callback Callback with
385 * the list of VolumeMetadata representing mounted volumes.
387 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
390 * Cancels ongoing file transfers for selected files. |entries| Array of files
391 * for which ongoing transfer should be canceled.
392 * @param {!Array<!FileEntry>} entries
393 * @param {function()} callback
395 chrome.fileManagerPrivate.cancelFileTransfers = function(entries, callback) {};
398 * Cancels all ongoing file transfers.
399 * @param {function()} callback
401 chrome.fileManagerPrivate.cancelAllFileTransfers = function(callback) {};
404 * Starts to copy an entry. If the source is a directory, the copy is done
405 * recursively. |entry| Entry of the source entry to be copied. |parent| Entry
406 * of the destination directory. |newName| Name of the new entry. It must not
407 * contain '/'. |callback| Completion callback.
408 * @param {!Entry} entry
409 * @param {!DirectoryEntry} parentEntry
410 * @param {string} newName
411 * @param {function((number|undefined))} callback |copyId| ID of the copy task.
412 * Can be used to identify the progress, and to cancel the task.
414 chrome.fileManagerPrivate.startCopy = function(entry, parentEntry, newName,
418 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
419 * |callback| Completion callback of the cancel.
420 * @param {number} copyId
421 * @param {function()} callback Callback that does not take arguments.
423 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
426 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
427 * volume to be checked. |callback|
428 * @param {string} volumeId
429 * @param {function((!MountPointSizeStats|undefined))} callback Name/value pairs
430 * of size stats. Will be undefined if stats could not be determined.
432 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
435 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
436 * @param {string} volumeId
438 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
441 * Retrieves file manager preferences. |callback|
442 * @param {function((!Preferences|undefined))} callback
444 chrome.fileManagerPrivate.getPreferences = function(callback) {};
447 * Sets file manager preferences. |changeInfo|
448 * @param {PreferencesChange} changeInfo
450 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
453 * Performs drive content search. |searchParams| |callback|
454 * @param {SearchParams} searchParams
455 * @param {function((!Array<Entry>|undefined), (string|undefined))} callback
456 * Entries and ID of the feed that contains next chunk of the search result.
457 * Should be sent to the next searchDrive request to perform incremental search.
459 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
462 * Performs drive metadata search. |searchParams| |callback|
463 * @param {SearchMetadataParams} searchParams
464 * @param {function((!Array<!SearchResult>|undefined))} callback
466 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams,
470 * Search for files in the given volume, whose content hash matches the list of
472 * @param {string} volumeId
473 * @param {!Array<string>} hashes
474 * @param {function((!Object<string, !Array<string>>|undefined))} callback
476 chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes,
480 * Create a zip file for the selected files. |parentEntry| Entry of the
481 * directory containing the selected files. |entries| Selected entries.
482 * The files must be under the directory specified by |parentEntry|. |destName|
483 * Name of the destination zip file. The zip file will be created under the
484 * directory specified by |parentEntry|.
485 * @param {!DirectoryEntry} parentEntry
486 * @param {!Array<!Entry>} entries
487 * @param {string} destName
488 * @param {function((boolean|undefined))} callback
490 chrome.fileManagerPrivate.zipSelection = function(parentEntry, entries,
491 destName, callback) {};
494 * Retrieves the state of the current drive connection. |callback|
495 * @param {function((!DriveConnectionState|undefined))} callback
497 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
500 * Checks whether the path name length fits in the limit of the filesystem.
501 * |parentEntry| The parent directory entry. |name| The name of the file.
502 * |callback| Called back when the check is finished.
503 * @param {!DirectoryEntry} parentEntry
504 * @param {string} name
505 * @param {function((boolean|undefined))} callback |result| true if the length
506 * is in the valid range, false otherwise.
508 chrome.fileManagerPrivate.validatePathNameLength = function(
509 parentEntry, name, callback) {};
512 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
513 * @param {string} operation
515 chrome.fileManagerPrivate.zoom = function(operation) {};
518 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
519 * be refetched instead of using the cached one. |callback|
520 * @param {boolean} refresh
521 * @param {function((string|undefined))} callback |accessToken| OAuth2 access
522 * token, or an empty string if failed to fetch.
524 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
527 * Requests a Webstore API OAuth2 access token. |callback|
528 * @param {function((string|undefined))} callback |accessToken| OAuth2 access
529 * token, or an empty string if failed to fetch.
531 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
534 * Requests a share dialog url for the specified file.
535 * @param {!Entry} entry
536 * @param {function((string|undefined))} callback Callback with the result url.
538 chrome.fileManagerPrivate.getShareUrl = function(entry, callback) {};
541 * Requests a download url to download the file contents.
542 * @param {!Entry} entry
543 * @param {function((string|undefined))} callback Callback with the result url.
545 chrome.fileManagerPrivate.getDownloadUrl = function(entry, callback) {};
548 * Requests to share drive files.
549 * @param {!Entry} entry
550 * @param {string} shareType
551 * @param {function()} callback Callback that does not take arguments.
553 chrome.fileManagerPrivate.requestDriveShare = function(entry, shareType,
557 * Requests to install a webstore item. |item_id| The id of the item to
558 * install. |silentInstallation| False to show installation prompt. True not to
560 * @param {string} itemId
561 * @param {boolean} silentInstallation
562 * @param {function()} callback Callback that does not take arguments.
564 chrome.fileManagerPrivate.installWebstoreItem = function(itemId,
565 silentInstallation, callback) {};
568 * Obtains a list of profiles that are logged-in.
569 * @param {function((!Array<!ProfileInfo>|undefined), (string|undefined),
570 * (string|undefined))} callback Callback with list of profile information,
571 * |runningProfile| ID of the profile that runs the application instance.
572 * |showingProfile| ID of the profile that shows the application window.
574 chrome.fileManagerPrivate.getProfiles = function(callback) {};
577 * Opens inspector window. |type| InspectionType which specifies how to open
579 * @param {string} type
581 chrome.fileManagerPrivate.openInspector = function(type) {};
584 * Computes an MD5 checksum for the given file.
585 * @param {!Entry} entry
586 * @param {function((string|undefined))} callback
588 chrome.fileManagerPrivate.computeChecksum = function(entry, callback) {};
591 * Gets the MIME type of a file.
592 * @param {!Entry} entry
593 * @param {function((string|undefined))} callback Callback that MIME type of the
596 chrome.fileManagerPrivate.getMimeType = function(entry, callback) {};
599 * Gets a flag indicating whether user metrics reporting is enabled.
600 * @param {function((boolean|undefined))} callback
602 chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
605 * Sets a tag on a file or a directory. Only Drive files are supported.
606 * @param {!Entry} entry
607 * @param {string} visibility 'private' or 'public'
608 * @param {string} key
609 * @param {string} value
610 * @param {function()} callback
612 chrome.fileManagerPrivate.setEntryTag = function(entry, visibility, key,
616 * Gets a flag indicating whether PiexLoader is enabled.
617 * @param {function((boolean|undefined))} callback
619 chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};
622 * Returns list of available providing extensions.
623 * @param {function((!Array<!ProvidingExtension>|undefined))} callback
625 chrome.fileManagerPrivate.getProvidingExtensions = function(callback) {};
628 * Requests adding a new provided file system. If not possible, then an error
629 * via chrome.runtime.lastError is returned.
630 * @param {string} extensionId
631 * @param {function()} callback
633 chrome.fileManagerPrivate.addProvidedFileSystem =
634 function(extensionId, callback) {};
637 * Requests configuring an existing file system. If not possible, then returns
638 * an error via chrome.runtime.lastError.
639 * @param {string} volumeId
640 * @param {function()} callback
642 chrome.fileManagerPrivate.configureVolume = function(volumeId, callback) {};
645 * Requests fetching list of actions for the specified entry. If not possible,
646 * then returns an error via chrome.runtime.lastError.
647 * @param {!Entry} entry
648 * @param {function((!Array<!EntryAction>|undefined))} callback
650 chrome.fileManagerPrivate.getEntryActions = function(entry, callback) {};
653 * Executes the action on the specified entry. If not possible, then returns an
654 * error via chrome.runtime.lastError.
655 * @param {!Entry} entry
656 * @param {string} actionId
657 * @param {function()} callback
659 chrome.fileManagerPrivate.executeAction = function(
660 entry, actionId, callback) {};
662 /** @type {!ChromeEvent} */
663 chrome.fileManagerPrivate.onMountCompleted;
665 /** @type {!ChromeEvent} */
666 chrome.fileManagerPrivate.onFileTransfersUpdated;
668 /** @type {!ChromeEvent} */
669 chrome.fileManagerPrivate.onCopyProgress;
671 /** @type {!ChromeEvent} */
672 chrome.fileManagerPrivate.onDirectoryChanged;
674 /** @type {!ChromeEvent} */
675 chrome.fileManagerPrivate.onPreferencesChanged;
677 /** @type {!ChromeEvent} */
678 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
680 /** @type {!ChromeEvent} */
681 chrome.fileManagerPrivate.onDeviceChanged;
683 /** @type {!ChromeEvent} */
684 chrome.fileManagerPrivate.onDriveSyncError;