| Index: ui/file_manager/externs/background/media_import_handler.js
|
| diff --git a/ui/file_manager/externs/background/media_import_handler.js b/ui/file_manager/externs/background/media_import_handler.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..68c88605cc93f4bb24c71824d087b84228abd816
|
| --- /dev/null
|
| +++ b/ui/file_manager/externs/background/media_import_handler.js
|
| @@ -0,0 +1,92 @@
|
| +// Copyright 2017 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
|
| +var importer;
|
| +
|
| +/**
|
| + * Interface providing access to information about active import processes.
|
| + *
|
| + * @interface
|
| + */
|
| +importer.ImportRunner = function() {};
|
| +
|
| +/**
|
| + * Imports all media identified by scanResult.
|
| + *
|
| + * @param {!importer.ScanResult} scanResult
|
| + * @param {!importer.Destination} destination
|
| + * @param {!Promise<!DirectoryEntry>} directoryPromise
|
| + *
|
| + * @return {!importer.MediaImportHandler.ImportTask} The resulting import task.
|
| + */
|
| +importer.ImportRunner.prototype.importFromScanResult;
|
| +
|
| +
|
| +/**
|
| + * Handler for importing media from removable devices into the user's Drive.
|
| + *
|
| + * @constructor
|
| + * @implements {importer.ImportRunner}
|
| + * @struct
|
| + */
|
| +importer.MediaImportHandler = function() {};
|
| +
|
| +/** @override */
|
| +importer.MediaImportHandler.prototype.importFromScanResult = function(
|
| + scanResult, destination, directoryPromise) {};
|
| +
|
| +/**
|
| + * Note that this isn't an actual FileOperationManager.Task. It currently uses
|
| + * the FileOperationManager (and thus *spawns* an associated
|
| + * FileOperationManager.CopyTask) but this is a temporary state of affairs.
|
| + *
|
| + * @constructor
|
| + * @extends {importer.TaskQueue.BaseTask}
|
| + * @struct
|
| + *
|
| + */
|
| +importer.MediaImportHandler.ImportTask = function() {};
|
| +
|
| +
|
| +/** @struct */
|
| +importer.MediaImportHandler.ImportTask.prototype = {
|
| + /** @return {number} Number of imported bytes */
|
| + get processedBytes() {},
|
| +
|
| + /** @return {number} Total number of bytes to import */
|
| + get totalBytes() {},
|
| +
|
| + /** @return {number} Number of files left to import */
|
| + get remainingFilesCount() {}
|
| +};
|
| +
|
| +/**
|
| + * Update types that are specific to ImportTask. Clients can add Observers to
|
| + * ImportTask to listen for these kinds of updates.
|
| + * @enum {string}
|
| + */
|
| +importer.MediaImportHandler.ImportTask.UpdateType = {};
|
| +
|
| +/**
|
| + * Auxilliary info for ENTRY_CHANGED notifications.
|
| + * @typedef {{
|
| + * sourceUrl: string,
|
| + * destination: !Entry
|
| + * }}
|
| + */
|
| +importer.MediaImportHandler.ImportTask.EntryChangedInfo;
|
| +
|
| +/**
|
| + * Extends importer.TaskQueue.Task
|
| + */
|
| +importer.MediaImportHandler.ImportTask.prototype.__proto__ =
|
| + importer.TaskQueue.BaseTask.prototype;
|
| +
|
| +
|
| +/**
|
| + * Request cancellation of this task. An update will be sent to observers once
|
| + * the task is actually cancelled.
|
| + */
|
| +importer.MediaImportHandler.ImportTask.prototype.requestCancel = function() {};
|
|
|