// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace":"fileBrowserPrivate",
"nodoc": "true",
"types": [
{
"id": "FileBrowserTask",
"type": "object",
"description": "Represents information about available browser tasks. A task is an abstraction of an operation that the file browser can perform over a selected file set.",
"properties": {
"taskId": {"type": "string", "description": "The unique identifier of the task."},
"description": "Specifies type of event that is raised."
},
"directoryUrl": {
"type": "string",
"description": "URL of watched directory."
},
"changedEntries": {
"type": "array",
"items": {"$ref": "FileWatchChangedEntry"}
}
}
},
{
"id": "FileWatchChangedEntry",
"type": "object",
"description": "Information about changed file or directory",
"properties": {
"type": "string",
"enum": ["added", "deleted", "updated"],
"description": "Specifies type of the change."
},
"fileUrl": {
"type": "string",
"description": "URL of the changed file."
}
}
],
"functions": [
{
"name": "cancelDialog",
"type": "function",
"description": "Cancels file selection.",
"parameters": []
},
{
"name": "executeTask",
"description": "Executes file browser task over selected files",
"parameters": [
{
"name": "taskId",
"type": "string",
"description": "The unique identifier of task to execute."
},
{
"name": "fileURLs",
"type": "array",
"description": "Array of file URLs",
"items": { "type": "string" }
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "success",
"type": "boolean",
"optional": true,
"description": "True of task execution was successfully initiated."
}
]
}
]
},
{
"name": "setDefaultTask",
"description": "Sets the default task for the supplied MIME types and suffixes of the supplied file URLs. Lists of MIME types and URLs may contain duplicates.",
"parameters": [
{
"name": "taskId",
"type": "string",
"description": "The unique identifier of task to mark as default."
},
{
"name": "fileURLs",
"type": "array",
"description": "Array of selected file URLs to extract suffixes from.",
"items": { "type": "string" }
},
{
"name": "mimeTypes",
"type": "array",
"optional": true,
"description": "Array of selected file MIME types.",
"items": { "type": "string" }
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
},
{
"name": "getFileTasks",
"description": "Gets the list of tasks that can be performed over selected files.",
"parameters": [
{
"name": "fileURLs",
"type": "array",
"description": "Array of selected file URLs",
"items": { "type": "string" }
},
{
"name": "mimeTypes",
"type": "array",
"description": "Array of selected file MIME types",
"items": { "type": "string" }
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "tasks",
"type": "array",
"items": {"$ref": "FileBrowserTask"},
"description": "The list of matched file URL patterns for this task."
}
]
}
]
},
{
"name": "getStrings",
"type": "function",
"description": "Gets localized strings and initialization data.",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "result",
"type": "object",
"additionalProperties": { "type": "any" }
}
]
}
]
},
{
"name": "addFileWatch",
"description": "Adds file watch.",
"parameters": [
{
"name": "fileUrl",
"type": "string",
"description": "URL of file to watch"
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "success",
"type": "boolean",
"optional": true,
"description": "True when file watch is successfully added."
}
]
}
]
},
{
"name": "removeFileWatch",
"description": "Removes file watch.",
"parameters": [
{
"name": "fileUrl",
"type": "string",
"description": "URL of watched file to remove"
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "success",
"type": "boolean",
"optional": true,
"description": "True when file watch is successfully removed."
}
]
}
]
},
{
"name": "requestLocalFileSystem",
"description": "Requests access to local file system",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "fileSystem",
"type": "object",
"optional": true,
"description": "A DOMFileSystem instance for local file system access. null if the caller has no appropriate permissions."
}
]
}
]
},
{
"name": "selectFiles",
"type": "function",
"description": "Selects multiple files.",
"parameters": [
{
"name": "selectedPaths",
"type": "array",
"description": "Array of selected paths",
"items": {"type": "string"}
}
]
},
{
"name": "selectFile",
"type": "function",
"description": "Selects a file.",
"parameters": [
{
"name": "selectedPath",
"type": "string",
"description": "A selected path"
},
{
"name": "index",
"type": "integer",
"description": "Index of Filter"
}
]
},
{
"name": "viewFiles",
"type": "function",
"description": "Views multiple files.",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of selected paths",
"items": {"type": "string"}
},
{
"name": "id",
"type": "string",
"description": "File browser handler id as for internal tasks."
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "success",
"type": "boolean",
"description": "True if the selected files can be viewed by the browser."
}
]
}
]
},
{
"name": "getDriveFileProperties",
"description": "Requests Drive file properties for a list of files",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of file URLs to fetch properties for."
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "fileProperties",
"type": "array",
"items": {"$ref": "DriveFileProperties"},
"description": "An array of the requested file properties, one entry for each file in fileUrls."
}
]
}
]
},
{
"name": "pinDriveFile",
"description": "Pins/unpins a Drive file in the cache",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of file URLs to pin/unpin."
},
{
"name": "pin",
"type": "boolean",
"description": "Pass true to pin the files listed."
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "fileProperties",
"type": "array",
"items": {"$ref": "DriveFileProperties"},
"description": "An array of the pinned properties after pinning/unpinning the requested files, one entry for each file in fileUrls."
}
]
}
]
},
{
"name": "getFileLocations",
"description": "Get file locations",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of file URLs to check.",
"items": { "type": "string" }
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "locations",
"type": "array",
"items": {"type": "string"},
"description": "An array of the file locations for the requested files, one entry for each file in fileUrls."
}
]
}
]
},
{
"name": "getDriveFiles",
"description": "Get Drive files",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of Drive file URLs to get.",
"items": { "type": "string" }
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "localFilePaths",
"type": "array",
"items": {"type": "string"},
"description": "An array of the local file paths for the requested files, one entry for each file in fileUrls."
}
]
}
]
},
{
"name": "getVolumeMetadata",
"description": "Requests volume's metadata",
"parameters": [
{
"name": "mountUrl",
"type": "string",
"description": "Mount url of the volume."
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "volumeMetadata",
"$ref": "VolumeMetadata",
"optional": true,
"description": "A requested metadata dictionary object. undefined if there is no volume with selected devicePath"
}
]
}
]
},
{
"name": "addMount",
"description": "Mount a resource or a file.",
"parameters": [
{
"name": "source",
"type": "string",
"description": "Mount point source. For compressed files it is relative file path within external file system"
},
{
"name": "mountType",
"type": "string",
"enum": ["device", "file", "network", "drive"],
"description": "Mount point type. 'file' for compressed files"
},
{
"name": "options",
"type": "object",
"description": "Name/value pairs for source specific options"
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "sourcePath",
"type": "string",
"description": "Source path of the mount."
}
]
}
]
},
{
"name": "removeMount",
"description": "Unmounts a mounted resource.",
"parameters": [
{
"name": "mountPath",
"type": "string",
"description": "A path of the mount."
}
]
},
{
"name": "getMountPoints",
"description": "Get the list of mount points.",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "mountPoints",
"type": "array",
"items": {"$ref": "MountPointInfo"},
"description": "The list of MountPointInfo representing mounted devices."
}
]
}
]
},
{
"name": "getFileTransfers",
"description": "Get the list of ongoing file transfer operations.",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "fileTransfers",
"type": "array",
"items": {"$ref": "FileTransferStatus"},
"description": "The list of FileTransferStatus representing ongoing file transfers."
}
]
}
]
},
{
"name": "transferFile",
"description": "Transfers file from local to remote file system.",
"parameters": [
{
"name": "sourceFileUrl",
"type": "string",
"description": "Source file from the local file system."
},
{
"name": "destinationFileUrl",
"type": "string",
"description": "Destination file on the remote file system."
},
{
"name": "callback",
"type": "function",
"optional": true,
"description": "Completion callback. chrome.extension.lastError will be set if there was an error.",
"parameters": []
}
]
},
{
"name": "cancelFileTransfers",
"description": "Cancels ongoing file transfers for selected files.",
"parameters": [
{
"name": "fileUrls",
"type": "array",
"description": "Array of files for which ongoing transfer should be canceled.",
"items": {"type": "string"}
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "fileTransferCancelStatuses",
"type": "array",
"items": {"$ref": "FileTransferCancelStatus"},
"description": "The list of FileTransferCancelStatus."
}
]
}
]
},
{
"name": "setLastModified",
"description": "Updates last modified to specified time in seconds",
"parameters": [
{
"name": "fileUrl",
"type": "string",
"description": "File url from the local file system."
},
{
"name": "lastModified",
"type": "string",
"description": "Date to set as last modification date in ms. Should be passed to C++ as string, since 'long' type isn't supported"
},
{
"name": "callback",
"type": "function",
"optional": true,
"description": "Completion callback. chrome.extension.lastError will be set if there was an error.",
"parameters": []
}
]
},
{
"name": "getSizeStats",
"description": "Retrieves total and remaining size of a mount point.",
"parameters": [
{
"name": "mountPath",
"type": "string",
"description": "Mount point path."
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "sizeStats",
"optional": true,
"$ref": "MountPointSizeStats",
"description": "Name/value pairs of size stats. Will be undefined if stats could not be determined."
}
]
}
]
},
{
"name": "formatDevice",
"description": "Formats a mounted device",
"parameters": [
{
"name": "mountPath",
"type": "string",
"description": "Device's mount path."
}
]
},
{
"name": "toggleFullscreen",
"description": "Switches fullscreen mode on/off for the File Browser.",
"parameters": []
},
{
"name": "isFullscreen",
"description": "Checks if the browser is in fullscreen mode.",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name" : "result",
"type": "boolean",
"description": "Whether the browser is in fullscreen mode."
"description": "If this is a request for files shared with me or not."
},
"nextFeed": {
"type": "string",
"optional": true,
"description": "ID of the search feed that should be fetched next. Value passed here should be gotten from previous searchDrive call. It can be empty for the initial search request."
}
}
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "results",
"type": "array",
"items": {
"type": "object",
"properties": {
"entry": {
"type": "object",
"isInstanceOf": "Entry",
"description": "A dictionary object which represents a Drive file. This will be converted into a kind of FileEntry object. See file_browser_handler_custom_bindings.cc for details. For filesystem API's Entry interface, see <a href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry interface</a>."
},
"properties": {
"$ref": "DriveFileProperties"
}
},
"description": "Entry and Drive-related properties representing a search result."
}
},
{
"name": "nextFeed",
"type": "string",
"description": "ID of the feed that contains next chunk of the search result. Should be sent to the next searchDrive request to perform incremental search."
}
]
}
]
},
{
"name": "clearDriveCache",
"description": "Clear all Drive local caches.",
"parameters": []
},
{
"name": "reloadDrive",
"description": "Reload the filesystem metadata from the server immediately.",
"parameters": []
},
{
"name": "zipSelection",
"description": "Create a zip file for the selected files.",
"parameters": [
{
"name": "dirURL",
"type": "string",
"description": "URL of the directory containing the selected files."
},
{
"name": "selectionURLs",
"type": "array",
"description": "URLs of the selected files. The files must be under the directory specified by dirURL.",
"items": { "type": "string" }
},
{
"name": "destName",
"type": "string",
"description": "Name of the destination zip file. The zip file will be created under the directory specified by dirURL."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name" : "success",
"type" : "boolean",
"optional": true
}
]
}
]
},
{
"name": "getNetworkConnectionState",
"description": "Retrieves the state of the currently active network connection.",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "result",
"type": "object",
"properties": {
"type": {"type": "string"},
"online": {"type": "boolean"}
}
}
]
}
]
},
{
"name": "requestDirectoryRefresh",
"description": "Requests a refresh of a directory. Used to get the latest metadata of files in a particular directory. Upon completion, onDirectoryChanged event is raised against the target directory, so that the file browser can redraw contents in the directory. Note that the onFileChanged event can be raised even if there is no change in the directory as it's expensive to check if the new contents match the existing ones.",
"parameters": [
{
"name": "fileURL",
"type": "string",
"description": "URL of the target directory"
}
]
}
],
"events": [
{
"name": "onDiskChanged",
"type": "function",
"description": "Fired when disk mount/unmount event is detected.",
"parameters": [
{
"$ref": "MountEvent",
"name": "event",
"description": "Mount event information."
}
]
},
{
"name": "onMountCompleted",
"type": "function",
"description": "Fired when mount event is detected.",
"description": "Fired when file transfers with remote file system are in progress.",
"parameters": [
{
"type": "array",
"items": {"$ref": "FileTransferStatus"},
"name": "event",
"description": "List of ongoing file statuses for ongoing transfer operations."
}
]
},
{
"name": "onDirectoryChanged",
"type": "function",
"description": "Fired when watched file change event is detected in a watched directory.",
"parameters": [
{
"$ref": "FileWatchEvent",
"name": "event",
"description": "File watch event information."
}
]
},
{
"name": "onDocumentFeedFetched",
"type": "function",
"description": "Fired when a document feed is fetched.",
"parameters": [
{
"type": "integer",
"name": "entriesFetched",
"description": "Number of entries fetched so far."
}
]
},
{
"name": "onPreferencesChanged",
"type": "function",
"description": "Fired when file manager preferences change. The preferences can be retrieved via 'getPreferences'.",
"parameters": []
},
{
"name": "onNetworkConnectionChanged",
"type": "function",
"description": "Fired when the active network connection state changes. The network connection state can be retrieved via 'getNetworkConnectionState'.",