| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return this._navigatorTabbedLocation; | 213 return this._navigatorTabbedLocation; |
| 214 }, | 214 }, |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * @return {boolean} | 217 * @return {boolean} |
| 218 */ | 218 */ |
| 219 _ensureSourcesViewVisible: function() | 219 _ensureSourcesViewVisible: function() |
| 220 { | 220 { |
| 221 if (WebInspector.SourcesPanel.WrapperView.isShowing()) | 221 if (WebInspector.SourcesPanel.WrapperView.isShowing()) |
| 222 return true; | 222 return true; |
| 223 return this === WebInspector.inspectorView.setCurrentPanel(this); | 223 if (!WebInspector.inspectorView.canSelectPanel("sources")) |
| 224 return false; |
| 225 WebInspector.viewManager.showView("sources"); |
| 226 return true; |
| 224 }, | 227 }, |
| 225 | 228 |
| 226 onResize: function() | 229 onResize: function() |
| 227 { | 230 { |
| 228 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") | 231 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") |
| 229 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. | 232 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. |
| 230 }, | 233 }, |
| 231 | 234 |
| 232 /** | 235 /** |
| 233 * @override | 236 * @override |
| 234 * @return {!WebInspector.SearchableView} | 237 * @return {!WebInspector.SearchableView} |
| 235 */ | 238 */ |
| 236 searchableView: function() | 239 searchableView: function() |
| 237 { | 240 { |
| 238 return this._sourcesView.searchableView(); | 241 return this._sourcesView.searchableView(); |
| 239 }, | 242 }, |
| 240 | 243 |
| 241 /** | 244 /** |
| 242 * @param {!WebInspector.Event} event | 245 * @param {!WebInspector.Event} event |
| 243 */ | 246 */ |
| 244 _debuggerPaused: function(event) | 247 _debuggerPaused: function(event) |
| 245 { | 248 { |
| 246 var details = /** @type {!WebInspector.DebuggerPausedDetails} */ (event.
data); | 249 var details = /** @type {!WebInspector.DebuggerPausedDetails} */ (event.
data); |
| 247 if (!this._paused) | 250 if (!this._paused) |
| 248 WebInspector.inspectorView.setCurrentPanel(this); | 251 this._setAsCurrentPanel(); |
| 249 | 252 |
| 250 if (WebInspector.context.flavor(WebInspector.Target) === details.target(
)) | 253 if (WebInspector.context.flavor(WebInspector.Target) === details.target(
)) |
| 251 this._showDebuggerPausedDetails(details); | 254 this._showDebuggerPausedDetails(details); |
| 252 else if (!this._paused) | 255 else if (!this._paused) |
| 253 WebInspector.context.setFlavor(WebInspector.Target, details.target()
); | 256 WebInspector.context.setFlavor(WebInspector.Target, details.target()
); |
| 254 }, | 257 }, |
| 255 | 258 |
| 256 /** | 259 /** |
| 257 * @param {!WebInspector.DebuggerPausedDetails} details | 260 * @param {!WebInspector.DebuggerPausedDetails} details |
| 258 */ | 261 */ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } else { | 327 } else { |
| 325 this._showEditor(); | 328 this._showEditor(); |
| 326 } | 329 } |
| 327 this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNum
ber, omitFocus); | 330 this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNum
ber, omitFocus); |
| 328 }, | 331 }, |
| 329 | 332 |
| 330 _showEditor: function() | 333 _showEditor: function() |
| 331 { | 334 { |
| 332 if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sour
cesPanel.WrapperView._instance.isShowing()) | 335 if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sour
cesPanel.WrapperView._instance.isShowing()) |
| 333 return; | 336 return; |
| 334 WebInspector.inspectorView.setCurrentPanel(this); | 337 this._setAsCurrentPanel(); |
| 335 }, | 338 }, |
| 336 | 339 |
| 337 /** | 340 /** |
| 338 * @param {!WebInspector.UILocation} uiLocation | 341 * @param {!WebInspector.UILocation} uiLocation |
| 339 * @param {boolean=} omitFocus | 342 * @param {boolean=} omitFocus |
| 340 */ | 343 */ |
| 341 showUILocation: function(uiLocation, omitFocus) | 344 showUILocation: function(uiLocation, omitFocus) |
| 342 { | 345 { |
| 343 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui
Location.columnNumber, omitFocus); | 346 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui
Location.columnNumber, omitFocus); |
| 344 }, | 347 }, |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 } | 1089 } |
| 1087 | 1090 |
| 1088 this._sidebarPaneStack.appendApplicableItems("sources-sidebar"); | 1091 this._sidebarPaneStack.appendApplicableItems("sources-sidebar"); |
| 1089 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); | 1092 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); |
| 1090 for (var i = 0; i < extensionSidebarPanes.length; ++i) | 1093 for (var i = 0; i < extensionSidebarPanes.length; ++i) |
| 1091 this._addExtensionSidebarPane(extensionSidebarPanes[i]); | 1094 this._addExtensionSidebarPane(extensionSidebarPanes[i]); |
| 1092 | 1095 |
| 1093 this._splitWidget.setSidebarWidget(this.sidebarPaneView); | 1096 this._splitWidget.setSidebarWidget(this.sidebarPaneView); |
| 1094 }, | 1097 }, |
| 1095 | 1098 |
| 1099 /** |
| 1100 * @return {!Promise} |
| 1101 */ |
| 1096 _setAsCurrentPanel: function() | 1102 _setAsCurrentPanel: function() |
| 1097 { | 1103 { |
| 1098 WebInspector.inspectorView.setCurrentPanel(this); | 1104 return WebInspector.viewManager.showView("sources"); |
| 1099 }, | 1105 }, |
| 1100 | 1106 |
| 1101 /** | 1107 /** |
| 1102 * @param {!WebInspector.Event} event | 1108 * @param {!WebInspector.Event} event |
| 1103 */ | 1109 */ |
| 1104 _extensionSidebarPaneAdded: function(event) | 1110 _extensionSidebarPaneAdded: function(event) |
| 1105 { | 1111 { |
| 1106 var pane = /** @type {!WebInspector.ExtensionSidebarPane} */ (event.data
); | 1112 var pane = /** @type {!WebInspector.ExtensionSidebarPane} */ (event.data
); |
| 1107 this._addExtensionSidebarPane(pane); | 1113 this._addExtensionSidebarPane(pane); |
| 1108 }, | 1114 }, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 } | 1228 } |
| 1223 | 1229 |
| 1224 WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer.prototype = { | 1230 WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer.prototype = { |
| 1225 /** | 1231 /** |
| 1226 * @override | 1232 * @override |
| 1227 * @param {!Object} object | 1233 * @param {!Object} object |
| 1228 * @return {!Promise} | 1234 * @return {!Promise} |
| 1229 */ | 1235 */ |
| 1230 reveal: function(object) | 1236 reveal: function(object) |
| 1231 { | 1237 { |
| 1232 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.ins
tance()); | 1238 return WebInspector.SourcesPanel.instance()._setAsCurrentPanel(); |
| 1233 return Promise.resolve(); | |
| 1234 } | 1239 } |
| 1235 } | 1240 } |
| 1236 | 1241 |
| 1237 /** | 1242 /** |
| 1238 * @constructor | 1243 * @constructor |
| 1239 * @implements {WebInspector.ActionDelegate} | 1244 * @implements {WebInspector.ActionDelegate} |
| 1240 */ | 1245 */ |
| 1241 WebInspector.SourcesPanel.RevealingActionDelegate = function() {} | 1246 WebInspector.SourcesPanel.RevealingActionDelegate = function() {} |
| 1242 | 1247 |
| 1243 WebInspector.SourcesPanel.RevealingActionDelegate.prototype = { | 1248 WebInspector.SourcesPanel.RevealingActionDelegate.prototype = { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 var executionContext = WebInspector.context.flavor(WebInspector.
ExecutionContext); | 1310 var executionContext = WebInspector.context.flavor(WebInspector.
ExecutionContext); |
| 1306 if (executionContext) | 1311 if (executionContext) |
| 1307 WebInspector.ConsoleModel.evaluateCommandInConsole(execution
Context, text); | 1312 WebInspector.ConsoleModel.evaluateCommandInConsole(execution
Context, text); |
| 1308 } | 1313 } |
| 1309 return true; | 1314 return true; |
| 1310 } | 1315 } |
| 1311 return false; | 1316 return false; |
| 1312 } | 1317 } |
| 1313 } | 1318 } |
| 1314 | 1319 |
| 1315 WebInspector.SourcesPanel.show = function() | |
| 1316 { | |
| 1317 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.instanc
e()); | |
| 1318 } | |
| 1319 | |
| 1320 /** | 1320 /** |
| 1321 * @return {!WebInspector.SourcesPanel} | 1321 * @return {!WebInspector.SourcesPanel} |
| 1322 */ | 1322 */ |
| 1323 WebInspector.SourcesPanel.instance = function() | 1323 WebInspector.SourcesPanel.instance = function() |
| 1324 { | 1324 { |
| 1325 if (WebInspector.SourcesPanel._instance) | 1325 if (WebInspector.SourcesPanel._instance) |
| 1326 return WebInspector.SourcesPanel._instance; | 1326 return WebInspector.SourcesPanel._instance; |
| 1327 return /** @type {!WebInspector.SourcesPanel} */ (self.runtime.sharedInstanc
e(WebInspector.SourcesPanel)); | 1327 return /** @type {!WebInspector.SourcesPanel} */ (self.runtime.sharedInstanc
e(WebInspector.SourcesPanel)); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1357 { | 1357 { |
| 1358 WebInspector.VBox.call(this); | 1358 WebInspector.VBox.call(this); |
| 1359 this.element.classList.add("sources-view-wrapper"); | 1359 this.element.classList.add("sources-view-wrapper"); |
| 1360 WebInspector.SourcesPanel.WrapperView._instance = this; | 1360 WebInspector.SourcesPanel.WrapperView._instance = this; |
| 1361 this._view = WebInspector.SourcesPanel.instance()._sourcesView; | 1361 this._view = WebInspector.SourcesPanel.instance()._sourcesView; |
| 1362 } | 1362 } |
| 1363 | 1363 |
| 1364 WebInspector.SourcesPanel.WrapperView.prototype = { | 1364 WebInspector.SourcesPanel.WrapperView.prototype = { |
| 1365 wasShown: function() | 1365 wasShown: function() |
| 1366 { | 1366 { |
| 1367 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorV
iew.currentPanel().name !== "sources") | 1367 if (!WebInspector.SourcesPanel.instance().isShowing()) |
| 1368 this._showViewInWrapper(); | 1368 this._showViewInWrapper(); |
| 1369 else | 1369 else |
| 1370 WebInspector.inspectorView.setDrawerMinimized(true); | 1370 WebInspector.inspectorView.setDrawerMinimized(true); |
| 1371 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.So
urcesPanel.instance()); | 1371 WebInspector.SourcesPanel.updateResizerAndSidebarButtons(WebInspector.So
urcesPanel.instance()); |
| 1372 }, | 1372 }, |
| 1373 | 1373 |
| 1374 willHide: function() | 1374 willHide: function() |
| 1375 { | 1375 { |
| 1376 WebInspector.inspectorView.setDrawerMinimized(false); | 1376 WebInspector.inspectorView.setDrawerMinimized(false); |
| 1377 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButt
ons(WebInspector.SourcesPanel.instance())); | 1377 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButt
ons(WebInspector.SourcesPanel.instance())); |
| 1378 }, | 1378 }, |
| 1379 | 1379 |
| 1380 _showViewInWrapper: function() | 1380 _showViewInWrapper: function() |
| 1381 { | 1381 { |
| 1382 this._view.show(this.element); | 1382 this._view.show(this.element); |
| 1383 }, | 1383 }, |
| 1384 | 1384 |
| 1385 __proto__: WebInspector.VBox.prototype | 1385 __proto__: WebInspector.VBox.prototype |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 /** | 1388 /** |
| 1389 * @return {boolean} | 1389 * @return {boolean} |
| 1390 */ | 1390 */ |
| 1391 WebInspector.SourcesPanel.WrapperView.isShowing = function() | 1391 WebInspector.SourcesPanel.WrapperView.isShowing = function() |
| 1392 { | 1392 { |
| 1393 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); | 1393 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou
rcesPanel.WrapperView._instance.isShowing(); |
| 1394 } | 1394 } |
| OLD | NEW |