Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_grid.js

Issue 11817041: Fix thumbnail refresh for Drive images (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/metadata/metadata_cache.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/metadata/metadata_cache.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698