function DirectoryModel(
    singleSelection,
    fileFilter,
    metadataModel,
    volumeManager,
    fileOperationManager,
    tracker) {
  this.fileListSelection_ = singleSelection ?
      new FileListSingleSelectionModel() : new FileListSelectionModel();

  this.runningScan_ = null;
  this.pendingScan_ = null;
  this.rescanTime_ = null;
  this.scanFailures_ = 0;
  this.changeDirectorySequence_ = 0;

  /**
   * @private {boolean}
   */
  this.ignoreCurrentDirectoryDeletion_ = false;

  this.directoryChangeQueue_ = new AsyncUtil.Queue();
  this.rescanAggregator_ = new AsyncUtil.Aggregator(
      this.rescanSoon.bind(this, true), 500);

  this.fileFilter_ = fileFilter;
  this.fileFilter_.addEventListener('changed',
                                    this.onFilterChanged_.bind(this));

  this.currentFileListContext_ =
      new FileListContext(fileFilter, metadataModel);
  this.currentDirContents_ =
      DirectoryContents.createForDirectory(this.currentFileListContext_, null);
  /**
   * Empty file list which is used as a dummy for inactive view of file list.
   * @private {!FileListModel}
   */
  this.emptyFileList_ = new FileListModel(metadataModel);

  this.metadataModel_ = metadataModel;

  this.volumeManager_ = volumeManager;
  this.volumeManager_.volumeInfoList.addEventListener(
      'splice', this.onVolumeInfoListUpdated_.bind(this));

  /**
   * File watcher.
   * @private {!FileWatcher}
   * @const
   */
  this.fileWatcher_ = new FileWatcher();
  this.fileWatcher_.addEventListener(
      'watcher-directory-changed',
      this.onWatcherDirectoryChanged_.bind(this));
  util.addEventListenerToBackgroundComponent(
      fileOperationManager,
      'entries-changed',
      this.onEntriesChanged_.bind(this));

  /** @private {!analytics.Tracker} */
  this.tracker_ = tracker;

  /** @private {string} */
  this.lastSearchQuery_ = '';
}
/**
 * Data model of the file manager.
 *
 * @constructor
 * @extends {cr.EventTarget}
 *
 * @param {boolean} singleSelection True if only one file could be selected
 *                                  at the time.
 * @param {FileFilter} fileFilter Instance of FileFilter.
 * @param {!MetadataModel} metadataModel Metadata model.
 *     service.
 * @param {VolumeManagerWrapper} volumeManager The volume manager.
 * @param {!FileOperationManager} fileOperationManager File operation manager.
 * @param {!analytics.Tracker} tracker
 */
Data model of the file manager.

@param {boolean} singleSelection True if only one file could be selected
at the time.
Data model of the file manager . @param { boolean } singleSelection True if only one file could be selected at the time .
function DirectoryModel(
    singleSelection,
    fileFilter,
    metadataModel,
    volumeManager,
    fileOperationManager,
    tracker) {
  this.fileListSelection_ = singleSelection ?
      new FileListSingleSelectionModel() : new FileListSelectionModel();
  this.runningScan_ = null;
  this.pendingScan_ = null;
  this.rescanTime_ = null;
  this.scanFailures_ = 0;
  this.changeDirectorySequence_ = 0;
  this.ignoreCurrentDirectoryDeletion_ = false;
  this.directoryChangeQueue_ = new AsyncUtil.Queue();
  this.rescanAggregator_ = new AsyncUtil.Aggregator(
      this.rescanSoon.bind(this, true), 500);
  this.fileFilter_ = fileFilter;
  this.fileFilter_.addEventListener('changed',
                                    this.onFilterChanged_.bind(this));
  this.currentFileListContext_ =
      new FileListContext(fileFilter, metadataModel);
  this.currentDirContents_ =
      DirectoryContents.createForDirectory(this.currentFileListContext_, null);
  this.emptyFileList_ = new FileListModel(metadataModel);
  this.metadataModel_ = metadataModel;
  this.volumeManager_ = volumeManager;
  this.volumeManager_.volumeInfoList.addEventListener(
      'splice', this.onVolumeInfoListUpdated_.bind(this));
  this.fileWatcher_ = new FileWatcher();
  this.fileWatcher_.addEventListener(
      'watcher-directory-changed',
      this.onWatcherDirectoryChanged_.bind(this));
  util.addEventListenerToBackgroundComponent(
      fileOperationManager,
      'entries-changed',
      this.onEntriesChanged_.bind(this));
  this.tracker_ = tracker;
  this.lastSearchQuery_ = '';
}
function DirectoryModel ( singleSelection , fileFilter , metadataModel , volumeManager , fileOperationManager , tracker ) { this . fileListSelection_ = singleSelection ? new FileListSingleSelectionModel ( ) : new FileListSelectionModel ( ) ; this . runningScan_ = null ; this . pendingScan_ = null ; this . rescanTime_ = null ; this . scanFailures_ = 0 ; this . changeDirectorySequence_ = 0 ; this . ignoreCurrentDirectoryDeletion_ = false ; this . directoryChangeQueue_ = new AsyncUtil . Queue ( ) ; this . rescanAggregator_ = new AsyncUtil . Aggregator ( this . rescanSoon . bind ( this , true ) , 500 ) ; this . fileFilter_ = fileFilter ; this . fileFilter_ . addEventListener ( 'changed' , this . onFilterChanged_ . bind ( this ) ) ; this . currentFileListContext_ = new FileListContext ( fileFilter , metadataModel ) ; this . currentDirContents_ = DirectoryContents . createForDirectory ( this . currentFileListContext_ , null ) ; this . emptyFileList_ = new FileListModel ( metadataModel ) ; this . metadataModel_ = metadataModel ; this . volumeManager_ = volumeManager ; this . volumeManager_ . volumeInfoList . addEventListener ( 'splice' , this . onVolumeInfoListUpdated_ . bind ( this ) ) ; this . fileWatcher_ = new FileWatcher ( ) ; this . fileWatcher_ . addEventListener ( 'watcher-directory-changed' , this . onWatcherDirectoryChanged_ . bind ( this ) ) ; util . addEventListenerToBackgroundComponent ( fileOperationManager , 'entries-changed' , this . onEntriesChanged_ . bind ( this ) ) ; this . tracker_ = tracker ; this . lastSearchQuery_ = '' ; }
Data model of the file manager.
Data model of the file manager .
/**
   * @private {boolean}
   */ /**
   * Empty file list which is used as a dummy for inactive view of file list.
   * @private {!FileListModel}
   */ /**
   * File watcher.
   * @private {!FileWatcher}
   * @const
   */ /** @private {!analytics.Tracker} */ /** @private {string} */