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

Side by Side Diff: Source/devtools/front_end/HeapSnapshotView.js

Issue 197823010: [DevTools] Add minimum size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@splitdip2
Patch Set: fixed comments Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType. SnapshotReceived, this._onReceiveSnapshot, this); 42 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType. SnapshotReceived, this._onReceiveSnapshot, this);
43 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov eProfileHeader, this._onProfileHeaderRemoved, this); 43 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov eProfileHeader, this._onProfileHeaderRemoved, this);
44 44
45 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType .TypeId) { 45 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType .TypeId) {
46 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p rofile); 46 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p rofile);
47 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); 47 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this));
48 } 48 }
49 49
50 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit ViewState", 200, 200); 50 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit ViewState", 200, 200);
51 this._splitView.show(this.element); 51 this._splitView.show(this.element);
52 this._splitView.setMainElementConstraints(50, 50);
53 this._splitView.setSidebarElementConstraints(70, 70);
54 52
55 this._containmentView = new WebInspector.VBox(); 53 this._containmentView = new WebInspector.VBox();
54 this._containmentView.setMinimumSize(50, 25);
56 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid (); 55 this._containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid ();
57 this._containmentDataGrid.show(this._containmentView.element); 56 this._containmentDataGrid.show(this._containmentView.element);
58 this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele ctedNode, this._selectionChanged, this); 57 this._containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele ctedNode, this._selectionChanged, this);
59 58
60 this._statisticsView = new WebInspector.HeapSnapshotStatisticsView(); 59 this._statisticsView = new WebInspector.HeapSnapshotStatisticsView();
61 60
62 this._constructorsView = new WebInspector.VBox(); 61 this._constructorsView = new WebInspector.VBox();
62 this._constructorsView.setMinimumSize(50, 25);
63 63
64 this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGr id(); 64 this._constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGr id();
65 this._constructorsDataGrid.show(this._constructorsView.element); 65 this._constructorsDataGrid.show(this._constructorsView.element);
66 this._constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sel ectedNode, this._selectionChanged, this); 66 this._constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sel ectedNode, this._selectionChanged, this);
67 67
68 this._diffView = new WebInspector.VBox(); 68 this._diffView = new WebInspector.VBox();
69 this._diffView.setMinimumSize(50, 25);
69 70
70 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(); 71 this._diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
71 this._diffDataGrid.show(this._diffView.element); 72 this._diffDataGrid.show(this._diffView.element);
72 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, this._selectionChanged, this); 73 this._diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNod e, this._selectionChanged, this);
73 74
74 this._dominatorView = new WebInspector.VBox(); 75 this._dominatorView = new WebInspector.VBox();
76 this._dominatorView.setMinimumSize(50, 25);
75 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(); 77 this._dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
76 this._dominatorDataGrid.show(this._dominatorView.element); 78 this._dominatorDataGrid.show(this._dominatorView.element);
77 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select edNode, this._selectionChanged, this); 79 this._dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Select edNode, this._selectionChanged, this);
78 80
79 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps hotProfileType) { 81 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps hotProfileType) {
80 this._allocationView = new WebInspector.VBox(); 82 this._allocationView = new WebInspector.VBox();
83 this._allocationView.setMinimumSize(50, 25);
81 this._allocationDataGrid = new WebInspector.AllocationDataGrid(); 84 this._allocationDataGrid = new WebInspector.AllocationDataGrid();
82 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S electedNode, this._onSelectAllocationNode, this); 85 this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.S electedNode, this._onSelectAllocationNode, this);
83 this._allocationDataGrid.show(this._allocationView.element); 86 this._allocationDataGrid.show(this._allocationView.element);
84 } 87 }
85 88
86 this._retainmentViewHeader = document.createElementWithClass("div", "retaine rs-view-header"); 89 this._retainmentViewHeader = document.createElementWithClass("div", "retaine rs-view-header");
87 var retainingPathsTitleDiv = this._retainmentViewHeader.createChild("div", " title"); 90 var retainingPathsTitleDiv = this._retainmentViewHeader.createChild("div", " title");
88 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); 91 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span");
89 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining tree"); 92 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining tree");
90 this._splitView.hideDefaultResizer(); 93 this._splitView.hideDefaultResizer();
91 this._splitView.installResizer(this._retainmentViewHeader); 94 this._splitView.installResizer(this._retainmentViewHeader);
92 95
93 this._retainmentView = new WebInspector.VBox(); 96 this._retainmentView = new WebInspector.VBox();
97 this._retainmentView.setMinimumSize(50, 21);
94 this._retainmentView.element.classList.add("retaining-paths-view"); 98 this._retainmentView.element.classList.add("retaining-paths-view");
95 this._retainmentView.element.appendChild(this._retainmentViewHeader); 99 this._retainmentView.element.appendChild(this._retainmentViewHeader);
96 this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid() ; 100 this._retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid() ;
97 this._retainmentDataGrid.show(this._retainmentView.element); 101 this._retainmentDataGrid.show(this._retainmentView.element);
98 this._retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec tedNode, this._inspectedObjectChanged, this); 102 this._retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec tedNode, this._inspectedObjectChanged, this);
99 this._retainmentDataGrid.reset(); 103 this._retainmentDataGrid.reset();
100 104
101 this._perspectives = []; 105 this._perspectives = [];
102 this._perspectives.push(new WebInspector.HeapSnapshotView.SummaryPerspective ()); 106 this._perspectives.push(new WebInspector.HeapSnapshotView.SummaryPerspective ());
103 if (profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trac kingHeapSnapshotProfileType) 107 if (profile.profileType() !== WebInspector.ProfileTypeRegistry.instance.trac kingHeapSnapshotProfileType)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 368 }
365 369
366 /** 370 /**
367 * @constructor 371 * @constructor
368 * @extends {WebInspector.HeapSnapshotView.Perspective} 372 * @extends {WebInspector.HeapSnapshotView.Perspective}
369 */ 373 */
370 WebInspector.HeapSnapshotView.AllocationPerspective = function() 374 WebInspector.HeapSnapshotView.AllocationPerspective = function()
371 { 375 {
372 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString( "Allocation")); 376 WebInspector.HeapSnapshotView.Perspective.call(this, WebInspector.UIString( "Allocation"));
373 this._allocationSplitView = new WebInspector.SplitView(false, true, "heapSna pshotAllocationSplitViewState", 200, 200); 377 this._allocationSplitView = new WebInspector.SplitView(false, true, "heapSna pshotAllocationSplitViewState", 200, 200);
374 this._allocationSplitView.setMainElementConstraints(50, 100);
375 this._allocationSplitView.setSidebarElementConstraints(50, 100);
376 } 378 }
377 379
378 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = { 380 WebInspector.HeapSnapshotView.AllocationPerspective.prototype = {
379 /** 381 /**
380 * @override 382 * @override
381 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView 383 * @param {!WebInspector.HeapSnapshotView} heapSnapshotView
382 */ 384 */
383 activate: function(heapSnapshotView) 385 activate: function(heapSnapshotView)
384 { 386 {
385 heapSnapshotView._allocationView.show(this._allocationSplitView.mainElem ent()); 387 heapSnapshotView._allocationView.show(this._allocationSplitView.mainElem ent());
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 } 2123 }
2122 2124
2123 2125
2124 /** 2126 /**
2125 * @constructor 2127 * @constructor
2126 * @extends {WebInspector.VBox} 2128 * @extends {WebInspector.VBox}
2127 */ 2129 */
2128 WebInspector.HeapSnapshotStatisticsView = function() 2130 WebInspector.HeapSnapshotStatisticsView = function()
2129 { 2131 {
2130 WebInspector.VBox.call(this); 2132 WebInspector.VBox.call(this);
2133 this.setMinimumSize(50, 25);
2131 this._pieChart = new WebInspector.PieChart(); 2134 this._pieChart = new WebInspector.PieChart();
2132 this._pieChart.setSize(150); 2135 this._pieChart.setSize(150);
2133 this.element.appendChild(this._pieChart.element); 2136 this.element.appendChild(this._pieChart.element);
2134 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend") ; 2137 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend") ;
2135 } 2138 }
2136 2139
2137 WebInspector.HeapSnapshotStatisticsView.prototype = { 2140 WebInspector.HeapSnapshotStatisticsView.prototype = {
2138 /** 2141 /**
2139 * @param {number} value 2142 * @param {number} value
2140 */ 2143 */
(...skipping 19 matching lines...) Expand all
2160 if (color) 2163 if (color)
2161 swatchDiv.style.backgroundColor = color; 2164 swatchDiv.style.backgroundColor = color;
2162 else 2165 else
2163 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); 2166 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch");
2164 nameDiv.textContent = name; 2167 nameDiv.textContent = name;
2165 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024))); 2168 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024)));
2166 }, 2169 },
2167 2170
2168 __proto__: WebInspector.VBox.prototype 2171 __proto__: WebInspector.VBox.prototype
2169 } 2172 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ElementsPanel.js ('k') | Source/devtools/front_end/InspectedPagePlaceholder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698