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

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

Issue 77283005: DevTools: refactor outline dialogs to run callback on item selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 */ 1191 */
1192 _showOutlineDialog: function(event) 1192 _showOutlineDialog: function(event)
1193 { 1193 {
1194 var uiSourceCode = this._editorContainer.currentFile(); 1194 var uiSourceCode = this._editorContainer.currentFile();
1195 if (!uiSourceCode) 1195 if (!uiSourceCode)
1196 return false; 1196 return false;
1197 1197
1198 switch (uiSourceCode.contentType()) { 1198 switch (uiSourceCode.contentType()) {
1199 case WebInspector.resourceTypes.Document: 1199 case WebInspector.resourceTypes.Document:
1200 case WebInspector.resourceTypes.Script: 1200 case WebInspector.resourceTypes.Script:
1201 WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSource Code); 1201 WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSource Code, this.highlightPosition.bind(this));
1202 return true; 1202 return true;
1203 case WebInspector.resourceTypes.Stylesheet: 1203 case WebInspector.resourceTypes.Stylesheet:
1204 WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSource Code); 1204 WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSource Code, this.highlightPosition.bind(this));
1205 return true; 1205 return true;
1206 } 1206 }
1207 return false; 1207 return false;
1208 }, 1208 },
1209 1209
1210 _installDebuggerSidebarController: function() 1210 _installDebuggerSidebarController: function()
1211 { 1211 {
1212 this._toggleDebuggerSidebarButton = new WebInspector.StatusBarButton("", "right-sidebar-show-hide-button scripts-debugger-show-hide-button", 3); 1212 this._toggleDebuggerSidebarButton = new WebInspector.StatusBarButton("", "right-sidebar-show-hide-button scripts-debugger-show-hide-button", 3);
1213 this._toggleDebuggerSidebarButton.addEventListener("click", clickHandler , this); 1213 this._toggleDebuggerSidebarButton.addEventListener("click", clickHandler , this);
1214 this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.el ement); 1214 this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.el ement);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 this.sidebarPaneView.show(this.splitView.sidebarElement); 1538 this.sidebarPaneView.show(this.splitView.sidebarElement);
1539 1539
1540 this.sidebarPanes.scopechain.expand(); 1540 this.sidebarPanes.scopechain.expand();
1541 this.sidebarPanes.jsBreakpoints.expand(); 1541 this.sidebarPanes.jsBreakpoints.expand();
1542 this.sidebarPanes.callstack.expand(); 1542 this.sidebarPanes.callstack.expand();
1543 1543
1544 if (WebInspector.settings.watchExpressions.get().length > 0) 1544 if (WebInspector.settings.watchExpressions.get().length > 0)
1545 this.sidebarPanes.watchExpressions.expand(); 1545 this.sidebarPanes.watchExpressions.expand();
1546 }, 1546 },
1547 1547
1548 canHighlightPosition: function()
1549 {
1550 return this.visibleView && this.visibleView.canHighlightPosition();
1551 },
1552
1553 /**
1554 * @param {number} line
1555 * @param {number=} column
1556 */
1557 highlightPosition: function(line, column)
1558 {
1559 if (!this.canHighlightPosition())
1560 return;
1561 this.visibleView.highlightPosition(line, column);
1562 },
1563
1548 /** 1564 /**
1549 * @param {string} id 1565 * @param {string} id
1550 * @param {WebInspector.SidebarPane} pane 1566 * @param {WebInspector.SidebarPane} pane
1551 */ 1567 */
1552 addExtensionSidebarPane: function(id, pane) 1568 addExtensionSidebarPane: function(id, pane)
1553 { 1569 {
1554 this._extensionSidebarPanes.push(pane); 1570 this._extensionSidebarPanes.push(pane);
1555 this._extensionSidebarPanesContainer.addPane(pane); 1571 this._extensionSidebarPanesContainer.addPane(pane);
1556 this.setHideOnDetach(); 1572 this.setHideOnDetach();
1557 }, 1573 },
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 WebInspector.DrawerEditorView = function() 1653 WebInspector.DrawerEditorView = function()
1638 { 1654 {
1639 WebInspector.View.call(this); 1655 WebInspector.View.call(this);
1640 this.element.id = "drawer-editor-view"; 1656 this.element.id = "drawer-editor-view";
1641 this.element.addStyleClass("vbox"); 1657 this.element.addStyleClass("vbox");
1642 } 1658 }
1643 1659
1644 WebInspector.DrawerEditorView.prototype = { 1660 WebInspector.DrawerEditorView.prototype = {
1645 __proto__: WebInspector.View.prototype 1661 __proto__: WebInspector.View.prototype
1646 } 1662 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/FilteredItemSelectionDialog.js ('k') | Source/devtools/front_end/StyleSheetOutlineDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698