| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * FileGrid constructor. | 6 * FileGrid constructor. |
| 7 * | 7 * |
| 8 * Represents grid for the Grid Vew in the File Manager. | 8 * Represents grid for the Grid Vew in the File Manager. |
| 9 * @constructor | 9 * @constructor |
| 10 * @extends {cr.ui.Grid} | 10 * @extends {cr.ui.Grid} |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 setTimeout(opt_imageLoadCallback, 0, null /* callback parameter */); | 115 setTimeout(opt_imageLoadCallback, 0, null /* callback parameter */); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 | 118 |
| 119 var imageUrl = entry.toURL(); | 119 var imageUrl = entry.toURL(); |
| 120 | 120 |
| 121 // Failing to fetch a thumbnail likely means that the thumbnail URL | 121 // Failing to fetch a thumbnail likely means that the thumbnail URL |
| 122 // is now stale. Request a refresh of the current directory, to get | 122 // is now stale. Request a refresh of the current directory, to get |
| 123 // the new thumbnail URLs. Once the directory is refreshed, we'll get | 123 // the new thumbnail URLs. Once the directory is refreshed, we'll get |
| 124 // notified via onDirectoryChanged event. | 124 // notified via onDirectoryChanged event. |
| 125 // TODO: | 125 var onImageLoadError = function() { |
| 126 var onImageLoadError = function(imageURL) { | 126 metadataCache.refreshFileMetadata(imageUrl); |
| 127 metadataCache.refreshFileMetadata(imageURL); | |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 var metadataTypes = 'thumbnail|filesystem'; | 129 var metadataTypes = 'thumbnail|filesystem'; |
| 131 | 130 |
| 132 if (FileType.isOnGDrive(imageUrl)) { | 131 if (FileType.isOnGDrive(imageUrl)) { |
| 133 metadataTypes += '|gdata'; | 132 metadataTypes += '|gdata'; |
| 134 } else { | 133 } else { |
| 135 // TODO(dgozman): If we ask for 'media' for a GDrive file we fall into an | 134 // TODO(dgozman): If we ask for 'media' for a GDrive file we fall into an |
| 136 // infinite loop. | 135 // infinite loop. |
| 137 metadataTypes += '|media'; | 136 metadataTypes += '|media'; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 var bottom = li.querySelector('.thumbnail-bottom'); | 178 var bottom = li.querySelector('.thumbnail-bottom'); |
| 180 bottom.appendChild(checkBox); | 179 bottom.appendChild(checkBox); |
| 181 bottom.classList.add('show-checkbox'); | 180 bottom.classList.add('show-checkbox'); |
| 182 } | 181 } |
| 183 | 182 |
| 184 // Override the default role 'listitem' to 'option' to match the parent's | 183 // Override the default role 'listitem' to 'option' to match the parent's |
| 185 // role (listbox). | 184 // role (listbox). |
| 186 li.setAttribute('role', 'option'); | 185 li.setAttribute('role', 'option'); |
| 187 }; | 186 }; |
| 188 | 187 |
| OLD | NEW |