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

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unnecessary line was removed Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 this._stackView = new WebInspector.StackView(false); 116 this._stackView = new WebInspector.StackView(false);
117 this._stackView.show(this._searchableView.element); 117 this._stackView.show(this._searchableView.element);
118 this._stackView.element.classList.add("timeline-view-stack"); 118 this._stackView.element.classList.add("timeline-view-stack");
119 119
120 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this)); 120 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this));
121 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this)); 121 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this));
122 this._dockSideChanged(); 122 this._dockSideChanged();
123 123
124 this._onModeChanged(); 124 this._onModeChanged();
125 this._detailsSplitView.show(this.element); 125 this._detailsSplitView.show(this.element);
126 WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.State Changed, this._onProfilingStateChanged, this); 126 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this);
127 } 127 }
128 128
129 WebInspector.TimelinePanel.OverviewMode = { 129 WebInspector.TimelinePanel.OverviewMode = {
130 Events: "Events", 130 Events: "Events",
131 Frames: "Frames" 131 Frames: "Frames"
132 }; 132 };
133 133
134 // Define row and header height, should be in sync with styles for timeline grap hs. 134 // Define row and header height, should be in sync with styles for timeline grap hs.
135 WebInspector.TimelinePanel.rowHeight = 18; 135 WebInspector.TimelinePanel.rowHeight = 18;
136 WebInspector.TimelinePanel.headerHeight = 20; 136 WebInspector.TimelinePanel.headerHeight = 20;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 /** 629 /**
630 * @param {boolean} enabled 630 * @param {boolean} enabled
631 */ 631 */
632 _setUIControlsEnabled: function(enabled) { 632 _setUIControlsEnabled: function(enabled) {
633 function handler(uiControl) 633 function handler(uiControl)
634 { 634 {
635 uiControl.checkbox.disabled = !enabled; 635 uiControl.checkbox.disabled = !enabled;
636 uiControl.label.classList.toggle("dimmed", !enabled); 636 uiControl.label.classList.toggle("dimmed", !enabled);
637 } 637 }
638 this._recordingOptionUIControls.forEach(handler); 638 this._recordingOptionUIControls.forEach(handler);
639 WebInspector.inspectorView.setCurrentPanelLocked(!enabled);
640 }, 639 },
641 640
642 /** 641 /**
643 * @param {boolean} userInitiated 642 * @param {boolean} userInitiated
644 */ 643 */
645 _startRecording: function(userInitiated) 644 _startRecording: function(userInitiated)
646 { 645 {
647 this._userInitiatedRecording = userInitiated; 646 this._userInitiatedRecording = userInitiated;
648 var enableJSSampling = this._enableJSSamplingSettingSetting && this._ena bleJSSamplingSettingSetting.get(); 647 var enableJSSampling = this._enableJSSamplingSettingSetting && this._ena bleJSSamplingSettingSetting.get();
649 this._model.startRecording(this._captureCausesSetting.get(), enableJSSam pling, this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting & & this._captureLayersAndPicturesSetting.get()); 648 this._model.startRecording(this._captureCausesSetting.get(), enableJSSam pling, this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting & & this._captureLayersAndPicturesSetting.get());
(...skipping 15 matching lines...) Expand all
665 this._userInitiatedRecording = false; 664 this._userInitiatedRecording = false;
666 this._model.stopRecording(); 665 this._model.stopRecording();
667 if (this._progressElement) 666 if (this._progressElement)
668 this._updateProgress(WebInspector.UIString("Retrieving events\u2026" )); 667 this._updateProgress(WebInspector.UIString("Retrieving events\u2026" ));
669 668
670 for (var i = 0; i < this._overviewControls.length; ++i) 669 for (var i = 0; i < this._overviewControls.length; ++i)
671 this._overviewControls[i].timelineStopped(); 670 this._overviewControls[i].timelineStopped();
672 this._setUIControlsEnabled(true); 671 this._setUIControlsEnabled(true);
673 }, 672 },
674 673
675 _onProfilingStateChanged: function() 674 _onSuspendStateChanged: function()
676 { 675 {
677 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); 676 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled);
678 }, 677 },
679 678
680 /** 679 /**
681 * @param {boolean} toggled 680 * @param {boolean} toggled
682 */ 681 */
683 _updateToggleTimelineButton: function(toggled) 682 _updateToggleTimelineButton: function(toggled)
684 { 683 {
685 var isAcquiredInSomeTarget = WebInspector.profilingLock().isAcquired();
686 this.toggleTimelineButton.toggled = toggled; 684 this.toggleTimelineButton.toggled = toggled;
687 if (toggled) { 685 if (toggled) {
688 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); 686 this.toggleTimelineButton.title = WebInspector.UIString("Stop");
689 this.toggleTimelineButton.setEnabled(true); 687 this.toggleTimelineButton.setEnabled(true);
690 } else if (this._stopPending) { 688 } else if (this._stopPending) {
691 this.toggleTimelineButton.title = WebInspector.UIString("Stop pendin g"); 689 this.toggleTimelineButton.title = WebInspector.UIString("Stop pendin g");
692 this.toggleTimelineButton.setEnabled(false); 690 this.toggleTimelineButton.setEnabled(false);
693 } else if (isAcquiredInSomeTarget) { 691 } else if (WebInspector.targetManager.allTargetsSuspended()) {
694 this.toggleTimelineButton.title = WebInspector.anotherProfilerActive Label(); 692 this.toggleTimelineButton.title = WebInspector.anotherProfilerActive Label();
695 this.toggleTimelineButton.setEnabled(false); 693 this.toggleTimelineButton.setEnabled(false);
696 } else { 694 } else {
697 this.toggleTimelineButton.title = WebInspector.UIString("Record"); 695 this.toggleTimelineButton.title = WebInspector.UIString("Record");
698 this.toggleTimelineButton.setEnabled(true); 696 this.toggleTimelineButton.setEnabled(true);
699 } 697 }
700 }, 698 },
701 699
702 /** 700 /**
703 * @return {boolean} 701 * @return {boolean}
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 1461
1464 WebInspector.TimelinePanelFactory.prototype = { 1462 WebInspector.TimelinePanelFactory.prototype = {
1465 /** 1463 /**
1466 * @return {!WebInspector.Panel} 1464 * @return {!WebInspector.Panel}
1467 */ 1465 */
1468 createPanel: function() 1466 createPanel: function()
1469 { 1467 {
1470 return WebInspector.TimelinePanel._instance(); 1468 return WebInspector.TimelinePanel._instance();
1471 } 1469 }
1472 } 1470 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698