decorateCustomWallpaperForOldPicker_(imageElement, dataItem) {
      if (dataItem.source != Constants.WallpaperSourceEnum.Custom) {
        console.error(
            '|decorateCustomWallpaperForOldPicker_| is called but the ' +
            'wallpaper source is not custom.');
        return;
      }
      var errorHandler = e => {
        console.error('Can not access file system.');
        this.callback_(this.dataModelId_);
      };
      var setURL = fileEntry => {
        imageElement.src = fileEntry.toURL();
        this.callback_(this.dataModelId_, dataItem.wallpaperId, imageElement);
      };
      var wallpaperDirectories = WallpaperDirectories.getInstance();
      var fallback = () => {
        wallpaperDirectories.getDirectory(
            Constants.WallpaperDirNameEnum.ORIGINAL, function(dirEntry) {
              dirEntry.getFile(
                  dataItem.baseURL, {create: false}, setURL, errorHandler);
            }, errorHandler);
      };
      var success = dirEntry => {
        dirEntry.getFile(dataItem.baseURL, {create: false}, setURL, fallback);
      };
      wallpaperDirectories.getDirectory(
          Constants.WallpaperDirNameEnum.THUMBNAIL, success, errorHandler);
    }
/**
     * Initializes the grid item for custom wallpapers. Used by the old
     * wallpaper picker (to be deprecated).
     * @param {Object} imageElement The image element.
     * @param {{filePath: string, baseURL: string, layout: string,
     *          source: string, availableOffline: boolean}
     *     dataItem The info related to the wallpaper image.
     * @private
     */
Initializes the grid item for custom wallpapers. Used by the old
wallpaper picker (to be deprecated).
@param {Object} imageElement The image element.
Initializes the grid item for custom wallpapers . Used by the old wallpaper picker ( to be deprecated ) . @param { Object } imageElement The image element .
decorateCustomWallpaperForOldPicker_(imageElement, dataItem) {
      if (dataItem.source != Constants.WallpaperSourceEnum.Custom) {
        console.error(
            '|decorateCustomWallpaperForOldPicker_| is called but the ' +
            'wallpaper source is not custom.');
        return;
      }
      var errorHandler = e => {
        console.error('Can not access file system.');
        this.callback_(this.dataModelId_);
      };
      var setURL = fileEntry => {
        imageElement.src = fileEntry.toURL();
        this.callback_(this.dataModelId_, dataItem.wallpaperId, imageElement);
      };
      var wallpaperDirectories = WallpaperDirectories.getInstance();
      var fallback = () => {
        wallpaperDirectories.getDirectory(
            Constants.WallpaperDirNameEnum.ORIGINAL, function(dirEntry) {
              dirEntry.getFile(
                  dataItem.baseURL, {create: false}, setURL, errorHandler);
            }, errorHandler);
      };
      var success = dirEntry => {
        dirEntry.getFile(dataItem.baseURL, {create: false}, setURL, fallback);
      };
      wallpaperDirectories.getDirectory(
          Constants.WallpaperDirNameEnum.THUMBNAIL, success, errorHandler);
    }
decorateCustomWallpaperForOldPicker_ ( imageElement , dataItem ) { if ( dataItem . source != Constants . WallpaperSourceEnum . Custom ) { console . error ( '|decorateCustomWallpaperForOldPicker_| is called but the ' + 'wallpaper source is not custom.' ) ; return ; } var errorHandler = e => { console . error ( 'Can not access file system.' ) ; this . callback_ ( this . dataModelId_ ) ; } ; var setURL = fileEntry => { imageElement . src = fileEntry . toURL ( ) ; this . callback_ ( this . dataModelId_ , dataItem . wallpaperId , imageElement ) ; } ; var wallpaperDirectories = WallpaperDirectories . getInstance ( ) ; var fallback = ( ) => { wallpaperDirectories . getDirectory ( Constants . WallpaperDirNameEnum . ORIGINAL , function ( dirEntry ) { dirEntry . getFile ( dataItem . baseURL , { create : false } , setURL , errorHandler ) ; } , errorHandler ) ; } ; var success = dirEntry => { dirEntry . getFile ( dataItem . baseURL , { create : false } , setURL , fallback ) ; } ; wallpaperDirectories . getDirectory ( Constants . WallpaperDirNameEnum . THUMBNAIL , success , errorHandler ) ; }
Initializes the grid item for custom wallpapers.
Initializes the grid item for custom wallpapers .