function FileTransferController(
    doc, listContainer, directoryTree, multiProfileShareDialog,
    confirmationCallback, progressCenter, fileOperationManager, metadataModel,
    thumbnailModel, directoryModel, volumeManager, selectionHandler,
    shouldShowCommandFor) {
  /**
   * @private {!Document}
   * @const
   */
  this.document_ = doc;

  /**
   * @private {!ListContainer}
   * @const
   */
  this.listContainer_ = listContainer;

  /**
   * @private {!FileOperationManager}
   * @const
   */
  this.fileOperationManager_ = fileOperationManager;

  /**
   * @private {!MetadataModel}
   * @const
   */
  this.metadataModel_ = metadataModel;

  /**
   * @private {!ThumbnailModel}
   * @const
   */
  this.thumbnailModel_ = thumbnailModel;

  /**
   * @private {!DirectoryModel}
   * @const
   */
  this.directoryModel_ = directoryModel;

  /**
   * @private {!VolumeManagerWrapper}
   * @const
   */
  this.volumeManager_ = volumeManager;

  /**
   * @private {!FileSelectionHandler}
   * @const
   */
  this.selectionHandler_ = selectionHandler;

  /**
   * @private {!MultiProfileShareDialog}
   * @const
   */
  this.multiProfileShareDialog_ = multiProfileShareDialog;

  /**
   * @private {function(boolean, !Array<string>):
   *     Promise<boolean>}
   * @const
   */
  this.confirmationCallback_ = confirmationCallback;

  /**
   * @private {!ProgressCenter}
   * @const
   */
  this.progressCenter_ = progressCenter;

  /**
   * @private {function((!Entry|!FakeEntry)): boolean}
   * @const
   */
  this.shouldShowCommandFor_ = shouldShowCommandFor;

  /**
   * The array of pending task ID.
   * @type {Array<string>}
   */
  this.pendingTaskIds = [];

  /**
   * Promise to be fulfilled with the thumbnail image of selected file in drag
   * operation. Used if only one element is selected.
   * @private {Promise}
   */
  this.preloadedThumbnailImagePromise_ = null;

  /**
   * File objects for selected files.
   *
   * @private {Object<FileAsyncData>}
   */
  this.selectedAsyncData_ = {};

  /**
   * Drag selector.
   * @private {DragSelector}
   */
  this.dragSelector_ = new DragSelector();

  /**
   * Whether a user is touching the device or not.
   * @private {boolean}
   */
  this.touching_ = false;

  /**
   * Count of the SourceNotFound error.
   * @private {number}
   */
  this.sourceNotFoundErrorCount_ = 0;

  /**
   * @private {!cr.ui.Command}
   * @const
   */
  this.copyCommand_ = /** @type {!cr.ui.Command} */ (
      queryRequiredElement('command#copy', this.document_));

  /**
   * @private {!cr.ui.Command}
   * @const
   */
  this.cutCommand_ = /** @type {!cr.ui.Command} */ (
      queryRequiredElement('command#cut', this.document_));

  /**
   * @private {DirectoryEntry}
   */
  this.destinationEntry_ = null;

  /**
   * @private {EventTarget}
   */
  this.lastEnteredTarget_ = null;

  /**
   * @private {Element}
   */
  this.dropTarget_ = null;

  /**
   * The element for showing a label while dragging files.
   * @private {Element}
   */
  this.dropLabel_ = null;

  /**
   * @private {number}
   */
  this.navigateTimer_ = 0;

  // Register the events.
  selectionHandler.addEventListener(
      FileSelectionHandler.EventType.CHANGE,
      this.onFileSelectionChanged_.bind(this));
  selectionHandler.addEventListener(
      FileSelectionHandler.EventType.CHANGE_THROTTLED,
      this.onFileSelectionChangedThrottled_.bind(this));
  this.attachDragSource_(listContainer.table.list);
  this.attachFileListDropTarget_(listContainer.table.list);
  this.attachDragSource_(listContainer.grid);
  this.attachFileListDropTarget_(listContainer.grid);
  this.attachTreeDropTarget_(directoryTree);
  this.attachCopyPasteHandlers_();

  // Allow to drag external files to the browser window.
  chrome.fileManagerPrivate.enableExternalFileScheme();
}
/**
 * @param {!Document} doc Owning document.
 * @param {!DirectoryTree} directoryTree Directory tree.
 * @param {!ListContainer} listContainer List container.
 * @param {!MultiProfileShareDialog} multiProfileShareDialog Share dialog to be
 *     used to share files from another profile.
 * @param {function(boolean, !Array<string>): !Promise<boolean>}
 *     confirmationCallback called when operation requires user's confirmation.
 *     The opeartion will be executed if the return value resolved to true.
 * @param {!ProgressCenter} progressCenter To notify starting copy operation.
 * @param {!FileOperationManager} fileOperationManager File operation manager
 *     instance.
 * @param {!MetadataModel} metadataModel Metadata cache service.
 * @param {!ThumbnailModel} thumbnailModel
 * @param {!DirectoryModel} directoryModel Directory model instance.
 * @param {!VolumeManagerWrapper} volumeManager Volume manager instance.
 * @param {!FileSelectionHandler} selectionHandler Selection handler.
 * @param {function((!Entry|!FakeEntry)): boolean} shouldShowCommandFor
 * @struct
 * @constructor
 */
