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 * externalFileUrl: (string|undefined),
23 * imageWidth: (number|undefined),
24 * imageHeight: (number|undefined),
25 * imageRotation: (number|undefined),
26 * pinned: (boolean|undefined),
27 * present: (boolean|undefined),
28 * hosted: (boolean|undefined),
29 * dirty: (boolean|undefined),
30 * availableOffline: (boolean|undefined),
31 * availableWhenMetered: (boolean|undefined),
32 * customIconUrl: (string|undefined),
33 * contentMimeType: (string|undefined),
34 * sharedWithMe: (boolean|undefined),
35 * shared: (boolean|undefined)
43 * remainingSize: number
46 var MountPointSizeStats;
51 * displayName: string,
52 * isCurrentProfile: boolean
60 * fileSystemId: (string|undefined),
61 * extensionId: (string|undefined),
62 * volumeLabel: (string|undefined),
63 * profile: ProfileInfo,
64 * sourcePath: (string|undefined),
66 * deviceType: (string|undefined),
67 * devicePath: (string|undefined),
68 * isParentDevice: (boolean|undefined),
69 * isReadOnly: boolean,
71 * mountCondition: (string|undefined),
72 * mountContext: (string|undefined)
81 * volumeMetadata: VolumeMetadata,
82 * shouldNotify: boolean
85 var MountCompletedEvent;
90 * transferState: string,
91 * transferType: string,
94 * num_total_jobs: number
97 var FileTransferStatus;
105 var DriveSyncErrorEvent;
110 * sourceUrl: (string|undefined),
111 * destinationUrl: (string|undefined),
112 * size: (number|undefined),
113 * error: (string|undefined)
116 var CopyProgressStatus;
124 var FileTransferCancelStatus;
138 * changedFiles: (Array|undefined)
145 * driveEnabled: boolean,
146 * cellularDisabled: boolean,
147 * hostedFilesDisabled: boolean,
148 * use24hourClock: boolean,
149 * allowRedeemOffers: boolean
156 * cellularDisabled: (boolean|undefined),
157 * hostedFilesDisabled: (boolean|undefined)
160 var PreferencesChange;
177 var SearchMetadataParams;
182 * highlightedBaseName: string
190 * reason: (string|undefined)
193 var DriveConnectionState;
206 chrome.fileManagerPrivate = {};
209 * Logout the current user for navigating to the re-authentication screen for
210 * the Google account.
212 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
215 * Cancels file selection.
217 chrome.fileManagerPrivate.cancelDialog = function() {};
220 * Executes file browser task over selected files. |taskId| The unique
221 * identifier of task to execute. |fileUrls| Array of file URLs |callback|
222 * @param {string} taskId
223 * @param {Array} fileUrls
224 * @param {Function=} callback |result| Result of the task execution.
226 chrome.fileManagerPrivate.executeTask = function(taskId, fileUrls, callback) {};
229 * Sets the default task for the supplied MIME types and suffixes of the
230 * supplied file URLs. Lists of MIME types and URLs may contain duplicates.
231 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array
232 * of selected file URLs to extract suffixes from. |mimeTypes| Array of
233 * selected file MIME types. |callback|
234 * @param {string} taskId
235 * @param {Array} fileUrls
236 * @param {Array=} mimeTypes
237 * @param {Function=} callback Callback that does not take arguments.
239 chrome.fileManagerPrivate.setDefaultTask = function(taskId, fileUrls, mimeTypes, callback) {};
242 * Gets the list of tasks that can be performed over selected files. |fileUrls|
243 * Array of selected file URLs |callback|
244 * @param {Array} fileUrls
245 * @param {Function} callback |tasks| The list of matched file URL patterns for
248 chrome.fileManagerPrivate.getFileTasks = function(fileUrls, callback) {};
251 * Gets localized strings and initialization data. |callback|
252 * @param {Function} callback |result| Hash containing the string assets.
254 chrome.fileManagerPrivate.getStrings = function(callback) {};
257 * Adds file watch. |fileUrl| URL of file to watch |callback|
258 * @param {string} fileUrl
259 * @param {Function} callback |success| True when file watch is successfully
262 chrome.fileManagerPrivate.addFileWatch = function(fileUrl, callback) {};
265 * Removes file watch. |fileUrl| URL of watched file to remove |callback|
266 * @param {string} fileUrl
267 * @param {Function} callback |success| True when file watch is successfully
270 chrome.fileManagerPrivate.removeFileWatch = function(fileUrl, callback) {};
273 * Enables the extenal file scheme necessary to initiate drags to the browser
274 * window for files on the external backend.
276 chrome.fileManagerPrivate.enableExternalFileScheme = function() {};
279 * Requests R/W access to the specified entries as |entryUrls|. Note, that only
280 * files backed by external file system backend will be granted the access.
281 * @param {!Array<string>} entryUrls
282 * @param {function()} callback Completion callback.
284 chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};
287 * Selects multiple files. |selectedPaths| Array of selected paths
288 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
290 * @param {Array} selectedPaths
291 * @param {boolean} shouldReturnLocalPath
292 * @param {Function} callback Callback that does not take arguments.
294 chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLocalPath, callback) {};
297 * Selects a file. |selectedPath| A selected path |index| Index of Filter
298 * |forOpening| true if paths are selected for opening. false if for saving.
299 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
301 * @param {string} selectedPath
302 * @param {number} index
303 * @param {boolean} forOpening
304 * @param {boolean} shouldReturnLocalPath
305 * @param {Function} callback Callback that does not take arguments.
307 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening, shouldReturnLocalPath, callback) {};
310 * Requests additional properties for files. |fileUrls| list of URLs of files
312 * @param {!Array<string>} fileUrls
313 * @param {!Array<string>} names
314 * @param {!Function} callback |entryProperties| A dictionary containing
315 * properties of the requested entries.
317 chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, names, callback) {};
320 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
321 * |pin| Pass true to pin the file. |callback| Completion callback.
322 * $(ref:runtime.lastError) will be set if there was an error.
323 * @param {string} fileUrl
324 * @param {boolean} pin
325 * @param {Function=} callback Callback that does not take arguments.
327 chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {};
330 * Resolves file entries in the isolated file system and returns corresponding
331 * entries in the external file system mounted to Chrome OS file manager
332 * backend. If resolving entry fails, the entry will be just ignored and the
333 * corresponding entry does not appear in the result.
334 * @param {Array} entries
335 * @param {Function} callback |entryUrl| URL of an entry in a normal file
338 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {};
341 * Mount a resource or a file. |source| Mount point source. For compressed
342 * files it is relative file path within external file system |callback|
343 * @param {string} source
344 * @param {Function} callback |sourcePath| Source path of the mount.
346 chrome.fileManagerPrivate.addMount = function(source, callback) {};
349 * Unmounts a mounted resource. |volumeId| An ID of the volume.
350 * @param {string} volumeId
352 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
355 * Get the list of mounted volumes. |callback|
356 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata
357 * representing mounted volumes.
359 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
362 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
363 * for which ongoing transfer should be canceled. If this is absent, all
364 * jobs are canceled. |callback|
365 * @param {Array=} fileUrls
366 * @param {Function=} callback |fileTransferCancelStatuses| The list of
367 * FileTransferCancelStatus.
369 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};
372 * Starts to copy an entry. If the source is a directory, the copy is done
373 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL
374 * of the destination directory. |newName| Name of the new entry. It shouldn't
375 * contain '/'. |callback| Completion callback.
376 * @param {string} sourceUrl
377 * @param {string} parent
378 * @param {string} newName
379 * @param {Function} callback |copyId| ID of the copy task. Can be used to
380 * identify the progress, and to cancel the task.
382 chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callback) {};
385 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
386 * |callback| Completion callback of the cancel.
387 * @param {number} copyId
388 * @param {Function=} callback Callback that does not take arguments.
390 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
393 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
394 * volume to be checked. |callback|
395 * @param {string} volumeId
396 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will
397 * be undefined if stats could not be determined.
399 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
402 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
403 * @param {string} volumeId
405 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
408 * Retrieves file manager preferences. |callback|
409 * @param {Function} callback
411 chrome.fileManagerPrivate.getPreferences = function(callback) {};
414 * Sets file manager preferences. |changeInfo|
415 * @param {PreferencesChange} changeInfo
417 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
420 * Performs drive content search. |searchParams| |callback|
421 * @param {SearchParams} searchParams
422 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains
423 * next chunk of the search result. Should be sent to the next searchDrive
424 * request to perform incremental search.
426 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
429 * Performs drive metadata search. |searchParams| |callback|
430 * @param {SearchMetadataParams} searchParams
431 * @param {Function} callback
433 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};
436 * Search for files in the given volume, whose content hash matches the list of
438 * @param {string} volumeId
439 * @param {!Array<string>} hashes
440 * @param {function(!Object<string, !Array<string>>)} callback
442 chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes, callback) {};
445 * Create a zip file for the selected files. |dirURL| URL of the directory
446 * containing the selected files. |selectionUrls| URLs of the selected files.
447 * The files must be under the directory specified by dirURL. |destName|
448 * Name of the destination zip file. The zip file will be created under the
449 * directory specified by dirURL. |callback|
450 * @param {string} dirURL
451 * @param {Array} selectionUrls
452 * @param {string} destName
453 * @param {Function=} callback
455 chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destName, callback) {};
458 * Retrieves the state of the current drive connection. |callback|
459 * @param {Function} callback
461 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
464 * Checks whether the path name length fits in the limit of the filesystem.
465 * |parent_directory_url| The URL of the parent directory entry. |name| The
466 * name of the file. |callback| Called back when the check is finished.
467 * @param {string} parent_directory_url
468 * @param {string} name
469 * @param {Function} callback |result| true if the length is in the valid
470 * range, false otherwise.
472 chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url, name, callback) {};
475 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
476 * @param {string} operation
478 chrome.fileManagerPrivate.zoom = function(operation) {};
481 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
482 * be refetched instead of using the cached one. |callback|
483 * @param {boolean} refresh
484 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
485 * string if failed to fetch.
487 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
490 * Requests a Webstore API OAuth2 access token. |callback|
491 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
492 * string if failed to fetch.
494 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
497 * Requests a share dialog url for the specified file. |url| Url for the file.
499 * @param {string} url
500 * @param {Function} callback |url| Result url.
502 chrome.fileManagerPrivate.getShareUrl = function(url, callback) {};
505 * Requests a download url to download the file contents. |url| Url for the
507 * @param {string} url
508 * @param {Function} callback |url| Result url.
510 chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {};
513 * Requests to share drive files. |url| URL of a file to be shared. |shareType|
514 * Type of access that is getting granted.
515 * @param {string} url
516 * @param {string} shareType
517 * @param {Function} callback Callback that does not take arguments.
519 chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback) {};
522 * Requests to install a webstore item. |item_id| The id of the item to
523 * install. |silentInstallation| False to show installation prompt. True not to
525 * @param {string} itemId
526 * @param {boolean} silentInstallation
527 * @param {Function} callback Callback that does not take arguments.
529 chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallation, callback) {};
532 * Obtains a list of profiles that are logged-in.
533 * @param {Function} callback |profiles| List of profile information.
534 * |runningProfile| ID of the profile that runs the application instance.
535 * |showingProfile| ID of the profile that shows the application window.
537 chrome.fileManagerPrivate.getProfiles = function(callback) {};
540 * Opens inspector window. |type| InspectionType which specifies how to open
542 * @param {string} type
544 chrome.fileManagerPrivate.openInspector = function(type) {};
547 * Computes an MD5 checksum for the given file.
548 * @param {string} fileUrl
549 * @param {function(string)} callback
551 chrome.fileManagerPrivate.computeChecksum = function(fileUrl, callback) {};
554 * Gets the MIME type of a file.
555 * @param {string} fileUrl File url.
556 * @param {function(string)} callback Callback that MIME type of the file is
559 chrome.fileManagerPrivate.getMimeType = function(fileUrl, callback) {};
562 * Gets a flag indicating whether user metrics reporting is enabled.
563 * @param {function(boolean)} callback
565 chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
568 * Sets a tag on a file or a directory. Only Drive files are supported.
569 * @param {string} entryURL
570 * @param {string} visibility 'private' or 'public'
571 * @param {string} key
572 * @param {string} value
573 * @param {function()} callback
575 chrome.fileManagerPrivate.setEntryTag = function(entryURL, visibility, key, value, callback) {};
578 * Gets a flag indicating whether PiexLoader is enabled.
579 * @param {function(boolean)} callback
581 chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};
583 /** @type {!ChromeEvent} */
584 chrome.fileManagerPrivate.onMountCompleted;
586 /** @type {!ChromeEvent} */
587 chrome.fileManagerPrivate.onFileTransfersUpdated;
589 /** @type {!ChromeEvent} */
590 chrome.fileManagerPrivate.onCopyProgress;
592 /** @type {!ChromeEvent} */
593 chrome.fileManagerPrivate.onDirectoryChanged;
595 /** @type {!ChromeEvent} */
596 chrome.fileManagerPrivate.onPreferencesChanged;
598 /** @type {!ChromeEvent} */
599 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
601 /** @type {!ChromeEvent} */
602 chrome.fileManagerPrivate.onDeviceChanged;
604 /** @type {!ChromeEvent} */
605 chrome.fileManagerPrivate.onDriveSyncError;