| 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 '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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |