Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: chrome/browser/resources/task_manager/main.js

Issue 9288017: WebUI TaskManager: Use the specified height of row on refleshing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with master Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/list.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 10 /**
(...skipping 19 matching lines...) Expand all
30 ['processId', 'processIDColumn', 100, false], 30 ['processId', 'processIDColumn', 100, false],
31 ['webCoreImageCacheSize', 'webcoreImageCacheColumn', 120, false], 31 ['webCoreImageCacheSize', 'webcoreImageCacheColumn', 120, false],
32 ['webCoreScriptsCacheSize', 'webcoreScriptsCacheColumn', 120, false], 32 ['webCoreScriptsCacheSize', 'webcoreScriptsCacheColumn', 120, false],
33 ['webCoreCSSCacheSize', 'webcoreCSSCacheColumn', 120, false], 33 ['webCoreCSSCacheSize', 'webcoreCSSCacheColumn', 120, false],
34 ['fps', 'fpsColumn', 50, true], 34 ['fps', 'fpsColumn', 50, true],
35 ['sqliteMemoryUsed', 'sqliteMemoryUsedColumn', 80, false], 35 ['sqliteMemoryUsed', 'sqliteMemoryUsedColumn', 80, false],
36 ['goatsTeleported', 'goatsTeleportedColumn', 80, false], 36 ['goatsTeleported', 'goatsTeleportedColumn', 80, false],
37 ['v8MemoryAllocatedSize', 'javascriptMemoryAllocatedColumn', 120, false], 37 ['v8MemoryAllocatedSize', 'javascriptMemoryAllocatedColumn', 120, false],
38 ]; 38 ];
39 39
40 /*
41 * Height of each tasks. It is 20px, which is also defined in CSS.
42 * @const
43 */
44 var HEIGHT_OF_TASK = 20;
45
40 var COMMAND_CONTEXTMENU_COLUMN_PREFIX = 'columnContextMenu'; 46 var COMMAND_CONTEXTMENU_COLUMN_PREFIX = 'columnContextMenu';
41 var COMMAND_CONTEXTMENU_TABLE_PREFIX = 'tableContextMenu'; 47 var COMMAND_CONTEXTMENU_TABLE_PREFIX = 'tableContextMenu';
42 48
43 var localStrings = new LocalStrings(); 49 var localStrings = new LocalStrings();
44 50
45 TaskManager.prototype = { 51 TaskManager.prototype = {
46 /** 52 /**
47 * Handle window close. 53 * Handle window close.
48 */ 54 */
49 onClose: function () { 55 onClose: function () {
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 cell.className = 'table-row-cell'; 531 cell.className = 'table-row-cell';
526 cell.id = 'column-' + pid + '-' + cm.getId(i); 532 cell.id = 'column-' + pid + '-' + cm.getId(i);
527 cell.appendChild( 533 cell.appendChild(
528 cm.getRenderFunction(i).call(null, data, cm.getId(i), table)); 534 cm.getRenderFunction(i).call(null, data, cm.getId(i), table));
529 535
530 listItem.appendChild(cell); 536 listItem.appendChild(cell);
531 537
532 // Stores the cell element to the dictionary. 538 // Stores the cell element to the dictionary.
533 this.elementsCache_[pid].cell[i] = cell; 539 this.elementsCache_[pid].cell[i] = cell;
534 } 540 }
541
542 // Specifies the height of the row. The height of each row is
543 // 'num_of_tasks * HEIGHT_OF_TASK' px.
544 listItem.style.height = (data['uniqueId'].length * HEIGHT_OF_TASK) + 'px';
545
535 listItem.data = data; 546 listItem.data = data;
536 547
537 // Stores the list item element, the number of columns and the number of 548 // Stores the list item element, the number of columns and the number of
538 // childlen. 549 // childlen.
539 this.elementsCache_[pid].listItem = listItem; 550 this.elementsCache_[pid].listItem = listItem;
540 this.elementsCache_[pid].cachedColumnSize = cm.size; 551 this.elementsCache_[pid].cachedColumnSize = cm.size;
541 this.elementsCache_[pid].cachedChildSize = data['uniqueId'].length; 552 this.elementsCache_[pid].cachedChildSize = data['uniqueId'].length;
542 553
543 return listItem; 554 return listItem;
544 }, 555 },
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 return; 845 return;
835 taskmanager.onTaskChange(start, length, tasks); 846 taskmanager.onTaskChange(start, length, tasks);
836 } 847 }
837 848
838 function taskRemoved(start, length) { 849 function taskRemoved(start, length) {
839 // Sometimes this can get called too early. 850 // Sometimes this can get called too early.
840 if (!taskmanager) 851 if (!taskmanager)
841 return; 852 return;
842 taskmanager.onTaskRemove(start, length); 853 taskmanager.onTaskRemove(start, length);
843 } 854 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698