function VolumeManagerWrapper(allowedPaths, writableOnly, opt_backgroundPage) {
  cr.EventTarget.call(this);

  this.allowedPaths_ = allowedPaths;
  this.writableOnly_ = writableOnly;
  this.volumeInfoList = new cr.ui.ArrayDataModel([]);

  this.volumeManager_ = null;
  this.pendingTasks_ = [];
  this.onEventBound_ = this.onEvent_.bind(this);
  this.onVolumeInfoListUpdatedBound_ =
      this.onVolumeInfoListUpdated_.bind(this);

  this.disposed_ = false;

  // Start initialize the VolumeManager.
  var queue = new AsyncUtil.Queue();

  if (opt_backgroundPage) {
    this.backgroundPage_ = opt_backgroundPage;
  } else {
    queue.run(function(callNextStep) {
      chrome.runtime.getBackgroundPage(/** @type {function(Window=)} */(
          function(opt_backgroundPage) {
            this.backgroundPage_ = opt_backgroundPage;
            callNextStep();
          }.bind(this)));
    }.bind(this));
  }

  queue.run(function(callNextStep) {
    this.backgroundPage_.volumeManagerFactory.getInstance(
        function(volumeManager) {
          this.onReady_(volumeManager);
          callNextStep();
        }.bind(this));
  }.bind(this));
}
/**
 * Thin wrapper for VolumeManager. This should be an interface proxy to talk
 * to VolumeManager. This class also filters some "disallowed" volumes;
 * for example, Drive volumes are dropped if Drive is disabled, and read-only
 * volumes are dropped in save-as dialogs.
 *
 * @constructor
 * @extends {cr.EventTarget}
 * @implements {VolumeManagerCommon.VolumeInfoProvider}
 *
 * @param {!AllowedPaths} allowedPaths Which paths are supported in the Files
 *     app dialog.
 * @param {boolean} writableOnly If true, only writable volumes are returned.
 * @param {Window=} opt_backgroundPage Window object of the background
 *     page. If this is specified, the class skips to get background page.
 *     TODO(hirono): Let all clients of the class pass the background page and
 *     make the argument not optional.
 */
Thin wrapper for VolumeManager. This should be an interface proxy to talk
to VolumeManager. This class also filters some "disallowed" volumes;
for example, Drive volumes are dropped if Drive is disabled, and read-only
volumes are dropped in save-as dialogs.



@param {!AllowedPaths} allowedPaths Which paths are supported in the Files
app dialog.
@param {boolean} writableOnly If true, only writable volumes are returned.
@param {Window=} opt_backgroundPage Window object of the background
page. If this is specified, the class skips to get background page.
TODO(hirono): Let all clients of the class pass the background page and
make the argument not optional.
Thin wrapper for VolumeManager . This should be an interface proxy to talk to VolumeManager . This class also filters some " disallowed " volumes ; for example Drive volumes are dropped if Drive is disabled and read - only volumes are dropped in save - as dialogs . @param { !AllowedPaths } allowedPaths Which paths are supported in the Files app dialog . @param { boolean } writableOnly If true only writable volumes are returned . @param { Window = } opt_backgroundPage Window object of the background page . If this is specified the class skips to get background page . TODO ( hirono ) : Let all clients of the class pass the background page and make the argument not optional .
function VolumeManagerWrapper(allowedPaths, writableOnly, opt_backgroundPage) {
  cr.EventTarget.call(this);
  this.allowedPaths_ = allowedPaths;
  this.writableOnly_ = writableOnly;
  this.volumeInfoList = new cr.ui.ArrayDataModel([]);
  this.volumeManager_ = null;
  this.pendingTasks_ = [];
  this.onEventBound_ = this.onEvent_.bind(this);
  this.onVolumeInfoListUpdatedBound_ =
      this.onVolumeInfoListUpdated_.bind(this);
  this.disposed_ = false;
  var queue = new AsyncUtil.Queue();
  if (opt_backgroundPage) {
    this.backgroundPage_ = opt_backgroundPage;
  } else {
    queue.run(function(callNextStep) {
      chrome.runtime.getBackgroundPage((
          function(opt_backgroundPage) {
            this.backgroundPage_ = opt_backgroundPage;
            callNextStep();
          }.bind(this)));
    }.bind(this));
  }
  queue.run(function(callNextStep) {
    this.backgroundPage_.volumeManagerFactory.getInstance(
        function(volumeManager) {
          this.onReady_(volumeManager);
          callNextStep();
        }.bind(this));
  }.bind(this));
}
function VolumeManagerWrapper ( allowedPaths , writableOnly , opt_backgroundPage ) { cr . EventTarget . call ( this ) ; this . allowedPaths_ = allowedPaths ; this . writableOnly_ = writableOnly ; this . volumeInfoList = new cr . ui . ArrayDataModel ( [ ] ) ; this . volumeManager_ = null ; this . pendingTasks_ = [ ] ; this . onEventBound_ = this . onEvent_ . bind ( this ) ; this . onVolumeInfoListUpdatedBound_ = this . onVolumeInfoListUpdated_ . bind ( this ) ; this . disposed_ = false ; var queue = new AsyncUtil . Queue ( ) ; if ( opt_backgroundPage ) { this . backgroundPage_ = opt_backgroundPage ; } else { queue . run ( function ( callNextStep ) { chrome . runtime . getBackgroundPage ( ( function ( opt_backgroundPage ) { this . backgroundPage_ = opt_backgroundPage ; callNextStep ( ) ; } . bind ( this ) ) ) ; } . bind ( this ) ) ; } queue . run ( function ( callNextStep ) { this . backgroundPage_ . volumeManagerFactory . getInstance ( function ( volumeManager ) { this . onReady_ ( volumeManager ) ; callNextStep ( ) ; } . bind ( this ) ) ; } . bind ( this ) ) ; }
Thin wrapper for VolumeManager.
Thin wrapper for VolumeManager .
// Start initialize the VolumeManager. /** @type {function(Window=)} */