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

Unified Diff: ui/file_manager/file_manager/background/js/file_operation_manager.js

Issue 571343002: Add notification before getMultiProfileShareEntries_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/background/js/file_operation_manager.js
diff --git a/ui/file_manager/file_manager/background/js/file_operation_manager.js b/ui/file_manager/file_manager/background/js/file_operation_manager.js
index d66e782f3dc890eb0aa30751daf3c47aab17695d..2f93b6df1e5d34aee909da032d0629c5a2fbadee 100644
--- a/ui/file_manager/file_manager/background/js/file_operation_manager.js
+++ b/ui/file_manager/file_manager/background/js/file_operation_manager.js
@@ -1184,9 +1184,12 @@ FileOperationManager.prototype.requestTaskCancel = function(taskId) {
* directory.
* @param {boolean} isMove True if the operation is "move", otherwise (i.e.
* if the operation is "copy") false.
+ * @param {string=} opt_taskId If the corresponding item has already created
+ * at another places, we need to specify the ID of the item. If the
+ * item is not created, FileOperationManager generates new ID.
*/
FileOperationManager.prototype.paste = function(
- sourceEntries, targetEntry, isMove) {
+ sourceEntries, targetEntry, isMove, opt_taskId) {
// Do nothing if sourceEntries is empty.
if (sourceEntries.length === 0)
return;
@@ -1220,7 +1223,7 @@ FileOperationManager.prototype.paste = function(
if (filteredEntries.length === 0)
return;
- this.queueCopy_(targetEntry, filteredEntries, isMove);
+ this.queueCopy_(targetEntry, filteredEntries, isMove, opt_taskId);
}.bind(this));
};
@@ -1231,10 +1234,13 @@ FileOperationManager.prototype.paste = function(
* @param {DirectoryEntry} targetDirEntry Target directory.
* @param {Array.<Entry>} entries Entries to copy.
* @param {boolean} isMove In case of move.
+ * @param {string=} opt_taskId If the corresponding item has already created
+ * at another places, we need to specify the ID of the item. If the
+ * item is not created, FileOperationManager generates new ID.
* @private
*/
FileOperationManager.prototype.queueCopy_ = function(
- targetDirEntry, entries, isMove) {
+ targetDirEntry, entries, isMove, opt_taskId) {
var task;
if (isMove) {
// When moving between different volumes, moving is implemented as a copy
@@ -1250,7 +1256,7 @@ FileOperationManager.prototype.queueCopy_ = function(
task = new FileOperationManager.CopyTask(entries, targetDirEntry, false);
}
- task.taskId = this.generateTaskId_();
+ task.taskId = opt_taskId || this.generateTaskId();
this.eventRouter_.sendProgressEvent('BEGIN', task.getStatus(), task.taskId);
task.initialize(function() {
this.copyTasks_.push(task);
@@ -1327,7 +1333,7 @@ FileOperationManager.prototype.deleteEntries = function(entries) {
// TODO(hirono): Make FileOperationManager.DeleteTask.
var task = Object.seal({
entries: entries,
- taskId: this.generateTaskId_(),
+ taskId: this.generateTaskId(),
entrySize: {},
totalBytes: 0,
processedBytes: 0,
@@ -1438,7 +1444,7 @@ FileOperationManager.prototype.zipSelection = function(
dirEntry, selectionEntries) {
var zipTask = new FileOperationManager.ZipTask(
selectionEntries, dirEntry, dirEntry);
- zipTask.taskId = this.generateTaskId_(this.copyTasks_);
+ zipTask.taskId = this.generateTaskId(this.copyTasks_);
zipTask.zip = true;
this.eventRouter_.sendProgressEvent('BEGIN',
zipTask.getStatus(),
@@ -1454,8 +1460,7 @@ FileOperationManager.prototype.zipSelection = function(
* Generates new task ID.
*
* @return {string} New task ID.
- * @private
*/
-FileOperationManager.prototype.generateTaskId_ = function() {
+FileOperationManager.prototype.generateTaskId = function() {
return 'file-operation-' + this.taskIdCounter_++;
};
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/file_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698