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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 2412023002: DevTools: migrate InspectorView to tabbed view location. (Closed)
Patch Set: made layers panel closeable. Created 4 years, 2 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 /** 868 /**
869 * @param {!Event} event 869 * @param {!Event} event
870 * @param {!WebInspector.ContextMenu} contextMenu 870 * @param {!WebInspector.ContextMenu} contextMenu
871 * @param {!Object} target 871 * @param {!Object} target
872 */ 872 */
873 appendApplicableItems: function(event, contextMenu, target) 873 appendApplicableItems: function(event, contextMenu, target)
874 { 874 {
875 if (!(target instanceof WebInspector.RemoteObject)) 875 if (!(target instanceof WebInspector.RemoteObject))
876 return; 876 return;
877 877
878 if (WebInspector.inspectorView.currentPanel() !== this) 878 if (!this.isShowing())
879 return; 879 return;
880 880
881 var object = /** @type {!WebInspector.RemoteObject} */ (target); 881 var object = /** @type {!WebInspector.RemoteObject} */ (target);
882 var objectId = object.objectId; 882 var objectId = object.objectId;
883 if (!objectId) 883 if (!objectId)
884 return; 884 return;
885 885
886 var heapProfiles = WebInspector.ProfileTypeRegistry.instance.heapSnapsho tProfileType.getProfiles(); 886 var heapProfiles = WebInspector.ProfileTypeRegistry.instance.heapSnapsho tProfileType.getProfiles();
887 if (!heapProfiles.length) 887 if (!heapProfiles.length)
888 return; 888 return;
889 889
890 /** 890 /**
891 * @this {WebInspector.ProfilesPanel} 891 * @this {WebInspector.ProfilesPanel}
892 */ 892 */
893 function revealInView(viewName) 893 function revealInView(viewName)
894 { 894 {
895 object.target().heapProfilerAgent().getHeapObjectId(objectId, didRec eiveHeapObjectId.bind(this, viewName)); 895 object.target().heapProfilerAgent().getHeapObjectId(objectId, didRec eiveHeapObjectId.bind(this, viewName));
896 } 896 }
897 897
898 /** 898 /**
899 * @this {WebInspector.ProfilesPanel} 899 * @this {WebInspector.ProfilesPanel}
900 */ 900 */
901 function didReceiveHeapObjectId(viewName, error, result) 901 function didReceiveHeapObjectId(viewName, error, result)
902 { 902 {
903 if (WebInspector.inspectorView.currentPanel() !== this) 903 if (!this.isShowing())
904 return; 904 return;
905 if (!error) 905 if (!error)
906 this.showObject(result, viewName); 906 this.showObject(result, viewName);
907 } 907 }
908 908
909 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Summa ry ^view"), revealInView.bind(this, "Summary")); 909 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in Summa ry ^view"), revealInView.bind(this, "Summary"));
910 }, 910 },
911 911
912 wasShown: function() 912 wasShown: function()
913 { 913 {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 onattach: function() 1316 onattach: function()
1317 { 1317 {
1318 this.listItemElement.classList.add("profile-launcher-view-tree-item"); 1318 this.listItemElement.classList.add("profile-launcher-view-tree-item");
1319 this.listItemElement.createChild("div", "icon"); 1319 this.listItemElement.createChild("div", "icon");
1320 this.listItemElement.createChild("div", "titles no-subtitle").createChil d("span", "title-container").createChild("span", "title").textContent = WebInspe ctor.UIString("Profiles"); 1320 this.listItemElement.createChild("div", "titles no-subtitle").createChil d("span", "title-container").createChild("span", "title").textContent = WebInspe ctor.UIString("Profiles");
1321 }, 1321 },
1322 1322
1323 __proto__: TreeElement.prototype 1323 __proto__: TreeElement.prototype
1324 } 1324 }
1325 1325
1326 WebInspector.ProfilesPanel.show = function()
1327 {
1328 WebInspector.inspectorView.setCurrentPanel(WebInspector.ProfilesPanel._insta nce());
1329 }
1330
1331 /** 1326 /**
1332 * @return {!WebInspector.ProfilesPanel} 1327 * @return {!WebInspector.ProfilesPanel}
1333 */ 1328 */
1334 WebInspector.ProfilesPanel._instance = function() 1329 WebInspector.ProfilesPanel._instance = function()
1335 { 1330 {
1336 return /** @type {!WebInspector.ProfilesPanel} */ (self.runtime.sharedInstan ce(WebInspector.ProfilesPanel)); 1331 return /** @type {!WebInspector.ProfilesPanel} */ (self.runtime.sharedInstan ce(WebInspector.ProfilesPanel));
1337 } 1332 }
1338 1333
1339 /** 1334 /**
1340 * @constructor 1335 * @constructor
(...skipping 11 matching lines...) Expand all
1352 * @return {boolean} 1347 * @return {boolean}
1353 */ 1348 */
1354 handleAction: function(context, actionId) 1349 handleAction: function(context, actionId)
1355 { 1350 {
1356 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); 1351 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel);
1357 console.assert(panel && panel instanceof WebInspector.ProfilesPanel); 1352 console.assert(panel && panel instanceof WebInspector.ProfilesPanel);
1358 panel.toggleRecord(); 1353 panel.toggleRecord();
1359 return true; 1354 return true;
1360 } 1355 }
1361 } 1356 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698