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

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: 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 this._trackingOverviewGrid.show(this.element); 48 this._trackingOverviewGrid.show(this.element);
49 } 49 }
50 50
51 this.viewsContainer = new WebInspector.SplitView(false, true, "heapSnapshotS plitViewState", 200, 200); 51 this.viewsContainer = new WebInspector.SplitView(false, true, "heapSnapshotS plitViewState", 200, 200);
52 this.viewsContainer.show(this.element); 52 this.viewsContainer.show(this.element);
53 this.viewsContainer.setMainElementConstraints(50, 50);
54 this.viewsContainer.setSidebarElementConstraints(70, 70);
55 53
56 this.containmentView = new WebInspector.VBox(); 54 this.containmentView = new WebInspector.VBox();
55 this.containmentView.setMinimumSize(new Size(50, 25));
57 this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid( ); 56 this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid( );
58 this.containmentDataGrid.element.addEventListener("mousedown", this._mouseDo wnInContentsGrid.bind(this), true); 57 this.containmentDataGrid.element.addEventListener("mousedown", this._mouseDo wnInContentsGrid.bind(this), true);
59 this.containmentDataGrid.show(this.containmentView.element); 58 this.containmentDataGrid.show(this.containmentView.element);
60 this.containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec tedNode, this._selectionChanged, this); 59 this.containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Selec tedNode, this._selectionChanged, this);
61 60
62 this.statisticsView = new WebInspector.HeapSnapshotStatisticsView(); 61 this.statisticsView = new WebInspector.HeapSnapshotStatisticsView();
63 62
64 this.constructorsView = new WebInspector.VBox(); 63 this.constructorsView = new WebInspector.VBox();
64 this.constructorsView.setMinimumSize(new Size(50, 25));
65 65
66 this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGri d(); 66 this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGri d();
67 this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseD ownInContentsGrid.bind(this), true); 67 this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseD ownInContentsGrid.bind(this), true);
68 this.constructorsDataGrid.show(this.constructorsView.element); 68 this.constructorsDataGrid.show(this.constructorsView.element);
69 this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele ctedNode, this._selectionChanged, this); 69 this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.Sele ctedNode, this._selectionChanged, this);
70 70
71 this.dataGrid = /** @type {!WebInspector.HeapSnapshotSortableDataGrid} */ (t his.constructorsDataGrid); 71 this.dataGrid = /** @type {!WebInspector.HeapSnapshotSortableDataGrid} */ (t his.constructorsDataGrid);
72 this.dataGrid.addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Eve nts.ResetFilter, this._onResetClassNameFilter, this); 72 this.dataGrid.addEventListener(WebInspector.HeapSnapshotSortableDataGrid.Eve nts.ResetFilter, this._onResetClassNameFilter, this);
73 this.currentView = this.constructorsView; 73 this.currentView = this.constructorsView;
74 this.currentView.show(this.viewsContainer.mainElement()); 74 this.currentView.show(this.viewsContainer.mainElement());
75 75
76 this.diffView = new WebInspector.VBox(); 76 this.diffView = new WebInspector.VBox();
77 this.diffView.setMinimumSize(new Size(50, 25));
77 78
78 this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid(); 79 this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
79 this.diffDataGrid.show(this.diffView.element); 80 this.diffDataGrid.show(this.diffView.element);
80 this.diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode , this._selectionChanged, this); 81 this.diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode , this._selectionChanged, this);
81 82
82 this.dominatorView = new WebInspector.VBox(); 83 this.dominatorView = new WebInspector.VBox();
84 this.dominatorView.setMinimumSize(new Size(50, 25));
83 this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid(); 85 this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
84 this.dominatorDataGrid.element.addEventListener("mousedown", this._mouseDown InContentsGrid.bind(this), true); 86 this.dominatorDataGrid.element.addEventListener("mousedown", this._mouseDown InContentsGrid.bind(this), true);
85 this.dominatorDataGrid.show(this.dominatorView.element); 87 this.dominatorDataGrid.show(this.dominatorView.element);
86 this.dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Selecte dNode, this._selectionChanged, this); 88 this.dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.Selecte dNode, this._selectionChanged, this);
87 89
88 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps hotProfileType) { 90 if (WebInspector.experimentsSettings.allocationProfiler.isEnabled() && profi le.profileType() === WebInspector.ProfileTypeRegistry.instance.trackingHeapSnaps hotProfileType) {
89 this.allocationView = new WebInspector.VBox(); 91 this.allocationView = new WebInspector.VBox();
92 this.allocationView.setMinimumSize(new Size(50, 25));
90 this.allocationDataGrid = new WebInspector.AllocationDataGrid(); 93 this.allocationDataGrid = new WebInspector.AllocationDataGrid();
91 this.allocationDataGrid.element.addEventListener("mousedown", this._mous eDownInContentsGrid.bind(this), true); 94 this.allocationDataGrid.element.addEventListener("mousedown", this._mous eDownInContentsGrid.bind(this), true);
92 this.allocationDataGrid.show(this.allocationView.element); 95 this.allocationDataGrid.show(this.allocationView.element);
93 this.allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.Se lectedNode, this._selectionChanged, this); 96 this.allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.Se lectedNode, this._selectionChanged, this);
94 } 97 }
95 98
96 this.retainmentViewHeader = document.createElementWithClass("div", "retainer s-view-header"); 99 this.retainmentViewHeader = document.createElementWithClass("div", "retainer s-view-header");
97 var retainingPathsTitleDiv = this.retainmentViewHeader.createChild("div", "t itle"); 100 var retainingPathsTitleDiv = this.retainmentViewHeader.createChild("div", "t itle");
98 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span"); 101 var retainingPathsTitle = retainingPathsTitleDiv.createChild("span");
99 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining tree"); 102 retainingPathsTitle.textContent = WebInspector.UIString("Object's retaining tree");
100 this.viewsContainer.hideDefaultResizer(); 103 this.viewsContainer.hideDefaultResizer();
101 this.viewsContainer.installResizer(this.retainmentViewHeader); 104 this.viewsContainer.installResizer(this.retainmentViewHeader);
102 105
103 this.retainmentView = new WebInspector.VBox(); 106 this.retainmentView = new WebInspector.VBox();
107 this.retainmentView.setMinimumSize(new Size(50, 21));
104 this.retainmentView.element.classList.add("retaining-paths-view"); 108 this.retainmentView.element.classList.add("retaining-paths-view");
105 this.retainmentView.element.appendChild(this.retainmentViewHeader); 109 this.retainmentView.element.appendChild(this.retainmentViewHeader);
106 this.retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid(); 110 this.retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid();
107 this.retainmentDataGrid.show(this.retainmentView.element); 111 this.retainmentDataGrid.show(this.retainmentView.element);
108 this.retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Select edNode, this._inspectedObjectChanged, this); 112 this.retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.Select edNode, this._inspectedObjectChanged, this);
109 this.retainmentView.show(this.viewsContainer.sidebarElement()); 113 this.retainmentView.show(this.viewsContainer.sidebarElement());
110 this.retainmentDataGrid.reset(); 114 this.retainmentDataGrid.reset();
111 115
112 this.viewSelect = new WebInspector.StatusBarComboBox(this._onSelectedViewCha nged.bind(this)); 116 this.viewSelect = new WebInspector.StatusBarComboBox(this._onSelectedViewCha nged.bind(this));
113 117
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 } 1812 }
1809 1813
1810 1814
1811 /** 1815 /**
1812 * @constructor 1816 * @constructor
1813 * @extends {WebInspector.VBox} 1817 * @extends {WebInspector.VBox}
1814 */ 1818 */
1815 WebInspector.HeapSnapshotStatisticsView = function() 1819 WebInspector.HeapSnapshotStatisticsView = function()
1816 { 1820 {
1817 WebInspector.VBox.call(this); 1821 WebInspector.VBox.call(this);
1822 this.setMinimumSize(new Size(50, 25));
1818 this._pieChart = new WebInspector.PieChart(); 1823 this._pieChart = new WebInspector.PieChart();
1819 this._pieChart.setSize(150); 1824 this._pieChart.setSize(150);
1820 this.element.appendChild(this._pieChart.element); 1825 this.element.appendChild(this._pieChart.element);
1821 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend") ; 1826 this._labels = this.element.createChild("div", "heap-snapshot-stats-legend") ;
1822 } 1827 }
1823 1828
1824 WebInspector.HeapSnapshotStatisticsView.prototype = { 1829 WebInspector.HeapSnapshotStatisticsView.prototype = {
1825 /** 1830 /**
1826 * @param {number} value 1831 * @param {number} value
1827 */ 1832 */
(...skipping 19 matching lines...) Expand all
1847 if (color) 1852 if (color)
1848 swatchDiv.style.backgroundColor = color; 1853 swatchDiv.style.backgroundColor = color;
1849 else 1854 else
1850 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); 1855 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch");
1851 nameDiv.textContent = name; 1856 nameDiv.textContent = name;
1852 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024))); 1857 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand sSeparator(Math.round(value / 1024)));
1853 }, 1858 },
1854 1859
1855 __proto__: WebInspector.VBox.prototype 1860 __proto__: WebInspector.VBox.prototype
1856 } 1861 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698