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