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

Side by Side Diff: ui/file_manager/gallery/js/background.js

Issue 345853004: Gallery: Filter out video files in the gallery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @param {Object.<string, string>} stringData String data. 8 * @param {Object.<string, string>} stringData String data.
9 * @param {VolumeManager} volumeManager Volume manager. 9 * @param {VolumeManager} volumeManager Volume manager.
10 */ 10 */
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 return args[0]; 153 return args[0];
154 }); 154 });
155 155
156 156
157 // If only 1 entry is selected, retrieve entries in the same directory. 157 // If only 1 entry is selected, retrieve entries in the same directory.
158 // Otherwise, just use the selectedEntries as an entry set. 158 // Otherwise, just use the selectedEntries as an entry set.
159 var allEntriesPromise = selectedEntriesPromise.then(function(entries) { 159 var allEntriesPromise = selectedEntriesPromise.then(function(entries) {
160 if (entries.length === 1) { 160 if (entries.length === 1) {
161 var parentPromise = new Promise(entries[0].getParent.bind(entries[0])); 161 var parentPromise = new Promise(entries[0].getParent.bind(entries[0]));
162 return parentPromise.then(getChildren).then(function(entries) { 162 return parentPromise.then(getChildren).then(function(entries) {
163 return entries.filter(FileType.isImageOrVideo); 163 return entries.filter(FileType.isImage);
164 }); 164 });
165 } else { 165 } else {
166 return entries; 166 return entries;
167 } 167 }
168 }); 168 });
169 169
170 // Open entries. 170 // Open entries.
171 return Promise.all([ 171 return Promise.all([
172 appWindowPromise, 172 appWindowPromise,
173 allEntriesPromise, 173 allEntriesPromise,
(...skipping 30 matching lines...) Expand all
204 chrome.runtime.onMessageExternal.addListener(function(message) { 204 chrome.runtime.onMessageExternal.addListener(function(message) {
205 if (message.name !== 'testResourceLoaded') 205 if (message.name !== 'testResourceLoaded')
206 return; 206 return;
207 var script = document.createElement('script'); 207 var script = document.createElement('script');
208 script.src = 208 script.src =
209 'chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn' + 209 'chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn' +
210 '/gallery/test_loader.js'; 210 '/gallery/test_loader.js';
211 document.documentElement.appendChild(script); 211 document.documentElement.appendChild(script);
212 }); 212 });
213 } 213 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698