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

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

Issue 203433002: DevTools: Reuse _showSourceLocation for execution line changes handling in sources panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined and fixed highlighting after execution line changes Created 6 years, 9 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 { 535 {
536 return WebInspector.experimentsSettings.showEditorInDrawer.isEnabled() & & WebInspector.settings.showEditorInDrawer.get() && WebInspector.inspectorView.i sDrawerEditorShown(); 536 return WebInspector.experimentsSettings.showEditorInDrawer.isEnabled() & & WebInspector.settings.showEditorInDrawer.get() && WebInspector.inspectorView.i sDrawerEditorShown();
537 }, 537 },
538 538
539 /** 539 /**
540 * @param {!WebInspector.UISourceCode} uiSourceCode 540 * @param {!WebInspector.UISourceCode} uiSourceCode
541 * @param {number=} lineNumber 541 * @param {number=} lineNumber
542 * @param {number=} columnNumber 542 * @param {number=} columnNumber
543 * @param {boolean=} forceShowInPanel 543 * @param {boolean=} forceShowInPanel
544 * @param {boolean=} omitFocus 544 * @param {boolean=} omitFocus
545 * @param {boolean=} omitHighlight
545 */ 546 */
546 _showSourceLocation: function(uiSourceCode, lineNumber, columnNumber, forceS howInPanel, omitFocus) 547 _showSourceLocation: function(uiSourceCode, lineNumber, columnNumber, forceS howInPanel, omitFocus, omitHighlight)
547 { 548 {
548 this._showEditor(forceShowInPanel); 549 this._showEditor(forceShowInPanel);
549 this._historyManager.updateCurrentState(); 550 this._historyManager.updateCurrentState();
550 var sourceFrame = this._showFile(uiSourceCode); 551 var sourceFrame = this._showFile(uiSourceCode);
551 if (typeof lineNumber === "number") 552 if (typeof lineNumber === "number")
552 sourceFrame.highlightPosition(lineNumber, columnNumber); 553 sourceFrame.revealPosition(lineNumber, columnNumber, !omitHighlight) ;
553 this._historyManager.pushNewState(); 554 this._historyManager.pushNewState();
554 if (!omitFocus) 555 if (!omitFocus)
555 sourceFrame.focus(); 556 sourceFrame.focus();
556 WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMet rics.UserAction, { 557 WebInspector.notifications.dispatchEventToListeners(WebInspector.UserMet rics.UserAction, {
557 action: WebInspector.UserMetrics.UserActionNames.OpenSourceLink, 558 action: WebInspector.UserMetrics.UserActionNames.OpenSourceLink,
558 url: uiSourceCode.originURL(), 559 url: uiSourceCode.originURL(),
559 lineNumber: lineNumber 560 lineNumber: lineNumber
560 }); 561 });
561 }, 562 },
562 563
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 { 708 {
708 this._historyManager.updateCurrentState(); 709 this._historyManager.updateCurrentState();
709 this._clearCurrentExecutionLine(); 710 this._clearCurrentExecutionLine();
710 this._setExecutionLine(uiLocation); 711 this._setExecutionLine(uiLocation);
711 712
712 var uiSourceCode = uiLocation.uiSourceCode; 713 var uiSourceCode = uiLocation.uiSourceCode;
713 var scriptFile = this._currentUISourceCode ? this._currentUISourceCode.s criptFile() : null; 714 var scriptFile = this._currentUISourceCode ? this._currentUISourceCode.s criptFile() : null;
714 if (this._skipExecutionLineRevealing) 715 if (this._skipExecutionLineRevealing)
715 return; 716 return;
716 this._skipExecutionLineRevealing = true; 717 this._skipExecutionLineRevealing = true;
717 718 this._showSourceLocation(uiSourceCode, uiLocation.lineNumber, 0, undefin ed, undefined, true);
718 var sourceFrame = this._showFile(uiSourceCode);
719 sourceFrame.revealPosition(uiLocation.lineNumber);
720 this._historyManager.pushNewState();
721
722 if (sourceFrame.canEditSource())
723 sourceFrame.setSelection(WebInspector.TextRange.createFromLocation(u iLocation.lineNumber, 0));
724 sourceFrame.focus();
725 }, 719 },
726 720
727 _callFrameSelected: function(event) 721 _callFrameSelected: function(event)
728 { 722 {
729 var callFrame = event.data; 723 var callFrame = event.data;
730 724
731 if (!callFrame) 725 if (!callFrame)
732 return; 726 return;
733 727
734 this.sidebarPanes.scopechain.update(callFrame); 728 this.sidebarPanes.scopechain.update(callFrame);
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 { 1716 {
1723 } 1717 }
1724 1718
1725 WebInspector.SourcesPanel.EditorAction.prototype = { 1719 WebInspector.SourcesPanel.EditorAction.prototype = {
1726 /** 1720 /**
1727 * @param {!WebInspector.SourcesPanel} panel 1721 * @param {!WebInspector.SourcesPanel} panel
1728 * @return {!Element} 1722 * @return {!Element}
1729 */ 1723 */
1730 button: function(panel) { } 1724 button: function(panel) { }
1731 } 1725 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/CodeMirrorTextEditor.js ('k') | Source/devtools/front_end/cm/cmdevtools.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698