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,
74 * mountCondition: (string|undefined),
75 * mountContext: (string|undefined)
84 * volumeMetadata: VolumeMetadata,
85 * shouldNotify: boolean
88 var MountCompletedEvent;
93 * transferState: string,
94 * transferType: string,
97 * num_total_jobs: number
100 var FileTransferStatus;
108 var DriveSyncErrorEvent;
113 * sourceUrl: (string|undefined),
114 * destinationUrl: (string|undefined),
115 * size: (number|undefined),
116 * error: (string|undefined)
119 var CopyProgressStatus;
127 var FileTransferCancelStatus;
141 * changedFiles: (Array|undefined)
148 * driveEnabled: boolean,
149 * cellularDisabled: boolean,
150 * hostedFilesDisabled: boolean,
151 * use24hourClock: boolean,
152 * allowRedeemOffers: boolean
159 * cellularDisabled: (boolean|undefined),
160 * hostedFilesDisabled: (boolean|undefined)
163 var PreferencesChange;
180 var SearchMetadataParams;
185 * highlightedBaseName: string
193 * reason: (string|undefined)
196 var DriveConnectionState;
208 * extensionId: string,
210 * configurable: boolean,
211 * multipleMounts: boolean,
215 var ProvidingExtension;
220 chrome.fileManagerPrivate = {};
223 * Logout the current user for navigating to the re-authentication screen for
224 * the Google account.
226 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
229 * Cancels file selection.
231 chrome.fileManagerPrivate.cancelDialog = function() {};
234 * Executes file browser task over selected files. |taskId| The unique
235 * identifier of task to execute. |fileUrls| Array of file URLs |callback|
236 * @param {string} taskId
237 * @param {Array} fileUrls
238 * @param {Function=} callback |result| Result of the task execution.
240 chrome.fileManagerPrivate.executeTask = function(taskId, fileUrls, callback) {};
243 * Sets the default task for the supplied MIME types and suffixes of the
244 * supplied file URLs. Lists of MIME types and URLs may contain duplicates.
245 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array
246 * of selected file URLs to extract suffixes from. |mimeTypes| Array of
247 * selected file MIME types. |callback|
248 * @param {string} taskId
249 * @param {Array} fileUrls
250 * @param {Array=} mimeTypes
251 * @param {Function=} callback Callback that does not take arguments.
253 chrome.fileManagerPrivate.setDefaultTask = function(taskId, fileUrls, mimeTypes, callback) {};
256 * Gets the list of tasks that can be performed over selected files. |fileUrls|
257 * Array of selected file URLs |callback|
258 * @param {Array} fileUrls
259 * @param {Function} callback |tasks| The list of matched file URL patterns for
262 chrome.fileManagerPrivate.getFileTasks = function(fileUrls, callback) {};
265 * Gets localized strings and initialization data. |callback|
266 * @param {Function} callback |result| Hash containing the string assets.
268 chrome.fileManagerPrivate.getStrings = function(callback) {};
271 * Adds file watch. |fileUrl| URL of file to watch |callback|
272 * @param {string} fileUrl
273 * @param {Function} callback |success| True when file watch is successfully
276 chrome.fileManagerPrivate.addFileWatch = function(fileUrl, callback) {};
279 * Removes file watch. |fileUrl| URL of watched file to remove |callback|
280 * @param {string} fileUrl
281 * @param {Function} callback |success| True when file watch is successfully
284 chrome.fileManagerPrivate.removeFileWatch = function(fileUrl, callback) {};
287 * Enables the extenal file scheme necessary to initiate drags to the browser
288 * window for files on the external backend.
290 chrome.fileManagerPrivate.enableExternalFileScheme = function() {};
293 * Requests R/W access to the specified entries as |entryUrls|. Note, that only
294 * files backed by external file system backend will be granted the access.
295 * @param {!Array<string>} entryUrls
296 * @param {function()} callback Completion callback.
298 chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};
301 * Selects multiple files. |selectedPaths| Array of selected paths
302 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
304 * @param {Array} selectedPaths
305 * @param {boolean} shouldReturnLocalPath
306 * @param {Function} callback Callback that does not take arguments.
308 chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLocalPath, callback) {};
311 * Selects a file. |selectedPath| A selected path |index| Index of Filter
312 * |forOpening| true if paths are selected for opening. false if for saving.
313 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
315 * @param {string} selectedPath
316 * @param {number} index
317 * @param {boolean} forOpening
318 * @param {boolean} shouldReturnLocalPath
319 * @param {Function} callback Callback that does not take arguments.
321 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening, shouldReturnLocalPath, callback) {};
324 * Requests additional properties for files. |fileUrls| list of URLs of files
326 * @param {!Array<string>} fileUrls
327 * @param {!Array<string>} names
328 * @param {!Function} callback |entryProperties| A dictionary containing
329 * properties of the requested entries.
331 chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, names, callback) {};
334 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
335 * |pin| Pass true to pin the file. |callback| Completion callback.
336 * $(ref:runtime.lastError) will be set if there was an error.
337 * @param {string} fileUrl
338 * @param {boolean} pin
339 * @param {Function=} callback Callback that does not take arguments.
341 chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {};
344 * Resolves file entries in the isolated file system and returns corresponding
345 * entries in the external file system mounted to Chrome OS file manager
346 * backend. If resolving entry fails, the entry will be just ignored and the
347 * corresponding entry does not appear in the result.
348 * @param {Array} entries
349 * @param {Function} callback |entryUrl| URL of an entry in a normal file
352 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {};
355 * Mount a resource or a file. |source| Mount point source. For compressed
356 * files it is relative file path within external file system |callback|
357 * @param {string} source
358 * @param {Function} callback |sourcePath| Source path of the mount.
360 chrome.fileManagerPrivate.addMount = function(source, callback) {};
363 * Unmounts a mounted resource. |volumeId| An ID of the volume.
364 * @param {string} volumeId
366 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
369 * Get the list of mounted volumes. |callback|
370 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata
371 * representing mounted volumes.
373 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
376 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
377 * for which ongoing transfer should be canceled. If this is absent, all
378 * jobs are canceled. |callback|
379 * @param {Array=} fileUrls
380 * @param {Function=} callback |fileTransferCancelStatuses| The list of
381 * FileTransferCancelStatus.
383 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};
386 * Starts to copy an entry. If the source is a directory, the copy is done
387 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL
388 * of the destination directory. |newName| Name of the new entry. It shouldn't
389 * contain '/'. |callback| Completion callback.
390 * @param {string} sourceUrl
391 * @param {string} parent
392 * @param {string} newName
393 * @param {Function} callback |copyId| ID of the copy task. Can be used to
394 * identify the progress, and to cancel the task.
396 chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callback) {};
399 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
400 * |callback| Completion callback of the cancel.
401 * @param {number} copyId
402 * @param {Function=} callback Callback that does not take arguments.
404 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
407 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
408 * volume to be checked. |callback|
409 * @param {string} volumeId
410 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will
411 * be undefined if stats could not be determined.
413 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
416 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
417 * @param {string} volumeId
419 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
422 * Retrieves file manager preferences. |callback|
423 * @param {Function} callback
425 chrome.fileManagerPrivate.getPreferences = function(callback) {};
428 * Sets file manager preferences. |changeInfo|
429 * @param {PreferencesChange} changeInfo
431 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
434 * Performs drive content search. |searchParams| |callback|
435 * @param {SearchParams} searchParams
436 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains
437 * next chunk of the search result. Should be sent to the next searchDrive
438 * request to perform incremental search.
440 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
443 * Performs drive metadata search. |searchParams| |callback|
444 * @param {SearchMetadataParams} searchParams
445 * @param {Function} callback
447 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};
450 * Search for files in the given volume, whose content hash matches the list of
452 * @param {string} volumeId
453 * @param {!Array<string>} hashes
454 * @param {function(!Object<string, !Array<string>>)} callback
456 chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes, callback) {};
459 * Create a zip file for the selected files. |dirURL| URL of the directory
460 * containing the selected files. |selectionUrls| URLs of the selected files.
461 * The files must be under the directory specified by dirURL. |destName|
462 * Name of the destination zip file. The zip file will be created under the
463 * directory specified by dirURL. |callback|
464 * @param {string} dirURL
465 * @param {Array} selectionUrls
466 * @param {string} destName
467 * @param {Function=} callback
469 chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destName, callback) {};
472 * Retrieves the state of the current drive connection. |callback|
473 * @param {Function} callback
475 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
478 * Checks whether the path name length fits in the limit of the filesystem.
479 * |parent_directory_url| The URL of the parent directory entry. |name| The
480 * name of the file. |callback| Called back when the check is finished.
481 * @param {string} parent_directory_url
482 * @param {string} name
483 * @param {Function} callback |result| true if the length is in the valid
484 * range, false otherwise.
486 chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url, name, callback) {};
489 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
490 * @param {string} operation
492 chrome.fileManagerPrivate.zoom = function(operation) {};
495 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
496 * be refetched instead of using the cached one. |callback|
497 * @param {boolean} refresh
498 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
499 * string if failed to fetch.
501 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
504 * Requests a Webstore API OAuth2 access token. |callback|
505 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
506 * string if failed to fetch.
508 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
511 * Requests a share dialog url for the specified file. |url| Url for the file.
513 * @param {string} url
514 * @param {Function} callback |url| Result url.
516 chrome.fileManagerPrivate.getShareUrl = function(url, callback) {};
519 * Requests a download url to download the file contents. |url| Url for the
521 * @param {string} url
522 * @param {Function} callback |url| Result url.
524 chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {};
527 * Requests to share drive files. |url| URL of a file to be shared. |shareType|
528 * Type of access that is getting granted.
529 * @param {string} url
530 * @param {string} shareType
531 * @param {Function} callback Callback that does not take arguments.
533 chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback) {};
536 * Requests to install a webstore item. |item_id| The id of the item to
537 * install. |silentInstallation| False to show installation prompt. True not to
539 * @param {string} itemId
540 * @param {boolean} silentInstallation
541 * @param {Function} callback Callback that does not take arguments.
543 chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallation, callback) {};
546 * Obtains a list of profiles that are logged-in.
547 * @param {Function} callback |profiles| List of profile information.
548 * |runningProfile| ID of the profile that runs the application instance.
549 * |showingProfile| ID of the profile that shows the application window.
551 chrome.fileManagerPrivate.getProfiles = function(callback) {};
554 * Opens inspector window. |type| InspectionType which specifies how to open
556 * @param {string} type
558 chrome.fileManagerPrivate.openInspector = function(type) {};
561 * Computes an MD5 checksum for the given file.
562 * @param {string} fileUrl
563 * @param {function(string)} callback
565 chrome.fileManagerPrivate.computeChecksum = function(fileUrl, callback) {};
568 * Gets the MIME type of a file.
569 * @param {string} fileUrl File url.
570 * @param {function(string)} callback Callback that MIME type of the file is
573 chrome.fileManagerPrivate.getMimeType = function(fileUrl, callback) {};
576 * Gets a flag indicating whether user metrics reporting is enabled.
577 * @param {function(boolean)} callback
579 chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
582 * Sets a tag on a file or a directory. Only Drive files are supported.
583 * @param {string} entryURL
584 * @param {string} visibility 'private' or 'public'
585 * @param {string} key
586 * @param {string} value
587 * @param {function()} callback
589 chrome.fileManagerPrivate.setEntryTag = function(entryURL, visibility, key, value, callback) {};
592 * Gets a flag indicating whether PiexLoader is enabled.
593 * @param {function(boolean)} callback
595 chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};
598 * Returns list of available providing extensions.
599 * @param {function(!Array<!ProvidingExtension>)} callback
601 chrome.fileManagerPrivate.getProvidingExtensions = function(callback) {};
604 * Requests adding a new provided file system. If not possible, then an error
605 * via chrome.runtime.lastError is returned.
606 * @param {string} extensionId
607 * @param {function()} callback
609 chrome.fileManagerPrivate.addProvidedFileSystem =
610 function(extensionId, callback) {};
613 * Requests configuring an existing file system. If not possible, then returns
614 * an error via chrome.runtime.lastError.
615 * @param {string} volumeId
616 * @param {function()} callback
618 chrome.fileManagerPrivate.configureVolume = function(volumeId, callback) {};
620 /** @type {!ChromeEvent} */
621 chrome.fileManagerPrivate.onMountCompleted;
623 /** @type {!ChromeEvent} */
624 chrome.fileManagerPrivate.onFileTransfersUpdated;
626 /** @type {!ChromeEvent} */
627 chrome.fileManagerPrivate.onCopyProgress;
629 /** @type {!ChromeEvent} */
630 chrome.fileManagerPrivate.onDirectoryChanged;
632 /** @type {!ChromeEvent} */
633 chrome.fileManagerPrivate.onPreferencesChanged;
635 /** @type {!ChromeEvent} */
636 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
638 /** @type {!ChromeEvent} */
639 chrome.fileManagerPrivate.onDeviceChanged;
641 /** @type {!ChromeEvent} */
642 chrome.fileManagerPrivate.onDriveSyncError;