| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 // Namespace |
| 6 var importer; |
| 7 |
| 8 /** |
| 9 * Interface providing access to information about active import processes. |
| 10 * |
| 11 * @interface |
| 12 */ |
| 13 importer.ImportRunner = function() {}; |
| 14 |
| 15 /** |
| 16 * Imports all media identified by scanResult. |
| 17 * |
| 18 * @param {!importer.ScanResult} scanResult |
| 19 * @param {!importer.Destination} destination |
| 20 * @param {!Promise<!DirectoryEntry>} directoryPromise |
| 21 * |
| 22 * @return {!importer.MediaImportHandler.ImportTask} The resulting import task. |
| 23 */ |
| 24 importer.ImportRunner.prototype.importFromScanResult; |
| 25 |
| 26 |
| 27 /** |
| 28 * Handler for importing media from removable devices into the user's Drive. |
| 29 * |
| 30 * @constructor |
| 31 * @implements {importer.ImportRunner} |
| 32 * @struct |
| 33 */ |
| 34 importer.MediaImportHandler = function() {}; |
| 35 |
| 36 /** @override */ |
| 37 importer.MediaImportHandler.prototype.importFromScanResult = function( |
| 38 scanResult, destination, directoryPromise) {}; |
| 39 |
| 40 /** |
| 41 * Note that this isn't an actual FileOperationManager.Task. It currently uses |
| 42 * the FileOperationManager (and thus *spawns* an associated |
| 43 * FileOperationManager.CopyTask) but this is a temporary state of affairs. |
| 44 * |
| 45 * @constructor |
| 46 * @extends {importer.TaskQueue.BaseTask} |
| 47 * @struct |
| 48 * |
| 49 */ |
| 50 importer.MediaImportHandler.ImportTask = function() {}; |
| 51 |
| 52 |
| 53 /** @struct */ |
| 54 importer.MediaImportHandler.ImportTask.prototype = { |
| 55 /** @return {number} Number of imported bytes */ |
| 56 get processedBytes() {}, |
| 57 |
| 58 /** @return {number} Total number of bytes to import */ |
| 59 get totalBytes() {}, |
| 60 |
| 61 /** @return {number} Number of files left to import */ |
| 62 get remainingFilesCount() {} |
| 63 }; |
| 64 |
| 65 /** |
| 66 * Update types that are specific to ImportTask. Clients can add Observers to |
| 67 * ImportTask to listen for these kinds of updates. |
| 68 * @enum {string} |
| 69 */ |
| 70 importer.MediaImportHandler.ImportTask.UpdateType = {}; |
| 71 |
| 72 /** |
| 73 * Auxilliary info for ENTRY_CHANGED notifications. |
| 74 * @typedef {{ |
| 75 * sourceUrl: string, |
| 76 * destination: !Entry |
| 77 * }} |
| 78 */ |
| 79 importer.MediaImportHandler.ImportTask.EntryChangedInfo; |
| 80 |
| 81 /** |
| 82 * Extends importer.TaskQueue.Task |
| 83 */ |
| 84 importer.MediaImportHandler.ImportTask.prototype.__proto__ = |
| 85 importer.TaskQueue.BaseTask.prototype; |
| 86 |
| 87 |
| 88 /** |
| 89 * Request cancellation of this task. An update will be sent to observers once |
| 90 * the task is actually cancelled. |
| 91 */ |
| 92 importer.MediaImportHandler.ImportTask.prototype.requestCancel = function() {}; |
| OLD | NEW |