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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 if (type.hasTemporaryView()) | 573 if (type.hasTemporaryView()) |
574 this.showProfile(type.profileBeingRecorded()); | 574 this.showProfile(type.profileBeingRecorded()); |
575 } else { | 575 } else { |
576 this._launcherView.profileFinished(); | 576 this._launcherView.profileFinished(); |
577 } | 577 } |
578 return true; | 578 return true; |
579 }, | 579 }, |
580 | 580 |
581 _onSuspendStateChanged: function() | 581 _onSuspendStateChanged: function() |
582 { | 582 { |
583 this._updateRecordButton(this.recordButton.toggled); | 583 this._updateRecordButton(this.recordButton.toggled()); |
584 }, | 584 }, |
585 | 585 |
586 /** | 586 /** |
587 * @param {boolean} toggled | 587 * @param {boolean} toggled |
588 */ | 588 */ |
589 _updateRecordButton: function(toggled) | 589 _updateRecordButton: function(toggled) |
590 { | 590 { |
591 var enable = toggled || !WebInspector.targetManager.allTargetsSuspended(
); | 591 var enable = toggled || !WebInspector.targetManager.allTargetsSuspended(
); |
592 this.recordButton.setEnabled(enable); | 592 this.recordButton.setEnabled(enable); |
593 this.recordButton.toggled = toggled; | 593 this.recordButton.setToggled(toggled); |
594 if (enable) | 594 if (enable) |
595 this.recordButton.title = this._selectedProfileType ? this._selected
ProfileType.buttonTooltip : ""; | 595 this.recordButton.setTitle(this._selectedProfileType ? this._selecte
dProfileType.buttonTooltip : ""); |
596 else | 596 else |
597 this.recordButton.title = WebInspector.anotherProfilerActiveLabel(); | 597 this.recordButton.setTitle(WebInspector.anotherProfilerActiveLabel()
); |
598 if (this._selectedProfileType) | 598 if (this._selectedProfileType) |
599 this._launcherView.updateProfileType(this._selectedProfileType, enab
le); | 599 this._launcherView.updateProfileType(this._selectedProfileType, enab
le); |
600 }, | 600 }, |
601 | 601 |
602 _profileBeingRecordedRemoved: function() | 602 _profileBeingRecordedRemoved: function() |
603 { | 603 { |
604 this._updateRecordButton(false); | 604 this._updateRecordButton(false); |
605 this._launcherView.profileFinished(); | 605 this._launcherView.profileFinished(); |
606 }, | 606 }, |
607 | 607 |
608 /** | 608 /** |
609 * @param {!WebInspector.Event} event | 609 * @param {!WebInspector.Event} event |
610 */ | 610 */ |
611 _onProfileTypeSelected: function(event) | 611 _onProfileTypeSelected: function(event) |
612 { | 612 { |
613 this._selectedProfileType = /** @type {!WebInspector.ProfileType} */ (ev
ent.data); | 613 this._selectedProfileType = /** @type {!WebInspector.ProfileType} */ (ev
ent.data); |
614 this._updateProfileTypeSpecificUI(); | 614 this._updateProfileTypeSpecificUI(); |
615 }, | 615 }, |
616 | 616 |
617 _updateProfileTypeSpecificUI: function() | 617 _updateProfileTypeSpecificUI: function() |
618 { | 618 { |
619 this._updateRecordButton(this.recordButton.toggled); | 619 this._updateRecordButton(this.recordButton.toggled()); |
620 this._profileTypeStatusBarItemsContainer.removeChildren(); | 620 this._profileTypeStatusBarItemsContainer.removeChildren(); |
621 var statusBarItems = this._selectedProfileType.statusBarItems; | 621 var statusBarItems = this._selectedProfileType.statusBarItems; |
622 if (statusBarItems) { | 622 if (statusBarItems) { |
623 for (var i = 0; i < statusBarItems.length; ++i) | 623 for (var i = 0; i < statusBarItems.length; ++i) |
624 this._profileTypeStatusBarItemsContainer.appendChild(statusBarIt
ems[i]); | 624 this._profileTypeStatusBarItemsContainer.appendChild(statusBarIt
ems[i]); |
625 } | 625 } |
626 }, | 626 }, |
627 | 627 |
628 _reset: function() | 628 _reset: function() |
629 { | 629 { |
(...skipping 10 matching lines...) Expand all Loading... |
640 this._launcherView.profileFinished(); | 640 this._launcherView.profileFinished(); |
641 | 641 |
642 this.sidebarTree.element.classList.remove("some-expandable"); | 642 this.sidebarTree.element.classList.remove("some-expandable"); |
643 | 643 |
644 this._launcherView.detach(); | 644 this._launcherView.detach(); |
645 this.profileViews.removeChildren(); | 645 this.profileViews.removeChildren(); |
646 this._profileViewStatusBarItemsContainer.removeChildren(); | 646 this._profileViewStatusBarItemsContainer.removeChildren(); |
647 | 647 |
648 this.removeAllListeners(); | 648 this.removeAllListeners(); |
649 | 649 |
650 this.recordButton.visible = true; | 650 this.recordButton.setVisible(true); |
651 this._profileViewStatusBarItemsContainer.classList.remove("hidden"); | 651 this._profileViewStatusBarItemsContainer.classList.remove("hidden"); |
652 this.clearResultsButton.element.classList.remove("hidden"); | 652 this.clearResultsButton.element.classList.remove("hidden"); |
653 this.profilesItemTreeElement.select(); | 653 this.profilesItemTreeElement.select(); |
654 this._showLauncherView(); | 654 this._showLauncherView(); |
655 }, | 655 }, |
656 | 656 |
657 _showLauncherView: function() | 657 _showLauncherView: function() |
658 { | 658 { |
659 this.closeVisibleView(); | 659 this.closeVisibleView(); |
660 this._profileViewStatusBarItemsContainer.removeChildren(); | 660 this._profileViewStatusBarItemsContainer.removeChildren(); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 | 1253 |
1254 WebInspector.ProfilesPanelFactory.prototype = { | 1254 WebInspector.ProfilesPanelFactory.prototype = { |
1255 /** | 1255 /** |
1256 * @return {!WebInspector.Panel} | 1256 * @return {!WebInspector.Panel} |
1257 */ | 1257 */ |
1258 createPanel: function() | 1258 createPanel: function() |
1259 { | 1259 { |
1260 return WebInspector.ProfilesPanel._instance(); | 1260 return WebInspector.ProfilesPanel._instance(); |
1261 } | 1261 } |
1262 } | 1262 } |
OLD | NEW |