| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 this.editorView.enableShowModeSaving(); | 62 this.editorView.enableShowModeSaving(); |
| 63 this.editorView.element.tabIndex = 0; | 63 this.editorView.element.tabIndex = 0; |
| 64 this._splitWidget.setMainWidget(this.editorView); | 64 this._splitWidget.setMainWidget(this.editorView); |
| 65 | 65 |
| 66 // Create navigator tabbed pane with toolbar. | 66 // Create navigator tabbed pane with toolbar. |
| 67 this._navigatorTabbedLocation = WebInspector.viewManager.createTabbedLocatio
n(this._revealNavigatorSidebar.bind(this), "navigator-view", true); | 67 this._navigatorTabbedLocation = WebInspector.viewManager.createTabbedLocatio
n(this._revealNavigatorSidebar.bind(this), "navigator-view", true); |
| 68 var tabbedPane = this._navigatorTabbedLocation.tabbedPane(); | 68 var tabbedPane = this._navigatorTabbedLocation.tabbedPane(); |
| 69 tabbedPane.setMinimumSize(100, 25); | 69 tabbedPane.setMinimumSize(100, 25); |
| 70 tabbedPane.setShrinkableTabs(true); | 70 tabbedPane.setShrinkableTabs(true); |
| 71 tabbedPane.element.classList.add("navigator-tabbed-pane"); | 71 tabbedPane.element.classList.add("navigator-tabbed-pane"); |
| 72 var navigatorToolbar = new WebInspector.Toolbar(""); | |
| 73 var navigatorMenuButton = new WebInspector.ToolbarMenuButton(this._populateN
avigatorMenu.bind(this), true); | 72 var navigatorMenuButton = new WebInspector.ToolbarMenuButton(this._populateN
avigatorMenu.bind(this), true); |
| 74 navigatorMenuButton.setTitle(WebInspector.UIString("More options")); | 73 navigatorMenuButton.setTitle(WebInspector.UIString("More options")); |
| 75 navigatorToolbar.appendToolbarItem(navigatorMenuButton); | 74 tabbedPane.rightToolbar().appendToolbarItem(navigatorMenuButton); |
| 76 tabbedPane.appendAfterTabStrip(navigatorToolbar.element); | |
| 77 this.editorView.setSidebarWidget(tabbedPane); | 75 this.editorView.setSidebarWidget(tabbedPane); |
| 78 | 76 |
| 79 this._sourcesView = new WebInspector.SourcesView(); | 77 this._sourcesView = new WebInspector.SourcesView(); |
| 80 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); | 78 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); |
| 81 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); | 79 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); |
| 82 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); | 80 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); |
| 83 this.editorView.setMainWidget(this._sourcesView); | 81 this.editorView.setMainWidget(this._sourcesView); |
| 84 this._editorChanged(this._sourcesView.currentUISourceCode()); | 82 this._editorChanged(this._sourcesView.currentUISourceCode()); |
| 85 | 83 |
| 86 this._threadsSidebarPane = null; | 84 this._threadsSidebarPane = null; |
| 87 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie
wManager.view("sources.watch")); | 85 this._watchSidebarPane = /** @type {!WebInspector.View} */ (WebInspector.vie
wManager.view("sources.watch")); |
| 88 // TODO: Force installing listeners from the model, not the UI. | 86 // TODO: Force installing listeners from the model, not the UI. |
| 89 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); | 87 self.runtime.sharedInstance(WebInspector.XHRBreakpointsSidebarPane); |
| 90 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide
barPane); | 88 this._callstackPane = self.runtime.sharedInstance(WebInspector.CallStackSide
barPane); |
| 91 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this)); | 89 this._callstackPane.registerShortcuts(this.registerShortcuts.bind(this)); |
| 92 | 90 |
| 93 this._installDebuggerSidebarController(); | 91 this._sourcesView.leftToolbar().appendToolbarItem(this.editorView.createShow
HideSidebarButton("navigator")); |
| 92 this._toggleDebuggerSidebarButton = this._splitWidget.createShowHideSidebarB
utton("debugger"); |
| 93 this._sourcesView.rightToolbar().appendToolbarItem(this._toggleDebuggerSideb
arButton); |
| 94 | 94 |
| 95 WebInspector.moduleSetting("sidebarPosition").addChangeListener(this._update
SidebarPosition.bind(this)); | 95 WebInspector.moduleSetting("sidebarPosition").addChangeListener(this._update
SidebarPosition.bind(this)); |
| 96 this._updateSidebarPosition(); | 96 this._updateSidebarPosition(); |
| 97 | 97 |
| 98 this._updateDebuggerButtons(); | 98 this._updateDebuggerButtons(); |
| 99 this._pauseOnExceptionEnabledChanged(); | 99 this._pauseOnExceptionEnabledChanged(); |
| 100 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this
._pauseOnExceptionEnabledChanged, this); | 100 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this
._pauseOnExceptionEnabledChanged, this); |
| 101 | 101 |
| 102 this._liveLocationPool = new WebInspector.LiveLocationPool(); | 102 this._liveLocationPool = new WebInspector.LiveLocationPool(); |
| 103 | 103 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return; | 152 return; |
| 153 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); | 153 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); |
| 154 if (!debuggerModel) | 154 if (!debuggerModel) |
| 155 return; | 155 return; |
| 156 | 156 |
| 157 if (debuggerModel.isPaused()) { | 157 if (debuggerModel.isPaused()) { |
| 158 this._showDebuggerPausedDetails(/** @type {!WebInspector.DebuggerPau
sedDetails} */ (debuggerModel.debuggerPausedDetails())); | 158 this._showDebuggerPausedDetails(/** @type {!WebInspector.DebuggerPau
sedDetails} */ (debuggerModel.debuggerPausedDetails())); |
| 159 } else { | 159 } else { |
| 160 this._paused = false; | 160 this._paused = false; |
| 161 this._clearInterface(); | 161 this._clearInterface(); |
| 162 this._toggleDebuggerSidebarButton.disabled = false; | 162 this._toggleDebuggerSidebarButton.setEnabled(true); |
| 163 } | 163 } |
| 164 }, | 164 }, |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * @param {!WebInspector.Event} event | 167 * @param {!WebInspector.Event} event |
| 168 */ | 168 */ |
| 169 _onCurrentTargetChanged: function(event) | 169 _onCurrentTargetChanged: function(event) |
| 170 { | 170 { |
| 171 var target = /** @type {?WebInspector.Target} */ (event.data); | 171 var target = /** @type {?WebInspector.Target} */ (event.data); |
| 172 this._setTarget(target); | 172 this._setTarget(target); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 }, | 256 }, |
| 257 | 257 |
| 258 /** | 258 /** |
| 259 * @param {!WebInspector.DebuggerPausedDetails} details | 259 * @param {!WebInspector.DebuggerPausedDetails} details |
| 260 */ | 260 */ |
| 261 _showDebuggerPausedDetails: function(details) | 261 _showDebuggerPausedDetails: function(details) |
| 262 { | 262 { |
| 263 this._paused = true; | 263 this._paused = true; |
| 264 this._updateDebuggerButtons(); | 264 this._updateDebuggerButtons(); |
| 265 WebInspector.context.setFlavor(WebInspector.DebuggerPausedDetails, detai
ls); | 265 WebInspector.context.setFlavor(WebInspector.DebuggerPausedDetails, detai
ls); |
| 266 this._toggleDebuggerSidebarButton.disabled = true; | 266 this._toggleDebuggerSidebarButton.setEnabled(false); |
| 267 window.focus(); | 267 window.focus(); |
| 268 InspectorFrontendHost.bringToFront(); | 268 InspectorFrontendHost.bringToFront(); |
| 269 }, | 269 }, |
| 270 | 270 |
| 271 /** | 271 /** |
| 272 * @param {!WebInspector.Event} event | 272 * @param {!WebInspector.Event} event |
| 273 */ | 273 */ |
| 274 _debuggerResumed: function(event) | 274 _debuggerResumed: function(event) |
| 275 { | 275 { |
| 276 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.t
arget); | 276 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.t
arget); |
| 277 var target = debuggerModel.target(); | 277 var target = debuggerModel.target(); |
| 278 if (WebInspector.context.flavor(WebInspector.Target) !== target) | 278 if (WebInspector.context.flavor(WebInspector.Target) !== target) |
| 279 return; | 279 return; |
| 280 this._paused = false; | 280 this._paused = false; |
| 281 this._clearInterface(); | 281 this._clearInterface(); |
| 282 this._toggleDebuggerSidebarButton.disabled = false; | 282 this._toggleDebuggerSidebarButton.setEnabled(true); |
| 283 this._switchToPausedTargetTimeout = setTimeout(this._switchToPausedTarge
t.bind(this, debuggerModel), 500); | 283 this._switchToPausedTargetTimeout = setTimeout(this._switchToPausedTarge
t.bind(this, debuggerModel), 500); |
| 284 }, | 284 }, |
| 285 | 285 |
| 286 /** | 286 /** |
| 287 * @param {!WebInspector.Event} event | 287 * @param {!WebInspector.Event} event |
| 288 */ | 288 */ |
| 289 _debuggerWasEnabled: function(event) | 289 _debuggerWasEnabled: function(event) |
| 290 { | 290 { |
| 291 var target = /** @type {!WebInspector.Target} */ (event.target.target()
); | 291 var target = /** @type {!WebInspector.Target} */ (event.target.target()
); |
| 292 if (WebInspector.context.flavor(WebInspector.Target) !== target) | 292 if (WebInspector.context.flavor(WebInspector.Target) !== target) |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 { | 707 { |
| 708 var debugToolbarDrawer = createElementWithClass("div", "scripts-debug-to
olbar-drawer"); | 708 var debugToolbarDrawer = createElementWithClass("div", "scripts-debug-to
olbar-drawer"); |
| 709 | 709 |
| 710 var label = WebInspector.UIString("Pause On Caught Exceptions"); | 710 var label = WebInspector.UIString("Pause On Caught Exceptions"); |
| 711 var setting = WebInspector.moduleSetting("pauseOnCaughtException"); | 711 var setting = WebInspector.moduleSetting("pauseOnCaughtException"); |
| 712 debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(label, setting, true)); | 712 debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(label, setting, true)); |
| 713 | 713 |
| 714 return debugToolbarDrawer; | 714 return debugToolbarDrawer; |
| 715 }, | 715 }, |
| 716 | 716 |
| 717 _installDebuggerSidebarController: function() | |
| 718 { | |
| 719 this.editorView.displayShowHideSidebarButton("navigator"); | |
| 720 this._toggleDebuggerSidebarButton = this._splitWidget.displayShowHideSid
ebarButton("debugger", "scripts-debugger-show-hide-button"); | |
| 721 }, | |
| 722 | |
| 723 /** | 717 /** |
| 724 * @param {!WebInspector.UISourceCode} uiSourceCode | 718 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 725 */ | 719 */ |
| 726 _showLocalHistory: function(uiSourceCode) | 720 _showLocalHistory: function(uiSourceCode) |
| 727 { | 721 { |
| 728 WebInspector.RevisionHistoryView.showHistory(uiSourceCode); | 722 WebInspector.RevisionHistoryView.showHistory(uiSourceCode); |
| 729 }, | 723 }, |
| 730 | 724 |
| 731 /** | 725 /** |
| 732 * @override | 726 * @override |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 __proto__: WebInspector.VBox.prototype | 1361 __proto__: WebInspector.VBox.prototype |
| 1368 } | 1362 } |
| 1369 | 1363 |
| 1370 /** | 1364 /** |
| 1371 * @return {boolean} | 1365 * @return {boolean} |
| 1372 */ | 1366 */ |
| 1373 WebInspector.SourcesPanel.WrapperView.isShowing = function() | 1367 WebInspector.SourcesPanel.WrapperView.isShowing = function() |
| 1374 { | 1368 { |
| 1375 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); | 1369 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); |
| 1376 } | 1370 } |
| OLD | NEW |