Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); | 77 WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); |
| 78 | 78 |
| 79 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel")); | 79 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel")); |
| 80 this.debugToolbar = this._createDebugToolbar(); | 80 this.debugToolbar = this._createDebugToolbar(); |
| 81 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); | 81 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); |
| 82 this.threadsToolbar = new WebInspector.ThreadsToolbar(); | 82 this.threadsToolbar = new WebInspector.ThreadsToolbar(); |
| 83 | 83 |
| 84 const initialDebugSidebarWidth = 225; | 84 const initialDebugSidebarWidth = 225; |
| 85 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth); | 85 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth); |
| 86 this._splitView.enableShowModeSaving(); | 86 this._splitView.enableShowModeSaving(); |
| 87 this._splitView.setMainElementConstraints(200, 25); | |
| 88 this._splitView.setSidebarElementConstraints(WebInspector.SourcesPanel.minTo olbarWidth, 25); | |
| 89 | |
| 90 this._splitView.show(this.element); | 87 this._splitView.show(this.element); |
| 91 | 88 |
| 92 // Create scripts navigator | 89 // Create scripts navigator |
| 93 const initialNavigatorWidth = 225; | 90 const initialNavigatorWidth = 225; |
| 94 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth); | 91 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth); |
| 95 this.editorView.enableShowModeSaving(); | 92 this.editorView.enableShowModeSaving(); |
| 96 this.editorView.element.id = "scripts-editor-split-view"; | 93 this.editorView.element.id = "scripts-editor-split-view"; |
| 97 this.editorView.element.tabIndex = 0; | 94 this.editorView.element.tabIndex = 0; |
| 98 | |
| 99 this.editorView.setSidebarElementConstraints(Preferences.minSidebarWidth); | |
| 100 this.editorView.setMainElementConstraints(50, 50); | |
| 101 this.editorView.show(this._splitView.mainElement()); | 95 this.editorView.show(this._splitView.mainElement()); |
| 102 | 96 |
| 103 this._navigator = new WebInspector.SourcesNavigator(); | 97 this._navigator = new WebInspector.SourcesNavigator(); |
| 98 this._navigator.view.setMinimumSize(Preferences.minSidebarWidth); | |
|
pfeldman
2014/03/14 06:23:10
Why did this compile?
dgozman
2014/03/14 15:55:15
No idea.
| |
| 104 this._navigator.view.show(this.editorView.sidebarElement()); | 99 this._navigator.view.show(this.editorView.sidebarElement()); |
| 105 | 100 |
| 106 var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIStri ng("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a fil e"); | 101 var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIStri ng("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a fil e"); |
| 107 | 102 |
| 108 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); | 103 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); |
| 109 this.sourcesView = new WebInspector.SourcesView(); | 104 this.sourcesView = new WebInspector.SourcesView(); |
| 110 this.sourcesView.show(this._drawerEditorView.element); | 105 this.sourcesView.show(this._drawerEditorView.element); |
| 111 | 106 |
| 112 this._searchableView = new WebInspector.SearchableView(this); | 107 this._searchableView = new WebInspector.SearchableView(this); |
| 113 this._searchableView.setMinimalSearchQuerySize(0); | 108 this._searchableView.setMinimalSearchQuerySize(0); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 return; | 226 return; |
| 232 | 227 |
| 233 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost."); | 228 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost."); |
| 234 WebInspector.inspectorView.showPanel("sources"); | 229 WebInspector.inspectorView.showPanel("sources"); |
| 235 for (var i = 0; i < unsavedSourceCodes.length; ++i) | 230 for (var i = 0; i < unsavedSourceCodes.length; ++i) |
| 236 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]); | 231 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]); |
| 237 } | 232 } |
| 238 window.addEventListener("beforeunload", handleBeforeUnload.bind(this), true) ; | 233 window.addEventListener("beforeunload", handleBeforeUnload.bind(this), true) ; |
| 239 } | 234 } |
| 240 | 235 |
| 241 WebInspector.SourcesPanel.minToolbarWidth = 215; | 236 WebInspector.SourcesPanel.minToolbarWidth = 185; |
| 242 | 237 |
| 243 WebInspector.SourcesPanel.Events = { | 238 WebInspector.SourcesPanel.Events = { |
| 244 EditorClosed: "EditorClosed", | 239 EditorClosed: "EditorClosed", |
| 245 EditorSelected: "EditorSelected", | 240 EditorSelected: "EditorSelected", |
| 246 } | 241 } |
| 247 | 242 |
| 248 WebInspector.SourcesPanel.prototype = { | 243 WebInspector.SourcesPanel.prototype = { |
| 249 /** | 244 /** |
| 250 * @param {?Event=} event | 245 * @param {?Event=} event |
| 251 */ | 246 */ |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1583 if (!vertically) | 1578 if (!vertically) |
| 1584 this._splitView.uninstallResizer(this._statusBarContainerElement); | 1579 this._splitView.uninstallResizer(this._statusBarContainerElement); |
| 1585 else | 1580 else |
| 1586 this._splitView.installResizer(this._statusBarContainerElement); | 1581 this._splitView.installResizer(this._statusBarContainerElement); |
| 1587 | 1582 |
| 1588 // Create vertical box with stack. | 1583 // Create vertical box with stack. |
| 1589 var vbox = new WebInspector.VBox(); | 1584 var vbox = new WebInspector.VBox(); |
| 1590 vbox.element.appendChild(this._debugToolbarDrawer); | 1585 vbox.element.appendChild(this._debugToolbarDrawer); |
| 1591 vbox.element.appendChild(this.debugToolbar); | 1586 vbox.element.appendChild(this.debugToolbar); |
| 1592 vbox.element.appendChild(this.threadsToolbar.element); | 1587 vbox.element.appendChild(this.threadsToolbar.element); |
| 1588 vbox.setMinimumSize(new Size(WebInspector.SourcesPanel.minToolbarWidth, 25)); | |
| 1593 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 1589 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
| 1594 sidebarPaneStack.element.classList.add("flex-auto"); | 1590 sidebarPaneStack.element.classList.add("flex-auto"); |
| 1595 sidebarPaneStack.show(vbox.element); | 1591 sidebarPaneStack.show(vbox.element); |
| 1596 | 1592 |
| 1597 if (!vertically) { | 1593 if (!vertically) { |
| 1598 // Populate the only stack. | 1594 // Populate the only stack. |
| 1599 for (var pane in this.sidebarPanes) | 1595 for (var pane in this.sidebarPanes) |
| 1600 sidebarPaneStack.addPane(this.sidebarPanes[pane]); | 1596 sidebarPaneStack.addPane(this.sidebarPanes[pane]); |
| 1601 this._extensionSidebarPanesContainer = sidebarPaneStack; | 1597 this._extensionSidebarPanesContainer = sidebarPaneStack; |
| 1602 | 1598 |
| 1603 this.sidebarPaneView = vbox; | 1599 this.sidebarPaneView = vbox; |
| 1604 } else { | 1600 } else { |
| 1605 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5); | 1601 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5); |
| 1606 splitView.setMainElementConstraints(WebInspector.SourcesPanel.minToo lbarWidth, 25); | |
| 1607 vbox.show(splitView.mainElement()); | 1602 vbox.show(splitView.mainElement()); |
| 1608 | 1603 |
| 1609 // Populate the left stack. | 1604 // Populate the left stack. |
| 1610 sidebarPaneStack.addPane(this.sidebarPanes.callstack); | 1605 sidebarPaneStack.addPane(this.sidebarPanes.callstack); |
| 1611 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); | 1606 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); |
| 1612 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); | 1607 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); |
| 1613 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); | 1608 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); |
| 1614 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ; | 1609 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ; |
| 1615 if (this.sidebarPanes.workerList) | 1610 if (this.sidebarPanes.workerList) |
| 1616 sidebarPaneStack.addPane(this.sidebarPanes.workerList); | 1611 sidebarPaneStack.addPane(this.sidebarPanes.workerList); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1679 __proto__: WebInspector.Panel.prototype | 1674 __proto__: WebInspector.Panel.prototype |
| 1680 } | 1675 } |
| 1681 | 1676 |
| 1682 /** | 1677 /** |
| 1683 * @constructor | 1678 * @constructor |
| 1684 * @extends {WebInspector.VBox} | 1679 * @extends {WebInspector.VBox} |
| 1685 */ | 1680 */ |
| 1686 WebInspector.SourcesView = function() | 1681 WebInspector.SourcesView = function() |
| 1687 { | 1682 { |
| 1688 WebInspector.VBox.call(this); | 1683 WebInspector.VBox.call(this); |
| 1684 this.setMinimumSize(new Size(50, 50)); | |
| 1689 this.registerRequiredCSS("sourcesView.css"); | 1685 this.registerRequiredCSS("sourcesView.css"); |
| 1690 this.element.id = "sources-panel-sources-view"; | 1686 this.element.id = "sources-panel-sources-view"; |
| 1691 this.element.addEventListener("dragenter", this._onDragEnter.bind(this), tru e); | 1687 this.element.addEventListener("dragenter", this._onDragEnter.bind(this), tru e); |
| 1692 this.element.addEventListener("dragover", this._onDragOver.bind(this), true) ; | 1688 this.element.addEventListener("dragover", this._onDragOver.bind(this), true) ; |
| 1693 } | 1689 } |
| 1694 | 1690 |
| 1695 WebInspector.SourcesView.dragAndDropFilesType = "Files"; | 1691 WebInspector.SourcesView.dragAndDropFilesType = "Files"; |
| 1696 | 1692 |
| 1697 WebInspector.SourcesView.prototype = { | 1693 WebInspector.SourcesView.prototype = { |
| 1698 _onDragEnter: function (event) | 1694 _onDragEnter: function (event) |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1847 { | 1843 { |
| 1848 } | 1844 } |
| 1849 | 1845 |
| 1850 WebInspector.SourcesPanel.EditorAction.prototype = { | 1846 WebInspector.SourcesPanel.EditorAction.prototype = { |
| 1851 /** | 1847 /** |
| 1852 * @param {!WebInspector.SourcesPanel} panel | 1848 * @param {!WebInspector.SourcesPanel} panel |
| 1853 * @return {!Element} | 1849 * @return {!Element} |
| 1854 */ | 1850 */ |
| 1855 button: function(panel) { } | 1851 button: function(panel) { } |
| 1856 } | 1852 } |
| OLD | NEW |