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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 _updateStatus(event) { | 634 _updateStatus(event) { |
635 var statusUpdate = event.data; | 635 var statusUpdate = event.data; |
636 if (statusUpdate.subtitle !== null) { | 636 if (statusUpdate.subtitle !== null) { |
637 this._subtitleElement.textContent = statusUpdate.subtitle || ''; | 637 this._subtitleElement.textContent = statusUpdate.subtitle || ''; |
638 this._titlesElement.classList.toggle('no-subtitle', !statusUpdate.subtitle
); | 638 this._titlesElement.classList.toggle('no-subtitle', !statusUpdate.subtitle
); |
639 } | 639 } |
640 if (typeof statusUpdate.wait === 'boolean' && this.listItemElement) | 640 if (typeof statusUpdate.wait === 'boolean' && this.listItemElement) |
641 this.listItemElement.classList.toggle('wait', statusUpdate.wait); | 641 this.listItemElement.classList.toggle('wait', statusUpdate.wait); |
642 } | 642 } |
643 | 643 |
| 644 /** |
| 645 * @override |
| 646 * @param {!Event} event |
| 647 * @return {boolean} |
| 648 */ |
| 649 ondblclick(event) { |
| 650 if (!this._editing) |
| 651 this._startEditing(/** @type {!Element} */ (event.target)); |
| 652 return false; |
| 653 } |
| 654 |
| 655 /** |
| 656 * @param {!Element} eventTarget |
| 657 */ |
| 658 _startEditing(eventTarget) { |
| 659 var container = eventTarget.enclosingNodeOrSelfWithClass('title'); |
| 660 if (!container) |
| 661 return; |
| 662 var config = new UI.InplaceEditor.Config(this._editingCommitted.bind(this),
this._editingCancelled.bind(this)); |
| 663 this._editing = UI.InplaceEditor.startEditing(container, config); |
| 664 } |
| 665 |
| 666 /** |
| 667 * @param {!Element} container |
| 668 * @param {string} newTitle |
| 669 */ |
| 670 _editingCommitted(container, newTitle) { |
| 671 delete this._editing; |
| 672 this.profile.setTitle(newTitle); |
| 673 } |
| 674 |
| 675 _editingCancelled() { |
| 676 delete this._editing; |
| 677 } |
| 678 |
644 dispose() { | 679 dispose() { |
645 this.profile.removeEventListener(Profiler.ProfileHeader.Events.UpdateStatus,
this._updateStatus, this); | 680 this.profile.removeEventListener(Profiler.ProfileHeader.Events.UpdateStatus,
this._updateStatus, this); |
646 this.profile.removeEventListener(Profiler.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); | 681 this.profile.removeEventListener(Profiler.ProfileHeader.Events.ProfileReceiv
ed, this._onProfileReceived, this); |
647 } | 682 } |
648 | 683 |
649 /** | 684 /** |
650 * @override | 685 * @override |
651 * @return {boolean} | 686 * @return {boolean} |
652 */ | 687 */ |
653 onselect() { | 688 onselect() { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 * @param {string} actionId | 850 * @param {string} actionId |
816 * @return {boolean} | 851 * @return {boolean} |
817 */ | 852 */ |
818 handleAction(context, actionId) { | 853 handleAction(context, actionId) { |
819 var panel = UI.context.flavor(Profiler.JSProfilerPanel); | 854 var panel = UI.context.flavor(Profiler.JSProfilerPanel); |
820 console.assert(panel && panel instanceof Profiler.JSProfilerPanel); | 855 console.assert(panel && panel instanceof Profiler.JSProfilerPanel); |
821 panel.toggleRecord(); | 856 panel.toggleRecord(); |
822 return true; | 857 return true; |
823 } | 858 } |
824 }; | 859 }; |
OLD | NEW |