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 * Event of the ProgressCenter class. | 8 * Event of the ProgressCenter class. |
9 * @enum {string} | 9 * @enum {string} |
10 * @const | 10 * @const |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 /** | 148 /** |
149 * Whether the item can be canceled or not. | 149 * Whether the item can be canceled or not. |
150 * @return {boolean} True if the item can be canceled. | 150 * @return {boolean} True if the item can be canceled. |
151 */ | 151 */ |
152 get cancelable() { | 152 get cancelable() { |
153 return !!(this.state == ProgressItemState.PROGRESSING && | 153 return !!(this.state == ProgressItemState.PROGRESSING && |
154 this.cancelCallback && | 154 this.cancelCallback && |
155 !this.summarized); | 155 !this.summarized); |
156 } | 156 } |
157 }; | 157 }; |
| 158 |
| 159 /** |
| 160 * Clones the item. |
| 161 * @return {ProgressCenterItem} New item having the same properties with this. |
| 162 */ |
| 163 ProgressCenterItem.prototype.clone = function() { |
| 164 var newItem = new ProgressCenterItem(); |
| 165 newItem.id = this.id; |
| 166 newItem.state = this.state; |
| 167 newItem.message = this.message; |
| 168 newItem.progressMax = this.progressMax; |
| 169 newItem.progressValue = this.progressValue; |
| 170 newItem.type = this.type; |
| 171 newItem.summarized = this.summarized; |
| 172 newItem.cancelCallback = this.cancelCallback; |
| 173 return newItem; |
| 174 }; |
OLD | NEW |