onCapabilitiesSet_(origin, id, settingsInfo) {
      let dest = null;
      if (origin !== print_preview.DestinationOrigin.PRIVET) {
        const key = this.getDestinationKey_(origin, id, '');
        dest = this.destinationMap_[key];
      }
      if (!dest) {
        // Ignore unrecognized extension printers
        if (!settingsInfo.printer) {
          assert(origin === print_preview.DestinationOrigin.EXTENSION);
          return;
        }
        dest = print_preview.parseDestination(
            print_preview.originToType(origin), assert(settingsInfo.printer));
      }
      if (dest) {
        if ((origin === print_preview.DestinationOrigin.LOCAL ||
             origin === print_preview.DestinationOrigin.CROS) &&
            dest.capabilities) {
          // If capabilities are already set for this destination ignore new
          // results. This prevents custom margins from being cleared as long
          // as the user does not change to a new non-recent destination.
          return;
        }
        const updateDestination = destination => {
          destination.capabilities = settingsInfo.capabilities;
          this.updateDestination_(destination);
        };
        if (Array.isArray(dest)) {
          dest.forEach(updateDestination);
        } else {
          updateDestination(dest);
        }
      }
    }
/**
     * Called when the native layer retrieves the capabilities for the selected
     * local destination. Updates the destination with new capabilities if the
     * destination already exists, otherwise it creates a new destination and
     * then updates its capabilities.
     * @param {!print_preview.DestinationOrigin} origin The origin of the
     *     print destination.
     * @param {string} id The id of the print destination.
     * @param {!print_preview.CapabilitiesResponse} settingsInfo Contains
     *     the capabilities of the print destination, and information about
     *     the destination except in the case of extension printers.
     * @private
     */
Called when the native layer retrieves the capabilities for the selected
local destination. Updates the destination with new capabilities if the
destination already exists, otherwise it creates a new destination and
then updates its capabilities.
@param {!print_preview.DestinationOrigin} origin The origin of the
print destination.
@param {string} id The id of the print destination.
@param {!print_preview.CapabilitiesResponse} settingsInfo Contains
the capabilities of the print destination, and information about
the destination except in the case of extension printers.
@private
Called when the native layer retrieves the capabilities for the selected local destination . Updates the destination with new capabilities if the destination already exists otherwise it creates a new destination and then updates its capabilities . @param { !print_preview . DestinationOrigin } origin The origin of the print destination . @param { string } id The id of the print destination . @param { !print_preview . CapabilitiesResponse } settingsInfo Contains the capabilities of the print destination and information about the destination except in the case of extension printers . @private
onCapabilitiesSet_(origin, id, settingsInfo) {
      let dest = null;
      if (origin !== print_preview.DestinationOrigin.PRIVET) {
        const key = this.getDestinationKey_(origin, id, '');
        dest = this.destinationMap_[key];
      }
      if (!dest) {
        if (!settingsInfo.printer) {
          assert(origin === print_preview.DestinationOrigin.EXTENSION);
          return;
        }
        dest = print_preview.parseDestination(
            print_preview.originToType(origin), assert(settingsInfo.printer));
      }
      if (dest) {
        if ((origin === print_preview.DestinationOrigin.LOCAL ||
             origin === print_preview.DestinationOrigin.CROS) &&
            dest.capabilities) {
          return;
        }
        const updateDestination = destination => {
          destination.capabilities = settingsInfo.capabilities;
          this.updateDestination_(destination);
        };
        if (Array.isArray(dest)) {
          dest.forEach(updateDestination);
        } else {
          updateDestination(dest);
        }
      }
    }
onCapabilitiesSet_ ( origin , id , settingsInfo ) { let dest = null ; if ( origin !== print_preview . DestinationOrigin . PRIVET ) { const key = this . getDestinationKey_ ( origin , id , '' ) ; dest = this . destinationMap_ [ key ] ; } if ( ! dest ) { if ( ! settingsInfo . printer ) { assert ( origin === print_preview . DestinationOrigin . EXTENSION ) ; return ; } dest = print_preview . parseDestination ( print_preview . originToType ( origin ) , assert ( settingsInfo . printer ) ) ; } if ( dest ) { if ( ( origin === print_preview . DestinationOrigin . LOCAL || origin === print_preview . DestinationOrigin . CROS ) && dest . capabilities ) { return ; } const updateDestination = destination => { destination . capabilities = settingsInfo . capabilities ; this . updateDestination_ ( destination ) ; } ; if ( Array . isArray ( dest ) ) { dest . forEach ( updateDestination ) ; } else { updateDestination ( dest ) ; } } }
Called when the native layer retrieves the capabilities for the selected
 local destination.
Called when the native layer retrieves the capabilities for the selected local destination .
// Ignore unrecognized extension printers // If capabilities are already set for this destination ignore new // results. This prevents custom margins from being cleared as long // as the user does not change to a new non-recent destination.