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,
92 * processed: (number|undefined),
93 * total: (number|undefined),
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 * Requests access to a file system volume. |volumeId| The ID of the file
274 * system volume to request. The volume ID is delivered to JavaScript as
275 * part of VolumeMetadata. By specifying "compatible", this function
276 * behaves in the compatible mode, where the returned FileSystem object
277 * gives access to all file system volumes such as Downloads folder and
278 * removal media like SD cards (i.e. all volumes are provided inside the
279 * single FileSystem object). In the new "per-volume FileSystem object
280 * model" crbug.com/322305, a separate FileSystem object is created for
281 * each volume. "compatible" parameter will be removed once Files.app is
282 * switched to the per-volume FileSystem object model. |callback|
283 * @param {string} volumeId
284 * @param {Function} callback |fileSystem| A DOMFileSystem instance for local
285 * file system access. null if the caller has no appropriate permissions.
287 chrome.fileManagerPrivate.requestFileSystem = function(volumeId, callback) {};
290 * Selects multiple files. |selectedPaths| Array of selected paths
291 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
293 * @param {Array} selectedPaths
294 * @param {boolean} shouldReturnLocalPath
295 * @param {Function} callback Callback that does not take arguments.
297 chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLocalPath, callback) {};
300 * Selects a file. |selectedPath| A selected path |index| Index of Filter
301 * |forOpening| true if paths are selected for opening. false if for saving.
302 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
304 * @param {string} selectedPath
305 * @param {number} index
306 * @param {boolean} forOpening
307 * @param {boolean} shouldReturnLocalPath
308 * @param {Function} callback Callback that does not take arguments.
310 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening, shouldReturnLocalPath, callback) {};
313 * Requests additional properties for files. |fileUrls| list of URLs of files
315 * @param {!Array<string>} fileUrls
316 * @param {!Array<string>} names
317 * @param {!Function} callback |entryProperties| A dictionary containing
318 * properties of the requested entries.
320 chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, names, callback) {};
323 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
324 * |pin| Pass true to pin the file. |callback| Completion callback.
325 * $(ref:runtime.lastError) will be set if there was an error.
326 * @param {string} fileUrl
327 * @param {boolean} pin
328 * @param {Function=} callback Callback that does not take arguments.
330 chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {};
333 * Resolves file entries in the isolated file system and returns corresponding
334 * entries in the external file system mounted to Chrome OS file manager
335 * backend. If resolving entry fails, the entry will be just ignored and the
336 * corresponding entry does not appear in the result.
337 * @param {Array} entries
338 * @param {Function} callback |entryUrl| URL of an entry in a normal file
341 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {};
344 * Mount a resource or a file. |source| Mount point source. For compressed
345 * files it is relative file path within external file system |callback|
346 * @param {string} source
347 * @param {Function} callback |sourcePath| Source path of the mount.
349 chrome.fileManagerPrivate.addMount = function(source, callback) {};
352 * Unmounts a mounted resource. |volumeId| An ID of the volume.
353 * @param {string} volumeId
355 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
358 * Get the list of mounted volumes. |callback|
359 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata
360 * representing mounted volumes.
362 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
365 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
366 * for which ongoing transfer should be canceled. If this is absent, all
367 * jobs are canceled. |callback|
368 * @param {Array=} fileUrls
369 * @param {Function=} callback |fileTransferCancelStatuses| The list of
370 * FileTransferCancelStatus.
372 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};
375 * Starts to copy an entry. If the source is a directory, the copy is done
376 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL
377 * of the destination directory. |newName| Name of the new entry. It shouldn't
378 * contain '/'. |callback| Completion callback.
379 * @param {string} sourceUrl
380 * @param {string} parent
381 * @param {string} newName
382 * @param {Function} callback |copyId| ID of the copy task. Can be used to
383 * identify the progress, and to cancel the task.
385 chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callback) {};
388 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
389 * |callback| Completion callback of the cancel.
390 * @param {number} copyId
391 * @param {Function=} callback Callback that does not take arguments.
393 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
396 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
397 * volume to be checked. |callback|
398 * @param {string} volumeId
399 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will
400 * be undefined if stats could not be determined.
402 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
405 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
406 * @param {string} volumeId
408 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
411 * Retrieves file manager preferences. |callback|
412 * @param {Function} callback
414 chrome.fileManagerPrivate.getPreferences = function(callback) {};
417 * Sets file manager preferences. |changeInfo|
418 * @param {PreferencesChange} changeInfo
420 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
423 * Performs drive content search. |searchParams| |callback|
424 * @param {SearchParams} searchParams
425 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains
426 * next chunk of the search result. Should be sent to the next searchDrive
427 * request to perform incremental search.
429 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
432 * Performs drive metadata search. |searchParams| |callback|
433 * @param {SearchMetadataParams} searchParams
434 * @param {Function} callback
436 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};
439 * Search for files in the given volume, whose content hash matches the list of
441 * @param {string} volumeId
442 * @param {!Array<string>} hashes
443 * @param {function(!Object<string, !Array<string>>)} callback
445 chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes, callback) {};
448 * Create a zip file for the selected files. |dirURL| URL of the directory
449 * containing the selected files. |selectionUrls| URLs of the selected files.
450 * The files must be under the directory specified by dirURL. |destName|
451 * Name of the destination zip file. The zip file will be created under the
452 * directory specified by dirURL. |callback|
453 * @param {string} dirURL
454 * @param {Array} selectionUrls
455 * @param {string} destName
456 * @param {Function=} callback
458 chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destName, callback) {};
461 * Retrieves the state of the current drive connection. |callback|
462 * @param {Function} callback
464 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
467 * Checks whether the path name length fits in the limit of the filesystem.
468 * |parent_directory_url| The URL of the parent directory entry. |name| The
469 * name of the file. |callback| Called back when the check is finished.
470 * @param {string} parent_directory_url
471 * @param {string} name
472 * @param {Function} callback |result| true if the length is in the valid
473 * range, false otherwise.
475 chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url, name, callback) {};
478 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
479 * @param {string} operation
481 chrome.fileManagerPrivate.zoom = function(operation) {};
484 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
485 * be refetched instead of using the cached one. |callback|
486 * @param {boolean} refresh
487 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
488 * string if failed to fetch.
490 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
493 * Requests a Webstore API OAuth2 access token. |callback|
494 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
495 * string if failed to fetch.
497 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
500 * Requests a share dialog url for the specified file. |url| Url for the file.
502 * @param {string} url
503 * @param {Function} callback |url| Result url.
505 chrome.fileManagerPrivate.getShareUrl = function(url, callback) {};
508 * Requests a download url to download the file contents. |url| Url for the
510 * @param {string} url
511 * @param {Function} callback |url| Result url.
513 chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {};
516 * Requests to share drive files. |url| URL of a file to be shared. |shareType|
517 * Type of access that is getting granted.
518 * @param {string} url
519 * @param {string} shareType
520 * @param {Function} callback Callback that does not take arguments.
522 chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback) {};
525 * Requests to install a webstore item. |item_id| The id of the item to
526 * install. |silentInstallation| False to show installation prompt. True not to
528 * @param {string} itemId
529 * @param {boolean} silentInstallation
530 * @param {Function} callback Callback that does not take arguments.
532 chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallation, callback) {};
535 * Obtains a list of profiles that are logged-in.
536 * @param {Function} callback |profiles| List of profile information.
537 * |runningProfile| ID of the profile that runs the application instance.
538 * |showingProfile| ID of the profile that shows the application window.
540 chrome.fileManagerPrivate.getProfiles = function(callback) {};
543 * Opens inspector window. |type| InspectionType which specifies how to open
545 * @param {string} type
547 chrome.fileManagerPrivate.openInspector = function(type) {};
550 * Computes an MD5 checksum for the given file.
551 * @param {string} fileUrl
552 * @param {function(string)} callback
554 chrome.fileManagerPrivate.computeChecksum = function(fileUrl, callback) {};
557 * Gets the MIME type of a file.
558 * @param {string} fileUrl File url.
559 * @param {function(string)} callback Callback that MIME type of the file is
562 chrome.fileManagerPrivate.getMimeType = function(fileUrl, callback) {};
565 * Gets a flag indicating whether user metrics reporting is enabled.
566 * @param {function(boolean)} callback
568 chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};
570 /** @type {!ChromeEvent} */
571 chrome.fileManagerPrivate.onMountCompleted;
573 /** @type {!ChromeEvent} */
574 chrome.fileManagerPrivate.onFileTransfersUpdated;
576 /** @type {!ChromeEvent} */
577 chrome.fileManagerPrivate.onCopyProgress;
579 /** @type {!ChromeEvent} */
580 chrome.fileManagerPrivate.onDirectoryChanged;
582 /** @type {!ChromeEvent} */
583 chrome.fileManagerPrivate.onPreferencesChanged;
585 /** @type {!ChromeEvent} */
586 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
588 /** @type {!ChromeEvent} */
589 chrome.fileManagerPrivate.onDeviceChanged;
591 /** @type {!ChromeEvent} */
592 chrome.fileManagerPrivate.onDriveSyncError;