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

Side by Side Diff: Source/devtools/front_end/sources/SourcesPanel.js

Issue 311193002: DevTools: Implement debugger pause-resume through an action (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comment Created 6 years, 6 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) 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 */ 191 */
192 _drawerEditor: function() 192 _drawerEditor: function()
193 { 193 {
194 var drawerEditorInstance = WebInspector.moduleManager.instance(WebInspec tor.DrawerEditor); 194 var drawerEditorInstance = WebInspector.moduleManager.instance(WebInspec tor.DrawerEditor);
195 console.assert(drawerEditorInstance instanceof WebInspector.SourcesPanel .DrawerEditor, "WebInspector.DrawerEditor module instance does not use WebInspec tor.SourcesPanel.DrawerEditor as an implementation. "); 195 console.assert(drawerEditorInstance instanceof WebInspector.SourcesPanel .DrawerEditor, "WebInspector.DrawerEditor module instance does not use WebInspec tor.SourcesPanel.DrawerEditor as an implementation. ");
196 return /** @type {!WebInspector.SourcesPanel.DrawerEditor} */ (drawerEdi torInstance); 196 return /** @type {!WebInspector.SourcesPanel.DrawerEditor} */ (drawerEdi torInstance);
197 }, 197 },
198 198
199 wasShown: function() 199 wasShown: function()
200 { 200 {
201 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
201 if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) { 202 if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
202 this._drawerEditor()._panelWasShown(); 203 this._drawerEditor()._panelWasShown();
203 this._sourcesView.show(this.editorView.mainElement()); 204 this._sourcesView.show(this.editorView.mainElement());
204 } 205 }
205 WebInspector.Panel.prototype.wasShown.call(this); 206 WebInspector.Panel.prototype.wasShown.call(this);
206 }, 207 },
207 208
208 willHide: function() 209 willHide: function()
209 { 210 {
210 WebInspector.Panel.prototype.willHide.call(this); 211 WebInspector.Panel.prototype.willHide.call(this);
211 if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) { 212 if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
212 this._drawerEditor()._panelWillHide(); 213 this._drawerEditor()._panelWillHide();
213 this._sourcesView.show(this._drawerEditorView.element); 214 this._sourcesView.show(this._drawerEditorView.element);
214 } 215 }
216 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
215 }, 217 },
216 218
217 /** 219 /**
218 * @return {!WebInspector.SearchableView} 220 * @return {!WebInspector.SearchableView}
219 */ 221 */
220 searchableView: function() 222 searchableView: function()
221 { 223 {
222 return this._sourcesView.searchableView(); 224 return this._sourcesView.searchableView();
223 }, 225 },
224 226
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.C trlOrMeta; 666 var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.C trlOrMeta;
665 667
666 // Run snippet. 668 // Run snippet.
667 title = WebInspector.UIString("Run snippet (%s)."); 669 title = WebInspector.UIString("Run snippet (%s).");
668 handler = this._runSnippet.bind(this); 670 handler = this._runSnippet.bind(this);
669 this._runSnippetButton = this._createButtonAndRegisterShortcuts("scripts -run-snippet", title, handler, WebInspector.ShortcutsScreen.SourcesPanelShortcut s.RunSnippet); 671 this._runSnippetButton = this._createButtonAndRegisterShortcuts("scripts -run-snippet", title, handler, WebInspector.ShortcutsScreen.SourcesPanelShortcut s.RunSnippet);
670 debugToolbar.appendChild(this._runSnippetButton.element); 672 debugToolbar.appendChild(this._runSnippetButton.element);
671 this._runSnippetButton.element.classList.add("hidden"); 673 this._runSnippetButton.element.classList.add("hidden");
672 674
673 // Continue. 675 // Continue.
674 handler = this.togglePause.bind(this); 676 handler = function() { return WebInspector.actionRegistry.execute("debug ger.toggle-pause"); };
675 this._pauseButton = this._createButtonAndRegisterShortcuts("scripts-paus e", "", handler, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PauseContinu e); 677 this._pauseButton = this._createButtonAndRegisterShortcuts("scripts-paus e", "", handler, []);
676 debugToolbar.appendChild(this._pauseButton.element); 678 debugToolbar.appendChild(this._pauseButton.element);
677 679
678 // Long resume. 680 // Long resume.
679 title = WebInspector.UIString("Resume with all pauses blocked for 500 ms "); 681 title = WebInspector.UIString("Resume with all pauses blocked for 500 ms ");
680 this._longResumeButton = new WebInspector.StatusBarButton(title, "script s-long-resume"); 682 this._longResumeButton = new WebInspector.StatusBarButton(title, "script s-long-resume");
681 this._longResumeButton.addEventListener("click", this._longResume.bind(t his), this); 683 this._longResumeButton.addEventListener("click", this._longResume.bind(t his), this);
682 684
683 // Step over. 685 // Step over.
684 title = WebInspector.UIString("Step over next function call (%s)."); 686 title = WebInspector.UIString("Step over next function call (%s).");
685 handler = this._stepOverClicked.bind(this); 687 handler = this._stepOverClicked.bind(this);
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 var disabled = forbidden || (status === "disabled"); 1390 var disabled = forbidden || (status === "disabled");
1389 1391
1390 this._disableJSInfo.classList.toggle("hidden", !forbidden); 1392 this._disableJSInfo.classList.toggle("hidden", !forbidden);
1391 this._disableJSCheckbox.checked = disabled; 1393 this._disableJSCheckbox.checked = disabled;
1392 this._disableJSCheckbox.disabled = forbidden; 1394 this._disableJSCheckbox.disabled = forbidden;
1393 } 1395 }
1394 }, 1396 },
1395 1397
1396 __proto__: WebInspector.UISettingDelegate.prototype 1398 __proto__: WebInspector.UISettingDelegate.prototype
1397 } 1399 }
1400
1401 /**
1402 * @constructor
1403 * @implements {WebInspector.ActionDelegate}
1404 */
1405 WebInspector.SourcesPanel.TogglePauseActionDelegate = function()
1406 {
1407 }
1408
1409 WebInspector.SourcesPanel.TogglePauseActionDelegate.prototype = {
1410 /**
1411 * @return {boolean}
1412 */
1413 handleAction: function()
1414 {
1415 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).togglePause();
1416 return true;
1417 }
1418 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ForwardedInputEventHandler.js ('k') | Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698