OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** @constructor */ | 5 /** @constructor */ |
6 function TaskManager() { } | 6 function TaskManager() { } |
7 | 7 |
8 cr.addSingletonGetter(TaskManager); | 8 cr.addSingletonGetter(TaskManager); |
9 | 9 |
10 /* | 10 /* |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 // Sets custom row render function. | 238 // Sets custom row render function. |
239 this.table_.setRenderFunction(this.renderRow_.bind(this)); | 239 this.table_.setRenderFunction(this.renderRow_.bind(this)); |
240 }, | 240 }, |
241 | 241 |
242 renderRow_: function(dataItem, table) { | 242 renderRow_: function(dataItem, table) { |
243 var cm = table.columnModel; | 243 var cm = table.columnModel; |
244 var listItem = new cr.ui.ListItem({label: ''}); | 244 var listItem = new cr.ui.ListItem({label: ''}); |
245 | 245 |
246 listItem.className = 'table-row'; | 246 listItem.className = 'table-row'; |
247 if (this.opt_.isBackgroundMode_ && dataItem.isBackgroundResource) | 247 if (this.opt_.isBackgroundMode && dataItem.isBackgroundResource) |
248 listItem.className += ' table-background-row'; | 248 listItem.className += ' table-background-row'; |
249 | 249 |
250 for (var i = 0; i < cm.size; i++) { | 250 for (var i = 0; i < cm.size; i++) { |
251 var cell = document.createElement('div'); | 251 var cell = document.createElement('div'); |
252 cell.style.width = cm.getWidth(i) + '%'; | 252 cell.style.width = cm.getWidth(i) + '%'; |
253 cell.className = 'table-row-cell'; | 253 cell.className = 'table-row-cell'; |
254 cell.appendChild( | 254 cell.appendChild( |
255 cm.getRenderFunction(i).call(null, dataItem, cm.getId(i), table)); | 255 cm.getRenderFunction(i).call(null, dataItem, cm.getId(i), table)); |
256 | 256 |
257 listItem.appendChild(cell); | 257 listItem.appendChild(cell); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 taskmanager.onTaskChange(start, length, tasks); | 405 taskmanager.onTaskChange(start, length, tasks); |
406 } | 406 } |
407 | 407 |
408 function taskRemoved(start, length) { | 408 function taskRemoved(start, length) { |
409 // Sometimes this can get called too early. | 409 // Sometimes this can get called too early. |
410 if (!taskmanager) | 410 if (!taskmanager) |
411 return; | 411 return; |
412 taskmanager.onTaskRemove(start, length); | 412 taskmanager.onTaskRemove(start, length); |
413 } | 413 } |
414 | 414 |
OLD | NEW |