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 if (chrome.extension) { | 7 if (chrome.extension) { |
8 var getContentWindows = function() { | 8 var getContentWindows = function() { |
9 return chrome.extension.getViews(); | 9 return chrome.extension.getViews(); |
10 }; | 10 }; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 */ | 298 */ |
299 FileCopyManager.prototype.sendEvent_ = function(eventName, eventArgs) { | 299 FileCopyManager.prototype.sendEvent_ = function(eventName, eventArgs) { |
300 if (this.cancelRequested_) | 300 if (this.cancelRequested_) |
301 return; // Swallow events until cancellation complete. | 301 return; // Swallow events until cancellation complete. |
302 | 302 |
303 eventArgs.status = this.getStatus(); | 303 eventArgs.status = this.getStatus(); |
304 | 304 |
305 var windows = getContentWindows(); | 305 var windows = getContentWindows(); |
306 for (var i = 0; i < windows.length; i++) { | 306 for (var i = 0; i < windows.length; i++) { |
307 var w = windows[i]; | 307 var w = windows[i]; |
308 if (w.fileCopyManagerWrapper) | 308 if (w.FileCopyManagerWrapper) |
309 w.fileCopyManagerWrapper.onEvent(eventName, eventArgs); | 309 w.FileCopyManagerWrapper.getInstance().onEvent(eventName, eventArgs); |
310 } | 310 } |
311 }; | 311 }; |
312 | 312 |
313 /** | 313 /** |
314 * Unloads the host page in 5 secs of idleing. Need to be called | 314 * Unloads the host page in 5 secs of idleing. Need to be called |
315 * each time this.copyTasks_.length or this.deleteTasks_.length | 315 * each time this.copyTasks_.length or this.deleteTasks_.length |
316 * changed. | 316 * changed. |
317 * | 317 * |
318 * @private | 318 * @private |
319 */ | 319 */ |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 // Assume self.cancelRequested_ == false. | 1264 // Assume self.cancelRequested_ == false. |
1265 // This moved us from 0 to 1 active tasks, let the servicing begin! | 1265 // This moved us from 0 to 1 active tasks, let the servicing begin! |
1266 self.serviceAllTasks_(); | 1266 self.serviceAllTasks_(); |
1267 } else { | 1267 } else { |
1268 // Force to update the progress of butter bar when there are new tasks | 1268 // Force to update the progress of butter bar when there are new tasks |
1269 // coming while servicing current task. | 1269 // coming while servicing current task. |
1270 self.sendProgressEvent_('PROGRESS'); | 1270 self.sendProgressEvent_('PROGRESS'); |
1271 } | 1271 } |
1272 }); | 1272 }); |
1273 }; | 1273 }; |
OLD | NEW |