OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google 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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 this.sidebarPanes = {}; | 69 this.sidebarPanes = {}; |
70 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); | 70 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); |
71 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); | 71 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); |
72 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); | 72 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); |
73 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); | 73 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); |
74 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.RevealHiddenCallFrames, this._hiddenCallFramesRevealedInSidebar.bind(t
his)); | 74 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.RevealHiddenCallFrames, this._hiddenCallFramesRevealedInSidebar.bind(t
his)); |
75 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th
is)); | 75 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th
is)); |
76 | 76 |
77 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); | 77 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); |
78 if (Runtime.experiments.isEnabled("serviceWorkersInPageFrontend")) | 78 this.sidebarPanes.serviceWorkers = new WebInspector.ServiceWorkersSidebarPan
e(); |
79 this.sidebarPanes.serviceWorkers = new WebInspector.ServiceWorkersSideba
rPane(); | |
80 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide
barPane(WebInspector.breakpointManager, this.showUISourceCode.bind(this)); | 79 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide
barPane(WebInspector.breakpointManager, this.showUISourceCode.bind(this)); |
81 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr
eateProxy(this); | 80 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr
eateProxy(this); |
82 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPan
e(); | 81 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPan
e(); |
83 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerB
reakpointsSidebarPane(); | 82 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerB
reakpointsSidebarPane(); |
84 this.sidebarPanes.objectEventListeners = new WebInspector.ObjectEventListene
rsSidebarPane(); | 83 this.sidebarPanes.objectEventListeners = new WebInspector.ObjectEventListene
rsSidebarPane(); |
85 if (Runtime.experiments.isEnabled("stepIntoAsync")) | 84 if (Runtime.experiments.isEnabled("stepIntoAsync")) |
86 this.sidebarPanes.asyncOperationBreakpoints = new WebInspector.AsyncOper
ationsSidebarPane(); | 85 this.sidebarPanes.asyncOperationBreakpoints = new WebInspector.AsyncOper
ationsSidebarPane(); |
87 | 86 |
88 this._lastSelectedTabSetting = WebInspector.settings.createLocalSetting("las
tSelectedSourcesSidebarPaneTab", this.sidebarPanes.scopechain.title()); | 87 this._lastSelectedTabSetting = WebInspector.settings.createLocalSetting("las
tSelectedSourcesSidebarPaneTab", this.sidebarPanes.scopechain.title()); |
89 | 88 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 _updateDebuggerButtons: function() | 437 _updateDebuggerButtons: function() |
439 { | 438 { |
440 var currentTarget = WebInspector.context.flavor(WebInspector.Target); | 439 var currentTarget = WebInspector.context.flavor(WebInspector.Target); |
441 var currentDebuggerModel = WebInspector.DebuggerModel.fromTarget(current
Target); | 440 var currentDebuggerModel = WebInspector.DebuggerModel.fromTarget(current
Target); |
442 if (!currentDebuggerModel) { | 441 if (!currentDebuggerModel) { |
443 this._pauseButton.setEnabled(false); | 442 this._pauseButton.setEnabled(false); |
444 this._stepOverButton.setEnabled(false); | 443 this._stepOverButton.setEnabled(false); |
445 this._stepIntoButton.setEnabled(false); | 444 this._stepIntoButton.setEnabled(false); |
446 this._stepOutButton.setEnabled(false); | 445 this._stepOutButton.setEnabled(false); |
447 } else if (this._paused) { | 446 } else if (this._paused) { |
448 this._updateButtonTitle(this._pauseButton, WebInspector.UIString("Re
sume script execution")); | 447 this._pauseButton.setTitle(WebInspector.UIString("Resume script exec
ution")); |
449 this._pauseButton.setToggled(true); | 448 this._pauseButton.setToggled(true); |
450 this._pauseButton.setLongClickOptionsEnabled((function() { return [
this._longResumeButton ]; }).bind(this)); | 449 this._pauseButton.setLongClickOptionsEnabled((function() { return [
this._longResumeButton ]; }).bind(this)); |
451 | 450 |
452 this._pauseButton.setEnabled(true); | 451 this._pauseButton.setEnabled(true); |
453 this._stepOverButton.setEnabled(true); | 452 this._stepOverButton.setEnabled(true); |
454 this._stepIntoButton.setEnabled(true); | 453 this._stepIntoButton.setEnabled(true); |
455 this._stepOutButton.setEnabled(true); | 454 this._stepOutButton.setEnabled(true); |
456 } else { | 455 } else { |
457 this._updateButtonTitle(this._pauseButton, WebInspector.UIString("Pa
use script execution")); | 456 this._pauseButton.setTitle(WebInspector.UIString("Pause script execu
tion")); |
458 this._pauseButton.setToggled(false); | 457 this._pauseButton.setToggled(false); |
459 this._pauseButton.setLongClickOptionsEnabled(null); | 458 this._pauseButton.setLongClickOptionsEnabled(null); |
460 | 459 |
461 this._pauseButton.setEnabled(!currentDebuggerModel.isPausing()); | 460 this._pauseButton.setEnabled(!currentDebuggerModel.isPausing()); |
462 this._stepOverButton.setEnabled(false); | 461 this._stepOverButton.setEnabled(false); |
463 this._stepIntoButton.setEnabled(false); | 462 this._stepIntoButton.setEnabled(false); |
464 this._stepOutButton.setEnabled(false); | 463 this._stepOutButton.setEnabled(false); |
465 } | 464 } |
466 }, | 465 }, |
467 | 466 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 var debugToolbarDrawer = createElementWithClass("div", "scripts-debug-to
olbar-drawer"); | 776 var debugToolbarDrawer = createElementWithClass("div", "scripts-debug-to
olbar-drawer"); |
778 | 777 |
779 var label = WebInspector.UIString("Pause On Caught Exceptions"); | 778 var label = WebInspector.UIString("Pause On Caught Exceptions"); |
780 var setting = WebInspector.moduleSetting("pauseOnCaughtException"); | 779 var setting = WebInspector.moduleSetting("pauseOnCaughtException"); |
781 debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(label, setting, true)); | 780 debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(label, setting, true)); |
782 | 781 |
783 return debugToolbarDrawer; | 782 return debugToolbarDrawer; |
784 }, | 783 }, |
785 | 784 |
786 /** | 785 /** |
787 * @param {!WebInspector.ToolbarButton} button | |
788 * @param {string} buttonTitle | |
789 */ | |
790 _updateButtonTitle: function(button, buttonTitle) | |
791 { | |
792 var hasShortcuts = button._shortcuts && button._shortcuts.length; | |
793 if (hasShortcuts && Runtime.experiments.isEnabled("tooltips")) | |
794 button.setTitle(buttonTitle); | |
795 else if (hasShortcuts) | |
796 button.setTitle(WebInspector.UIString(buttonTitle + " (%s)", button.
_shortcuts[0].name)); | |
797 else | |
798 button.setTitle(buttonTitle); | |
799 }, | |
800 | |
801 /** | |
802 * @param {string} buttonId | 786 * @param {string} buttonId |
803 * @param {string} buttonTitle | 787 * @param {string} buttonTitle |
804 * @param {string} actionId | 788 * @param {string} actionId |
805 * @return {!WebInspector.ToolbarButton} | 789 * @return {!WebInspector.ToolbarButton} |
806 */ | 790 */ |
807 _createButtonAndRegisterShortcutsForAction: function(buttonId, buttonTitle,
actionId) | 791 _createButtonAndRegisterShortcutsForAction: function(buttonId, buttonTitle,
actionId) |
808 { | 792 { |
809 var button = new WebInspector.ToolbarButton(buttonTitle, buttonId); | 793 var button = new WebInspector.ToolbarButton(buttonTitle, buttonId); |
810 button.setAction(actionId); | 794 button.setAction(actionId); |
811 button._shortcuts = WebInspector.shortcutRegistry.shortcutDescriptorsFor
Action(actionId); | 795 button._shortcuts = WebInspector.shortcutRegistry.shortcutDescriptorsFor
Action(actionId); |
812 this._updateButtonTitle(button, buttonTitle); | 796 button.setTitle(buttonTitle); |
813 return button; | 797 return button; |
814 }, | 798 }, |
815 | 799 |
816 addToWatch: function(expression) | 800 addToWatch: function(expression) |
817 { | 801 { |
818 this.sidebarPanes.watchExpressions.addExpression(expression); | 802 this.sidebarPanes.watchExpressions.addExpression(expression); |
819 }, | 803 }, |
820 | 804 |
821 _installDebuggerSidebarController: function() | 805 _installDebuggerSidebarController: function() |
822 { | 806 { |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 WebInspector.SourcesPanelFactory.prototype = { | 1448 WebInspector.SourcesPanelFactory.prototype = { |
1465 /** | 1449 /** |
1466 * @override | 1450 * @override |
1467 * @return {!WebInspector.Panel} | 1451 * @return {!WebInspector.Panel} |
1468 */ | 1452 */ |
1469 createPanel: function() | 1453 createPanel: function() |
1470 { | 1454 { |
1471 return WebInspector.SourcesPanel.instance(); | 1455 return WebInspector.SourcesPanel.instance(); |
1472 } | 1456 } |
1473 } | 1457 } |
OLD | NEW |