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

Side by Side Diff: chrome/browser/resources/file_manager/background/js/file_operation_handler.js

Issue 152513002: Files.app: Fix the number of remaining files and processed bytes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed a test. Created 6 years, 10 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 | chrome/browser/resources/file_manager/background/js/file_operation_manager.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 * An event handler of the background page for file operaitons. 8 * An event handler of the background page for file operaitons.
9 * @param {Background} background Background page. 9 * @param {Background} background Background page.
10 * @constructor 10 * @constructor
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 default: 97 default:
98 switch (event.status.operationType) { 98 switch (event.status.operationType) {
99 case 'COPY': return strf('COPY_UNEXPECTED_ERROR', event.error.code); 99 case 'COPY': return strf('COPY_UNEXPECTED_ERROR', event.error.code);
100 case 'MOVE': return strf('MOVE_UNEXPECTED_ERROR', event.error.code); 100 case 'MOVE': return strf('MOVE_UNEXPECTED_ERROR', event.error.code);
101 case 'ZIP': return strf('ZIP_UNEXPECTED_ERROR', event.error.code); 101 case 'ZIP': return strf('ZIP_UNEXPECTED_ERROR', event.error.code);
102 default: return strf('TRANSFER_UNEXPECTED_ERROR', event.error.code); 102 default: return strf('TRANSFER_UNEXPECTED_ERROR', event.error.code);
103 } 103 }
104 } 104 }
105 } else if (event.status.numRemainingItems === 1) { 105 } else if (event.status.numRemainingItems === 1) {
106 var name = event.status.processingEntry.name; 106 var name = event.status.processingEntryName;
107 switch (event.status.operationType) { 107 switch (event.status.operationType) {
108 case 'COPY': return strf('COPY_FILE_NAME', name); 108 case 'COPY': return strf('COPY_FILE_NAME', name);
109 case 'MOVE': return strf('MOVE_FILE_NAME', name); 109 case 'MOVE': return strf('MOVE_FILE_NAME', name);
110 case 'ZIP': return strf('ZIP_FILE_NAME', name); 110 case 'ZIP': return strf('ZIP_FILE_NAME', name);
111 default: return strf('TRANSFER_FILE_NAME', name); 111 default: return strf('TRANSFER_FILE_NAME', name);
112 } 112 }
113 } else { 113 } else {
114 var remainNumber = event.status.numRemainingItems; 114 var remainNumber = event.status.numRemainingItems;
115 switch (event.status.operationType) { 115 switch (event.status.operationType) {
116 case 'COPY': return strf('COPY_ITEMS_REMAINING', remainNumber); 116 case 'COPY': return strf('COPY_ITEMS_REMAINING', remainNumber);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 * @param {ProgressCenterItem} item Pending item. 306 * @param {ProgressCenterItem} item Pending item.
307 * @private 307 * @private
308 */ 308 */
309 FileOperationHandler.prototype.showPendingItem_ = function(item) { 309 FileOperationHandler.prototype.showPendingItem_ = function(item) {
310 // The item is already gone. 310 // The item is already gone.
311 if (!this.pendingItems_[item.id]) 311 if (!this.pendingItems_[item.id])
312 return; 312 return;
313 delete this.pendingItems_[item.id]; 313 delete this.pendingItems_[item.id];
314 this.progressCenter_.updateItem(item); 314 this.progressCenter_.updateItem(item);
315 }; 315 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/background/js/file_operation_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698