| 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 var fileCopyManagerWrapper = null; | 5 var fileCopyManagerWrapper = null; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * While FileCopyManager is run in the background page, this class is used to | 8 * While FileCopyManager is run in the background page, this class is used to |
| 9 * communicate with it. | 9 * communicate with it. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 */ | 48 */ |
| 49 FileCopyManagerWrapper.getInstance = function(root) { | 49 FileCopyManagerWrapper.getInstance = function(root) { |
| 50 if (fileCopyManagerWrapper === null) { | 50 if (fileCopyManagerWrapper === null) { |
| 51 fileCopyManagerWrapper = new FileCopyManagerWrapper(root); | 51 fileCopyManagerWrapper = new FileCopyManagerWrapper(root); |
| 52 } | 52 } |
| 53 return fileCopyManagerWrapper; | 53 return fileCopyManagerWrapper; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Load background page and call callback with copy manager as an argument. | 57 * Load background page and call callback with copy manager as an argument. |
| 58 * @param {Function} callback Function with FileCopyManager as a parameter. |
| 58 * @private | 59 * @private |
| 59 * @param {Function} callback Function with FileCopyManager as a parameter. | |
| 60 */ | 60 */ |
| 61 FileCopyManagerWrapper.prototype.getCopyManagerAsync_ = function(callback) { | 61 FileCopyManagerWrapper.prototype.getCopyManagerAsync_ = function(callback) { |
| 62 var MAX_RETRIES = 10; | 62 var MAX_RETRIES = 10; |
| 63 var TIMEOUT = 100; | 63 var TIMEOUT = 100; |
| 64 | 64 |
| 65 var root = this.root_; | 65 var root = this.root_; |
| 66 var retries = 0; | 66 var retries = 0; |
| 67 | 67 |
| 68 var tryOnce = function() { | 68 var tryOnce = function() { |
| 69 var onGetBackgroundPage = function(bg) { | 69 var onGetBackgroundPage = function(bg) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 }); | 122 }); |
| 123 }; | 123 }; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 FileCopyManagerWrapper.decorateAsyncMethod('requestCancel'); | 126 FileCopyManagerWrapper.decorateAsyncMethod('requestCancel'); |
| 127 FileCopyManagerWrapper.decorateAsyncMethod('paste'); | 127 FileCopyManagerWrapper.decorateAsyncMethod('paste'); |
| 128 FileCopyManagerWrapper.decorateAsyncMethod('deleteEntries'); | 128 FileCopyManagerWrapper.decorateAsyncMethod('deleteEntries'); |
| 129 FileCopyManagerWrapper.decorateAsyncMethod('forceDeleteTask'); | 129 FileCopyManagerWrapper.decorateAsyncMethod('forceDeleteTask'); |
| 130 FileCopyManagerWrapper.decorateAsyncMethod('cancelDeleteTask'); | 130 FileCopyManagerWrapper.decorateAsyncMethod('cancelDeleteTask'); |
| 131 FileCopyManagerWrapper.decorateAsyncMethod('zipSelection'); | 131 FileCopyManagerWrapper.decorateAsyncMethod('zipSelection'); |
| OLD | NEW |