function FileBrowserBackgroundImpl() {
  BackgroundBase.call(this);

  /** @type {!analytics.Tracker} */
  this.tracker = metrics.getTracker();

  /**
   * Progress center of the background page.
   * @type {!ProgressCenter}
   */
  this.progressCenter = new ProgressCenter();

  /**
   * File operation manager.
   * @type {FileOperationManager}
   */
  this.fileOperationManager = null;

  /**
   * Class providing loading of import history, used in
   * cloud import.
   *
   * @type {!importer.HistoryLoader}
   */
  this.historyLoader = new importer.RuntimeHistoryLoader(this.tracker);

  /**
   * Event handler for progress center.
   * @private {FileOperationHandler}
   */
  this.fileOperationHandler_ = null;

  /**
   * Event handler for C++ sides notifications.
   * @private {!DeviceHandler}
   */
  this.deviceHandler_ = new DeviceHandler();

  // Handle device navigation requests.
  this.deviceHandler_.addEventListener(
      DeviceHandler.VOLUME_NAVIGATION_REQUESTED,
      this.handleViewEvent_.bind(this));

  /**
   * Drive sync handler.
   * @type {!DriveSyncHandler}
   */
  this.driveSyncHandler = new DriveSyncHandler(this.progressCenter);

  /**
   * @type {!importer.DispositionChecker.CheckerFunction}
   */
  this.dispositionChecker_ = importer.DispositionChecker.createChecker(
      this.historyLoader, this.tracker);

  /**
   * Provides support for scaning media devices as part of Cloud Import.
   * @type {!importer.MediaScanner}
   */
  this.mediaScanner = new importer.DefaultMediaScanner(
      importer.createMetadataHashcode,
      this.dispositionChecker_,
      importer.DefaultDirectoryWatcher.create);

  /**
   * Handles importing of user media (e.g. photos, videos) from removable
   * devices.
   * @type {!importer.MediaImportHandler}
   */
  this.mediaImportHandler = new importer.MediaImportHandler(
      this.progressCenter, this.historyLoader, this.dispositionChecker_,
      this.tracker, this.driveSyncHandler);

  /**
   * String assets.
   * @type {Object<string>}
   */
  this.stringData = null;

  /**
   * Provides drive search to app launcher.
   * @private {!LauncherSearch}
   */
  this.launcherSearch_ = new LauncherSearch();

  // Initialize handlers.
  chrome.fileBrowserHandler.onExecute.addListener(this.onExecute_.bind(this));
  chrome.runtime.onMessageExternal.addListener(
      this.onExternalMessageReceived_.bind(this));
  chrome.contextMenus.onClicked.addListener(
      this.onContextMenuClicked_.bind(this));

  // Initializa string and volume manager related stuffs.
  this.initializationPromise_.then(function(strings) {
    this.stringData = strings;
    this.initContextMenu_();

    volumeManagerFactory.getInstance().then(function(volumeManager) {
      volumeManager.addEventListener(
          VolumeManagerCommon.VOLUME_ALREADY_MOUNTED,
          this.handleViewEvent_.bind(this));
    }.bind(this));

    this.fileOperationManager = new FileOperationManager();
    this.fileOperationHandler_ = new FileOperationHandler(
        this.fileOperationManager, this.progressCenter);
  }.bind(this));

  // Handle newly mounted FSP file systems. Workaround for crbug.com/456648.
  // TODO(mtomasz): Replace this hack with a proper solution.
  chrome.fileManagerPrivate.onMountCompleted.addListener(
      this.onMountCompleted_.bind(this));

  launcher.queue.run(function(callback) {
    this.initializationPromise_.then(callback);
  }.bind(this));
}
/**
 * Root class of the background page.
 * @constructor
 * @implements {FileBrowserBackgroundFull}
 * @extends {BackgroundBase}
 * @struct
 */
