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 /** @constructor */ | 5 /** @constructor */ |
6 function TaskManager() { } | 6 function TaskManager() { } |
7 | 7 |
8 cr.addSingletonGetter(TaskManager); | 8 cr.addSingletonGetter(TaskManager); |
9 | 9 |
10 var localStrings = new LocalStrings(); | 10 var localStrings = new LocalStrings(); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 var aValues = a[columnIdToSort]; | 136 var aValues = a[columnIdToSort]; |
137 var bValues = b[columnIdToSort]; | 137 var bValues = b[columnIdToSort]; |
138 var aValue = aValues && aValues[0] || 0; | 138 var aValue = aValues && aValues[0] || 0; |
139 var bvalue = bValues && bValues[0] || 0; | 139 var bvalue = bValues && bValues[0] || 0; |
140 return dm.defaultValuesCompareFunction(aValue, bvalue); | 140 return dm.defaultValuesCompareFunction(aValue, bvalue); |
141 }; | 141 }; |
142 })(); | 142 })(); |
143 dm.setCompareFunction(columnId, compareFunc); | 143 dm.setCompareFunction(columnId, compareFunc); |
144 } | 144 } |
145 | 145 |
| 146 if (isColumnEnabled(DEFAULT_SORT_COLUMN)) |
| 147 dm.sort(DEFAULT_SORT_COLUMN, DEFAULT_SORT_DIRECTION); |
| 148 |
146 this.initTable_(); | 149 this.initTable_(); |
147 | 150 |
148 commands.enableTaskManager(); | 151 commands.enableTaskManager(); |
149 | 152 |
150 // Populate the static localized strings. | 153 // Populate the static localized strings. |
151 i18nTemplate.process(this.document_, templateData); | 154 i18nTemplate.process(this.document_, templateData); |
152 | 155 |
153 measureTime.recordInterval('Load.DOM'); | 156 measureTime.recordInterval('Load.DOM'); |
154 measureTime.recordInterval('Load.Total'); | 157 measureTime.recordInterval('Load.Total'); |
155 | 158 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 function init() { | 696 function init() { |
694 var params = parseQueryParams(window.location); | 697 var params = parseQueryParams(window.location); |
695 var opt = {}; | 698 var opt = {}; |
696 opt['isBackgroundMode'] = params.background; | 699 opt['isBackgroundMode'] = params.background; |
697 opt['isShowCloseButton'] = params.showclose; | 700 opt['isShowCloseButton'] = params.showclose; |
698 taskmanager.initialize(document.body, opt); | 701 taskmanager.initialize(document.body, opt); |
699 } | 702 } |
700 | 703 |
701 document.addEventListener('DOMContentLoaded', init); | 704 document.addEventListener('DOMContentLoaded', init); |
702 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); | 705 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); |
OLD | NEW |