function VolumeItem(modelItem, tree) {
  var item = /** @type {VolumeItem} */ (
      new DirectoryItem(modelItem.volumeInfo.label, tree));
  item.__proto__ = VolumeItem.prototype;

  item.modelItem_ = modelItem;
  item.volumeInfo_ = modelItem.volumeInfo;

  // Provided volumes should delay the expansion of child nodes
  // for performance reasons.
  item.delayExpansion = (item.volumeInfo.volumeType === 'provided');

  // Set helper attribute for testing.
  if (window.IN_TEST)
    item.setAttribute('volume-type-for-testing', item.volumeInfo_.volumeType);

  item.setupIcon_(item.querySelector('.icon'), item.volumeInfo_);

  // Attach a placeholder for rename input text box and the eject icon if the
  // volume is ejectable
  if ((modelItem.volumeInfo_.source === VolumeManagerCommon.Source.DEVICE &&
       modelItem.volumeInfo_.volumeType !==
           VolumeManagerCommon.VolumeType.MTP) ||
      modelItem.volumeInfo_.source === VolumeManagerCommon.Source.FILE) {
    // This placeholder is added to allow to put textbox before eject button
    // while executing renaming action on external drive.
    item.setupRenamePlaceholder_(item.rowElement);
    item.setupEjectButton_(item.rowElement);
  }

  // Sets up context menu of the item.
  if (tree.contextMenuForRootItems)
    item.setContextMenu_(tree.contextMenuForRootItems);

  // Populate children of this volume using resolved display root.
  item.volumeInfo_.resolveDisplayRoot(function(displayRoot) {
    item.updateSubDirectories(false /* recursive */);
  });

  return item;
}
/**
 * A TreeItem which represents a volume. Volume items are displayed as
 * top-level children of DirectoryTree.
 *
 * @param {!NavigationModelVolumeItem} modelItem NavigationModelItem of this
 *     volume.
 * @param {!DirectoryTree} tree Current tree, which contains this item.
 * @extends {DirectoryItem}
 * @constructor
 */
A TreeItem which represents a volume. Volume items are displayed as
top-level children of DirectoryTree.

@param {!NavigationModelVolumeItem} modelItem NavigationModelItem of this
volume.
@param {!DirectoryTree} tree Current tree, which contains this item.
A TreeItem which represents a volume . Volume items are displayed as top - level children of DirectoryTree . @param { !NavigationModelVolumeItem } modelItem NavigationModelItem of this volume . @param { !DirectoryTree } tree Current tree which contains this item .
function VolumeItem(modelItem, tree) {
  var item =  (
      new DirectoryItem(modelItem.volumeInfo.label, tree));
  item.__proto__ = VolumeItem.prototype;
  item.modelItem_ = modelItem;
  item.volumeInfo_ = modelItem.volumeInfo;
  item.delayExpansion = (item.volumeInfo.volumeType === 'provided');
  if (window.IN_TEST)
    item.setAttribute('volume-type-for-testing', item.volumeInfo_.volumeType);
  item.setupIcon_(item.querySelector('.icon'), item.volumeInfo_);
  if ((modelItem.volumeInfo_.source === VolumeManagerCommon.Source.DEVICE &&
       modelItem.volumeInfo_.volumeType !==
           VolumeManagerCommon.VolumeType.MTP) ||
      modelItem.volumeInfo_.source === VolumeManagerCommon.Source.FILE) {
    item.setupRenamePlaceholder_(item.rowElement);
    item.setupEjectButton_(item.rowElement);
  }
  if (tree.contextMenuForRootItems)
    item.setContextMenu_(tree.contextMenuForRootItems);
  item.volumeInfo_.resolveDisplayRoot(function(displayRoot) {
    item.updateSubDirectories(false );
  });
  return item;
}
function VolumeItem ( modelItem , tree ) { var item = ( new DirectoryItem ( modelItem . volumeInfo . label , tree ) ) ; item . __proto__ = VolumeItem . prototype ; item . modelItem_ = modelItem ; item . volumeInfo_ = modelItem . volumeInfo ; item . delayExpansion = ( item . volumeInfo . volumeType === 'provided' ) ; if ( window . IN_TEST ) item . setAttribute ( 'volume-type-for-testing' , item . volumeInfo_ . volumeType ) ; item . setupIcon_ ( item . querySelector ( '.icon' ) , item . volumeInfo_ ) ; if ( ( modelItem . volumeInfo_ . source === VolumeManagerCommon . Source . DEVICE && modelItem . volumeInfo_ . volumeType !== VolumeManagerCommon . VolumeType . MTP ) || modelItem . volumeInfo_ . source === VolumeManagerCommon . Source . FILE ) { item . setupRenamePlaceholder_ ( item . rowElement ) ; item . setupEjectButton_ ( item . rowElement ) ; } if ( tree . contextMenuForRootItems ) item . setContextMenu_ ( tree . contextMenuForRootItems ) ; item . volumeInfo_ . resolveDisplayRoot ( function ( displayRoot ) { item . updateSubDirectories ( false ) ; } ) ; return item ; }
A TreeItem which represents a volume.
A TreeItem which represents a volume .
/** @type {VolumeItem} */ // Provided volumes should delay the expansion of child nodes // for performance reasons. // Set helper attribute for testing. // Attach a placeholder for rename input text box and the eject icon if the // volume is ejectable // This placeholder is added to allow to put textbox before eject button // while executing renaming action on external drive. // Sets up context menu of the item. // Populate children of this volume using resolved display root. /* recursive */