Root class of the background page.
Root class of the background page .
function FileBrowserBackgroundImpl() {
  BackgroundBase.call(this);
  this.tracker = metrics.getTracker();
  this.progressCenter = new ProgressCenter();
  this.fileOperationManager = null;
  this.historyLoader = new importer.RuntimeHistoryLoader(this.tracker);
  this.fileOperationHandler_ = null;
  this.deviceHandler_ = new DeviceHandler();
  this.deviceHandler_.addEventListener(
      DeviceHandler.VOLUME_NAVIGATION_REQUESTED,
      this.handleViewEvent_.bind(this));
  this.driveSyncHandler = new DriveSyncHandler(this.progressCenter);
  this.dispositionChecker_ = importer.DispositionChecker.createChecker(
      this.historyLoader, this.tracker);
  this.mediaScanner = new importer.DefaultMediaScanner(
      importer.createMetadataHashcode,
      this.dispositionChecker_,
      importer.DefaultDirectoryWatcher.create);
  this.mediaImportHandler = new importer.MediaImportHandler(
      this.progressCenter, this.historyLoader, this.dispositionChecker_,
      this.tracker, this.driveSyncHandler);
  this.stringData = null;
  this.launcherSearch_ = new LauncherSearch();
  chrome.fileBrowserHandler.onExecute.addListener(this.onExecute_.bind(this));
  chrome.runtime.onMessageExternal.addListener(
      this.onExternalMessageReceived_.bind(this));
  chrome.contextMenus.onClicked.addListener(
      this.onContextMenuClicked_.bind(this));
  this.initializationPromise_.then(function(strings) {
    this.stringData = strings;
    this.initContextMenu_();
    volumeManagerFactory.getInstance().then(function(volumeManager) {
      volumeManager.addEventListener(
          VolumeManagerCommon.VOLUME_ALREADY_MOUNTED,
          this.handleViewEvent_.bind(this));
    }.bind(this));
    this.fileOperationManager = new FileOperationManager();
    this.fileOperationHandler_ = new FileOperationHandler(
        this.fileOperationManager, this.progressCenter);
  }.bind(this));
  chrome.fileManagerPrivate.onMountCompleted.addListener(
      this.onMountCompleted_.bind(this));
  launcher.queue.run(function(callback) {
    this.initializationPromise_.then(callback);
  }.bind(this));
}
function FileBrowserBackgroundImpl ( ) { BackgroundBase . call ( this ) ; this . tracker = metrics . getTracker ( ) ; this . progressCenter = new ProgressCenter ( ) ; this . fileOperationManager = null ; this . historyLoader = new importer . RuntimeHistoryLoader ( this . tracker ) ; this . fileOperationHandler_ = null ; this . deviceHandler_ = new DeviceHandler ( ) ; this . deviceHandler_ . addEventListener ( DeviceHandler . VOLUME_NAVIGATION_REQUESTED , this . handleViewEvent_ . bind ( this ) ) ; this . driveSyncHandler = new DriveSyncHandler ( this . progressCenter ) ; this . dispositionChecker_ = importer . DispositionChecker . createChecker ( this . historyLoader , this . tracker ) ; this . mediaScanner = new importer . DefaultMediaScanner ( importer . createMetadataHashcode , this . dispositionChecker_ , importer . DefaultDirectoryWatcher . create ) ; this . mediaImportHandler = new importer . MediaImportHandler ( this . progressCenter , this . historyLoader , this . dispositionChecker_ , this . tracker , this . driveSyncHandler ) ; this . stringData = null ; this . launcherSearch_ = new LauncherSearch ( ) ; chrome . fileBrowserHandler . onExecute . addListener ( this . onExecute_ . bind ( this ) ) ; chrome . runtime . onMessageExternal . addListener ( this . onExternalMessageReceived_ . bind ( this ) ) ; chrome . contextMenus . onClicked . addListener ( this . onContextMenuClicked_ . bind ( this ) ) ; this . initializationPromise_ . then ( function ( strings ) { this . stringData = strings ; this . initContextMenu_ ( ) ; volumeManagerFactory . getInstance ( ) . then ( function ( volumeManager ) { volumeManager . addEventListener ( VolumeManagerCommon . VOLUME_ALREADY_MOUNTED , this . handleViewEvent_ . bind ( this ) ) ; } . bind ( this ) ) ; this . fileOperationManager = new FileOperationManager ( ) ; this . fileOperationHandler_ = new FileOperationHandler ( this . fileOperationManager , this . progressCenter ) ; } . bind ( this ) ) ; chrome . fileManagerPrivate . onMountCompleted . addListener ( this . onMountCompleted_ . bind ( this ) ) ; launcher . queue . run ( function ( callback ) { this . initializationPromise_ . then ( callback ) ; } . bind ( this ) ) ; }
Root class of the background page.
Root class of the background page .
/** @type {!analytics.Tracker} */ /**
   * Progress center of the background page.
   * @type {!ProgressCenter}
   */ /**
   * File operation manager.
   * @type {FileOperationManager}
   */ /**
   * Class providing loading of import history, used in
   * cloud import.
   *
   * @type {!importer.HistoryLoader}
   */ /**
   * Event handler for progress center.
   * @private {FileOperationHandler}
   */ /**
   * Event handler for C++ sides notifications.
   * @private {!DeviceHandler}
   */ // Handle device navigation requests. /**
   * Drive sync handler.
   * @type {!DriveSyncHandler}
   */ /**
   * @type {!importer.DispositionChecker.CheckerFunction}
   */ /**
   * Provides support for scaning media devices as part of Cloud Import.
   * @type {!importer.MediaScanner}
   */ /**
   * Handles importing of user media (e.g. photos, videos) from removable
   * devices.
   * @type {!importer.MediaImportHandler}
   */ /**
   * String assets.
   * @type {Object<string>}
   */ /**
   * Provides drive search to app launcher.
   * @private {!LauncherSearch}
   */ // Initialize handlers. // Initializa string and volume manager related stuffs. // Handle newly mounted FSP file systems. Workaround for crbug.com/456648. // TODO(mtomasz): Replace this hack with a proper solution.