OLD | NEW |
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 /** | 281 /** |
282 * @interface | 282 * @interface |
283 */ | 283 */ |
284 WebInspector.ProfileType.DataDisplayDelegate = function() | 284 WebInspector.ProfileType.DataDisplayDelegate = function() |
285 { | 285 { |
286 } | 286 } |
287 | 287 |
288 WebInspector.ProfileType.DataDisplayDelegate.prototype = { | 288 WebInspector.ProfileType.DataDisplayDelegate.prototype = { |
289 /** | 289 /** |
290 * @param {?WebInspector.ProfileHeader} profile | 290 * @param {?WebInspector.ProfileHeader} profile |
291 * @return {?WebInspector.View} | 291 * @return {?WebInspector.Widget} |
292 */ | 292 */ |
293 showProfile: function(profile) { }, | 293 showProfile: function(profile) { }, |
294 | 294 |
295 /** | 295 /** |
296 * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId | 296 * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId |
297 * @param {string} perspectiveName | 297 * @param {string} perspectiveName |
298 */ | 298 */ |
299 showObject: function(snapshotObjectId, perspectiveName) { } | 299 showObject: function(snapshotObjectId, perspectiveName) { } |
300 } | 300 } |
301 | 301 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e | 364 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
365 * @return {!WebInspector.ProfileSidebarTreeElement} | 365 * @return {!WebInspector.ProfileSidebarTreeElement} |
366 */ | 366 */ |
367 createSidebarTreeElement: function(dataDisplayDelegate) | 367 createSidebarTreeElement: function(dataDisplayDelegate) |
368 { | 368 { |
369 throw new Error("Needs implemented."); | 369 throw new Error("Needs implemented."); |
370 }, | 370 }, |
371 | 371 |
372 /** | 372 /** |
373 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e | 373 * @param {!WebInspector.ProfileType.DataDisplayDelegate} dataDisplayDelegat
e |
374 * @return {!WebInspector.View} | 374 * @return {!WebInspector.Widget} |
375 */ | 375 */ |
376 createView: function(dataDisplayDelegate) | 376 createView: function(dataDisplayDelegate) |
377 { | 377 { |
378 throw new Error("Not implemented."); | 378 throw new Error("Not implemented."); |
379 }, | 379 }, |
380 | 380 |
381 removeTempFile: function() | 381 removeTempFile: function() |
382 { | 382 { |
383 if (this._tempFile) | 383 if (this._tempFile) |
384 this._tempFile.remove(); | 384 this._tempFile.remove(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 * @extends {WebInspector.PanelWithSidebar} | 431 * @extends {WebInspector.PanelWithSidebar} |
432 */ | 432 */ |
433 WebInspector.ProfilesPanel = function() | 433 WebInspector.ProfilesPanel = function() |
434 { | 434 { |
435 WebInspector.PanelWithSidebar.call(this, "profiles"); | 435 WebInspector.PanelWithSidebar.call(this, "profiles"); |
436 this.registerRequiredCSS("ui/panelEnablerView.css"); | 436 this.registerRequiredCSS("ui/panelEnablerView.css"); |
437 this.registerRequiredCSS("profiler/heapProfiler.css"); | 437 this.registerRequiredCSS("profiler/heapProfiler.css"); |
438 this.registerRequiredCSS("profiler/profilesPanel.css"); | 438 this.registerRequiredCSS("profiler/profilesPanel.css"); |
439 this.registerRequiredCSS("components/objectValue.css"); | 439 this.registerRequiredCSS("components/objectValue.css"); |
440 | 440 |
441 var mainView = new WebInspector.VBox(); | 441 var mainContainer = new WebInspector.VBox(); |
442 this.splitView().setMainView(mainView); | 442 this.splitWidget().setMainWidget(mainContainer); |
443 | 443 |
444 this.profilesItemTreeElement = new WebInspector.ProfilesSidebarTreeElement(t
his); | 444 this.profilesItemTreeElement = new WebInspector.ProfilesSidebarTreeElement(t
his); |
445 | 445 |
446 this._sidebarTree = new TreeOutline(); | 446 this._sidebarTree = new TreeOutline(); |
447 this._sidebarTree.element.classList.add("sidebar-tree"); | 447 this._sidebarTree.element.classList.add("sidebar-tree"); |
448 this.panelSidebarElement().appendChild(this._sidebarTree.element); | 448 this.panelSidebarElement().appendChild(this._sidebarTree.element); |
449 this.setDefaultFocusedElement(this._sidebarTree.element); | 449 this.setDefaultFocusedElement(this._sidebarTree.element); |
450 | 450 |
451 this._sidebarTree.appendChild(this.profilesItemTreeElement); | 451 this._sidebarTree.appendChild(this.profilesItemTreeElement); |
452 | 452 |
453 this.profileViews = createElement("div"); | 453 this.profileViews = createElement("div"); |
454 this.profileViews.id = "profile-views"; | 454 this.profileViews.id = "profile-views"; |
455 this.profileViews.classList.add("vbox"); | 455 this.profileViews.classList.add("vbox"); |
456 mainView.element.appendChild(this.profileViews); | 456 mainContainer.element.appendChild(this.profileViews); |
457 | 457 |
458 this._toolbarElement = createElementWithClass("div", "profiles-toolbar"); | 458 this._toolbarElement = createElementWithClass("div", "profiles-toolbar"); |
459 mainView.element.insertBefore(this._toolbarElement, mainView.element.firstCh
ild); | 459 mainContainer.element.insertBefore(this._toolbarElement, mainContainer.eleme
nt.firstChild); |
460 | 460 |
461 this.panelSidebarElement().classList.add("profiles-sidebar-tree-box"); | 461 this.panelSidebarElement().classList.add("profiles-sidebar-tree-box"); |
462 var toolbarContainerLeft = createElementWithClass("div", "profiles-toolbar")
; | 462 var toolbarContainerLeft = createElementWithClass("div", "profiles-toolbar")
; |
463 this.panelSidebarElement().insertBefore(toolbarContainerLeft, this.panelSide
barElement().firstChild); | 463 this.panelSidebarElement().insertBefore(toolbarContainerLeft, this.panelSide
barElement().firstChild); |
464 var toolbar = new WebInspector.Toolbar(toolbarContainerLeft); | 464 var toolbar = new WebInspector.Toolbar(toolbarContainerLeft); |
465 | 465 |
466 this.recordButton = new WebInspector.ToolbarButton("", "record-toolbar-item"
); | 466 this.recordButton = new WebInspector.ToolbarButton("", "record-toolbar-item"
); |
467 this.recordButton.addEventListener("click", this.toggleRecordButton, this); | 467 this.recordButton.addEventListener("click", this.toggleRecordButton, this); |
468 toolbar.appendToolbarItem(this.recordButton); | 468 toolbar.appendToolbarItem(this.recordButton); |
469 | 469 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 // make sure that view gets cleared when the last profile is removed. | 772 // make sure that view gets cleared when the last profile is removed. |
773 if (sectionIsEmpty) { | 773 if (sectionIsEmpty) { |
774 this.profilesItemTreeElement.select(); | 774 this.profilesItemTreeElement.select(); |
775 this._showLauncherView(); | 775 this._showLauncherView(); |
776 } | 776 } |
777 }, | 777 }, |
778 | 778 |
779 /** | 779 /** |
780 * @override | 780 * @override |
781 * @param {?WebInspector.ProfileHeader} profile | 781 * @param {?WebInspector.ProfileHeader} profile |
782 * @return {?WebInspector.View} | 782 * @return {?WebInspector.Widget} |
783 */ | 783 */ |
784 showProfile: function(profile) | 784 showProfile: function(profile) |
785 { | 785 { |
786 if (!profile || (profile.profileType().profileBeingRecorded() === profil
e) && !profile.profileType().hasTemporaryView()) | 786 if (!profile || (profile.profileType().profileBeingRecorded() === profil
e) && !profile.profileType().hasTemporaryView()) |
787 return null; | 787 return null; |
788 | 788 |
789 var view = this._viewForProfile(profile); | 789 var view = this._viewForProfile(profile); |
790 if (view === this.visibleView) | 790 if (view === this.visibleView) |
791 return view; | 791 return view; |
792 | 792 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 this.showProfile(profile); | 825 this.showProfile(profile); |
826 var view = this._viewForProfile(profile); | 826 var view = this._viewForProfile(profile); |
827 view.selectLiveObject(perspectiveName, snapshotObjectId); | 827 view.selectLiveObject(perspectiveName, snapshotObjectId); |
828 break; | 828 break; |
829 } | 829 } |
830 } | 830 } |
831 }, | 831 }, |
832 | 832 |
833 /** | 833 /** |
834 * @param {!WebInspector.ProfileHeader} profile | 834 * @param {!WebInspector.ProfileHeader} profile |
835 * @return {!WebInspector.View} | 835 * @return {!WebInspector.Widget} |
836 */ | 836 */ |
837 _viewForProfile: function(profile) | 837 _viewForProfile: function(profile) |
838 { | 838 { |
839 var index = this._indexOfViewForProfile(profile); | 839 var index = this._indexOfViewForProfile(profile); |
840 if (index !== -1) | 840 if (index !== -1) |
841 return this._profileToView[index].view; | 841 return this._profileToView[index].view; |
842 var view = profile.createView(this); | 842 var view = profile.createView(this); |
843 view.element.classList.add("profile-view"); | 843 view.element.classList.add("profile-view"); |
844 this._profileToView.push({ profile: profile, view: view}); | 844 this._profileToView.push({ profile: profile, view: view}); |
845 return view; | 845 return view; |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 WebInspector.ProfilesPanelFactory.prototype = { | 1261 WebInspector.ProfilesPanelFactory.prototype = { |
1262 /** | 1262 /** |
1263 * @override | 1263 * @override |
1264 * @return {!WebInspector.Panel} | 1264 * @return {!WebInspector.Panel} |
1265 */ | 1265 */ |
1266 createPanel: function() | 1266 createPanel: function() |
1267 { | 1267 { |
1268 return WebInspector.ProfilesPanel._instance(); | 1268 return WebInspector.ProfilesPanel._instance(); |
1269 } | 1269 } |
1270 } | 1270 } |
OLD | NEW |