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

Side by Side Diff: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js

Issue 515033002: [fsp] Generalize fileBrowserPrivate.getEntryProperties(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 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
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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Global (placed in the window object) variable name to hold internal 8 * Global (placed in the window object) variable name to hold internal
9 * file dragging information. Needed to show visual feedback while dragging 9 * file dragging information. Needed to show visual feedback while dragging
10 * since DataTransfer object is in protected state. Reachable from other 10 * since DataTransfer object is in protected state. Reachable from other
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 var promises = dirs.map(processDirectoryEntry); 256 var promises = dirs.map(processDirectoryEntry);
257 if (files.length > 0) 257 if (files.length > 0)
258 promises.push(processFileEntries(files)); 258 promises.push(processFileEntries(files));
259 return Promise.all(promises).then(concatArrays); 259 return Promise.all(promises).then(concatArrays);
260 }; 260 };
261 261
262 // Check all file entries and keeps only those need sharing operation. 262 // Check all file entries and keeps only those need sharing operation.
263 var processFileEntries = function(entries) { 263 var processFileEntries = function(entries) {
264 return new Promise(function(callback) { 264 return new Promise(function(callback) {
265 var urls = util.entriesToURLs(entries); 265 var urls = util.entriesToURLs(entries);
266 chrome.fileBrowserPrivate.getDriveEntryProperties(urls, callback); 266 chrome.fileBrowserPrivate.getEntryProperties(urls, callback);
267 }). 267 }).
268 then(function(metadatas) { 268 then(function(metadatas) {
269 return entries.filter(function(entry, i) { 269 return entries.filter(function(entry, i) {
270 var metadata = metadatas[i]; 270 var metadata = metadatas[i];
271 return metadata && metadata.isHosted && !metadata.sharedWithMe; 271 return metadata && metadata.isHosted && !metadata.sharedWithMe;
272 }); 272 });
273 }); 273 });
274 }; 274 };
275 275
276 // Check child entries. 276 // Check child entries.
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 !event.ctrlKey) { 1060 !event.ctrlKey) {
1061 return 'move'; 1061 return 'move';
1062 } 1062 }
1063 if (event.shiftKey) { 1063 if (event.shiftKey) {
1064 return 'move'; 1064 return 'move';
1065 } 1065 }
1066 } 1066 }
1067 return 'copy'; 1067 return 'copy';
1068 }, 1068 },
1069 }; 1069 };
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698