@param {!Document} doc Owning document.
@param {!DirectoryTree} directoryTree Directory tree.
@param {!ListContainer} listContainer List container.
@param {!MultiProfileShareDialog} multiProfileShareDialog Share dialog to be
used to share files from another profile.
@param {function(boolean, !Array): !Promise}
confirmationCallback called when operation requires user's confirmation.
The opeartion will be executed if the return value resolved to true.
@param {!ProgressCenter} progressCenter To notify starting copy operation.
@param {!FileOperationManager} fileOperationManager File operation manager
instance.
@param {!MetadataModel} metadataModel Metadata cache service.
@param {!ThumbnailModel} thumbnailModel
@param {!DirectoryModel} directoryModel Directory model instance.
@param {!VolumeManagerWrapper} volumeManager Volume manager instance.
@param {!FileSelectionHandler} selectionHandler Selection handler.
@param { !Document } doc Owning document . @param { !DirectoryTree } directoryTree Directory tree . @param { !ListContainer } listContainer List container . @param { !MultiProfileShareDialog } multiProfileShareDialog Share dialog to be used to share files from another profile . @param { function ( boolean !Array ) : !Promise } confirmationCallback called when operation requires user ' s confirmation . The opeartion will be executed if the return value resolved to true . @param { !ProgressCenter } progressCenter To notify starting copy operation . @param { !FileOperationManager } fileOperationManager File operation manager instance . @param { !MetadataModel } metadataModel Metadata cache service . @param { !ThumbnailModel } thumbnailModel @param { !DirectoryModel } directoryModel Directory model instance . @param { !VolumeManagerWrapper } volumeManager Volume manager instance . @param { !FileSelectionHandler } selectionHandler Selection handler .
function FileTransferController(
    doc, listContainer, directoryTree, multiProfileShareDialog,
    confirmationCallback, progressCenter, fileOperationManager, metadataModel,
    thumbnailModel, directoryModel, volumeManager, selectionHandler,
    shouldShowCommandFor) {
  this.document_ = doc;
  this.listContainer_ = listContainer;
  this.fileOperationManager_ = fileOperationManager;
  this.metadataModel_ = metadataModel;
  this.thumbnailModel_ = thumbnailModel;
  this.directoryModel_ = directoryModel;
  this.volumeManager_ = volumeManager;
  this.selectionHandler_ = selectionHandler;
  this.multiProfileShareDialog_ = multiProfileShareDialog;
  this.confirmationCallback_ = confirmationCallback;
  this.progressCenter_ = progressCenter;
  this.shouldShowCommandFor_ = shouldShowCommandFor;
  this.pendingTaskIds = [];
  this.preloadedThumbnailImagePromise_ = null;
  this.selectedAsyncData_ = {};
  this.dragSelector_ = new DragSelector();
  this.touching_ = false;
  this.sourceNotFoundErrorCount_ = 0;
  this.copyCommand_ =  (
      queryRequiredElement('command#copy', this.document_));
  this.cutCommand_ =  (
      queryRequiredElement('command#cut', this.document_));
  this.destinationEntry_ = null;
  this.lastEnteredTarget_ = null;
  this.dropTarget_ = null;
  this.dropLabel_ = null;
  this.navigateTimer_ = 0;
  selectionHandler.addEventListener(
      FileSelectionHandler.EventType.CHANGE,
      this.onFileSelectionChanged_.bind(this));
  selectionHandler.addEventListener(
      FileSelectionHandler.EventType.CHANGE_THROTTLED,
      this.onFileSelectionChangedThrottled_.bind(this));
  this.attachDragSource_(listContainer.table.list);
  this.attachFileListDropTarget_(listContainer.table.list);
  this.attachDragSource_(listContainer.grid);
  this.attachFileListDropTarget_(listContainer.grid);
  this.attachTreeDropTarget_(directoryTree);
  this.attachCopyPasteHandlers_();
  chrome.fileManagerPrivate.enableExternalFileScheme();
}
function FileTransferController ( doc , listContainer , directoryTree , multiProfileShareDialog , confirmationCallback , progressCenter , fileOperationManager , metadataModel , thumbnailModel , directoryModel , volumeManager , selectionHandler , shouldShowCommandFor ) { this . document_ = doc ; this . listContainer_ = listContainer ; this . fileOperationManager_ = fileOperationManager ; this . metadataModel_ = metadataModel ; this . thumbnailModel_ = thumbnailModel ; this . directoryModel_ = directoryModel ; this . volumeManager_ = volumeManager ; this . selectionHandler_ = selectionHandler ; this . multiProfileShareDialog_ = multiProfileShareDialog ; this . confirmationCallback_ = confirmationCallback ; this . progressCenter_ = progressCenter ; this . shouldShowCommandFor_ = shouldShowCommandFor ; this . pendingTaskIds = [ ] ; this . preloadedThumbnailImagePromise_ = null ; this . selectedAsyncData_ = { } ; this . dragSelector_ = new DragSelector ( ) ; this . touching_ = false ; this . sourceNotFoundErrorCount_ = 0 ; this . copyCommand_ = ( queryRequiredElement ( 'command#copy' , this . document_ ) ) ; this . cutCommand_ = ( queryRequiredElement ( 'command#cut' , this . document_ ) ) ; this . destinationEntry_ = null ; this . lastEnteredTarget_ = null ; this . dropTarget_ = null ; this . dropLabel_ = null ; this . navigateTimer_ = 0 ; selectionHandler . addEventListener ( FileSelectionHandler . EventType . CHANGE , this . onFileSelectionChanged_ . bind ( this ) ) ; selectionHandler . addEventListener ( FileSelectionHandler . EventType . CHANGE_THROTTLED , this . onFileSelectionChangedThrottled_ . bind ( this ) ) ; this . attachDragSource_ ( listContainer . table . list ) ; this . attachFileListDropTarget_ ( listContainer . table . list ) ; this . attachDragSource_ ( listContainer . grid ) ; this . attachFileListDropTarget_ ( listContainer . grid ) ; this . attachTreeDropTarget_ ( directoryTree ) ; this . attachCopyPasteHandlers_ ( ) ; chrome . fileManagerPrivate . enableExternalFileScheme ( ) ; }
@param {!Document} doc Owning document.
@param { !Document } doc Owning document .
/**
   * @private {!Document}
   * @const
   */ /**
   * @private {!ListContainer}
   * @const
   */ /**
   * @private {!FileOperationManager}
   * @const
   */ /**
   * @private {!MetadataModel}
   * @const
   */ /**
   * @private {!ThumbnailModel}
   * @const
   */ /**
   * @private {!DirectoryModel}
   * @const
   */ /**
   * @private {!VolumeManagerWrapper}
   * @const
   */ /**
   * @private {!FileSelectionHandler}
   * @const
   */ /**
   * @private {!MultiProfileShareDialog}
   * @const
   */ /**
   * @private {function(boolean, !Array<string>):
   *     Promise<boolean>}
   * @const
   */ /**
   * @private {!ProgressCenter}
   * @const
   */ /**
   * @private {function((!Entry|!FakeEntry)): boolean}
   * @const
   */ /**
   * The array of pending task ID.
   * @type {Array<string>}
   */ /**
   * Promise to be fulfilled with the thumbnail image of selected file in drag
   * operation. Used if only one element is selected.
   * @private {Promise}
   */ /**
   * File objects for selected files.
   *
   * @private {Object<FileAsyncData>}
   */ /**
   * Drag selector.
   * @private {DragSelector}
   */ /**
   * Whether a user is touching the device or not.
   * @private {boolean}
   */ /**
   * Count of the SourceNotFound error.
   * @private {number}
   */ /**
   * @private {!cr.ui.Command}
   * @const
   */ /** @type {!cr.ui.Command} */ /**
   * @private {!cr.ui.Command}
   * @const
   */ /** @type {!cr.ui.Command} */ /**
   * @private {DirectoryEntry}
   */ /**
   * @private {EventTarget}
   */ /**
   * @private {Element}
   */ /**
   * The element for showing a label while dragging files.
   * @private {Element}
   */ /**
   * @private {number}
   */ // Register the events. // Allow to drag external files to the browser window.