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 if (chrome.extension) { | 5 if (chrome.extension) { |
6 var getContentWindows = function() { | 6 var getContentWindows = function() { |
7 return chrome.extension.getViews(); | 7 return chrome.extension.getViews(); |
8 }; | 8 }; |
9 } | 9 } |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 return fileCopyManagerInstance; | 42 return fileCopyManagerInstance; |
43 }; | 43 }; |
44 | 44 |
45 /** | 45 /** |
46 * A record of a queued copy operation. | 46 * A record of a queued copy operation. |
47 * | 47 * |
48 * Multiple copy operations may be queued at any given time. Additional | 48 * Multiple copy operations may be queued at any given time. Additional |
49 * Tasks may be added while the queue is being serviced. Though a | 49 * Tasks may be added while the queue is being serviced. Though a |
50 * cancel operation cancels everything in the queue. | 50 * cancel operation cancels everything in the queue. |
51 * | 51 * |
52 * @constructor | |
mtomasz
2013/02/14 04:38:56
I think in most places we put @constructor after @
yoshiki
2013/02/14 06:17:36
You're right. The closure-compiler doc says so.
ht
| |
52 * @param {DirectoryEntry} sourceDirEntry Source directory. | 53 * @param {DirectoryEntry} sourceDirEntry Source directory. |
53 * @param {DirectoryEntry} targetDirEntry Target directory. | 54 * @param {DirectoryEntry} targetDirEntry Target directory. |
54 */ | 55 */ |
55 FileCopyManager.Task = function(sourceDirEntry, targetDirEntry) { | 56 FileCopyManager.Task = function(sourceDirEntry, targetDirEntry) { |
56 this.sourceDirEntry = sourceDirEntry; | 57 this.sourceDirEntry = sourceDirEntry; |
57 this.targetDirEntry = targetDirEntry; | 58 this.targetDirEntry = targetDirEntry; |
58 this.originalEntries = null; | 59 this.originalEntries = null; |
59 | 60 |
60 this.pendingDirectories = []; | 61 this.pendingDirectories = []; |
61 this.pendingFiles = []; | 62 this.pendingFiles = []; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 rv.totalBytes = rv.pendingBytes + rv.completedBytes; | 280 rv.totalBytes = rv.pendingBytes + rv.completedBytes; |
280 | 281 |
281 rv.percentage = rv.completedBytes / rv.totalBytes; | 282 rv.percentage = rv.completedBytes / rv.totalBytes; |
282 if (rv.pendingItems === 1) | 283 if (rv.pendingItems === 1) |
283 rv.filename = pendingFile.name; | 284 rv.filename = pendingFile.name; |
284 | 285 |
285 return rv; | 286 return rv; |
286 }; | 287 }; |
287 | 288 |
288 /** | 289 /** |
289 * Send an event to all the FileManager windows. | 290 * Send an event to all the FileManager windows. |
mtomasz
2013/02/14 04:38:56
Empty line here?
yoshiki
2013/02/14 06:17:36
Done.
| |
290 * @private | 291 * @private |
291 * @param {string} eventName Event name. | 292 * @param {string} eventName Event name. |
292 * @param {Object} eventArgs An object with arbitrary event parameters. | 293 * @param {Object} eventArgs An object with arbitrary event parameters. |
293 */ | 294 */ |
294 FileCopyManager.prototype.sendEvent_ = function(eventName, eventArgs) { | 295 FileCopyManager.prototype.sendEvent_ = function(eventName, eventArgs) { |
295 if (this.cancelRequested_) | 296 if (this.cancelRequested_) |
296 return; // Swallow events until cancellation complete. | 297 return; // Swallow events until cancellation complete. |
297 | 298 |
298 eventArgs.status = this.getStatus(); | 299 eventArgs.status = this.getStatus(); |
299 | 300 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 */ | 410 */ |
410 FileCopyManager.prototype.maybeCancel_ = function() { | 411 FileCopyManager.prototype.maybeCancel_ = function() { |
411 if (!this.cancelRequested_) | 412 if (!this.cancelRequested_) |
412 return false; | 413 return false; |
413 | 414 |
414 this.doCancel_(); | 415 this.doCancel_(); |
415 return true; | 416 return true; |
416 }; | 417 }; |
417 | 418 |
418 /** | 419 /** |
419 * Convert string in clipboard to entries and kick off pasting. | 420 * Convert string in clipboard to entries and kick off pasting. |
mtomasz
2013/02/14 04:38:56
Empty line? Here and in other methods?
yoshiki
2013/02/14 06:17:36
Done.
| |
420 * @param {Object} clipboard Clipboard contents. | 421 * @param {Object} clipboard Clipboard contents. |
421 * @param {string} targetPath Target path. | 422 * @param {string} targetPath Target path. |
422 * @param {boolean} targetOnDrive If target is on Drive. | 423 * @param {boolean} targetOnDrive If target is on Drive. |
423 */ | 424 */ |
424 FileCopyManager.prototype.paste = function(clipboard, targetPath, | 425 FileCopyManager.prototype.paste = function(clipboard, targetPath, |
425 targetOnDrive) { | 426 targetOnDrive) { |
426 var self = this; | 427 var self = this; |
427 var results = { | 428 var results = { |
428 sourceDirEntry: null, | 429 sourceDirEntry: null, |
429 entries: [], | 430 entries: [], |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1254 */ | 1255 */ |
1255 FileCopyManager.prototype.sendDeleteEvent_ = function(task, reason) { | 1256 FileCopyManager.prototype.sendDeleteEvent_ = function(task, reason) { |
1256 this.sendEvent_('delete', { | 1257 this.sendEvent_('delete', { |
1257 reason: reason, | 1258 reason: reason, |
1258 id: task.id, | 1259 id: task.id, |
1259 urls: task.entries.map(function(e) { | 1260 urls: task.entries.map(function(e) { |
1260 return util.makeFilesystemUrl(e.fullPath); | 1261 return util.makeFilesystemUrl(e.fullPath); |
1261 }) | 1262 }) |
1262 }); | 1263 }); |
1263 }; | 1264 }; |
OLD | NEW |