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 11 matching lines...) Expand all Loading... | |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * @constructor | 28 * @constructor |
| 29 * @extends {WebInspector.Panel} | 29 * @extends {WebInspector.Panel} |
| 30 * @implements {WebInspector.ContextMenu.Provider} | 30 * @implements {WebInspector.ContextMenu.Provider} |
| 31 * @implements {WebInspector.TargetManager.Observer} | 31 * @implements {WebInspector.TargetManager.Observer} |
| 32 * @implements {WebInspector.ViewLocationResolver} | |
| 32 */ | 33 */ |
| 33 WebInspector.SourcesPanel = function() | 34 WebInspector.SourcesPanel = function() |
| 34 { | 35 { |
| 35 WebInspector.Panel.call(this, "sources"); | 36 WebInspector.Panel.call(this, "sources"); |
| 36 WebInspector.SourcesPanel._instance = this; | 37 WebInspector.SourcesPanel._instance = this; |
| 37 this.registerRequiredCSS("sources/sourcesPanel.css"); | 38 this.registerRequiredCSS("sources/sourcesPanel.css"); |
| 38 new WebInspector.DropTarget(this.element, [WebInspector.DropTarget.Types.Fil es], WebInspector.UIString("Drop workspace folder here"), this._handleDrop.bind( this)); | 39 new WebInspector.DropTarget(this.element, [WebInspector.DropTarget.Types.Fil es], WebInspector.UIString("Drop workspace folder here"), this._handleDrop.bind( this)); |
| 39 | 40 |
| 40 this._workspace = WebInspector.workspace; | 41 this._workspace = WebInspector.workspace; |
| 41 this._networkMapping = WebInspector.networkMapping; | 42 this._networkMapping = WebInspector.networkMapping; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 WebInspector.Panel.prototype.willHide.call(this); | 208 WebInspector.Panel.prototype.willHide.call(this); |
| 208 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); | 209 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); |
| 209 if (WebInspector.SourcesPanel.WrapperView.isShowing()) { | 210 if (WebInspector.SourcesPanel.WrapperView.isShowing()) { |
| 210 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ; | 211 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ; |
| 211 WebInspector.inspectorView.setDrawerMinimized(false); | 212 WebInspector.inspectorView.setDrawerMinimized(false); |
| 212 WebInspector.SourcesPanel.updateResizer(this); | 213 WebInspector.SourcesPanel.updateResizer(this); |
| 213 } | 214 } |
| 214 }, | 215 }, |
| 215 | 216 |
| 216 /** | 217 /** |
| 218 * @override | |
| 219 * @param {string} locationName | |
| 220 * @return {?WebInspector.ViewLocation} | |
| 221 */ | |
| 222 resolveLocation: function(locationName) | |
| 223 { | |
| 224 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.ins tance()); | |
| 225 return this._navigatorTabbedPane; | |
| 226 }, | |
| 227 | |
| 228 /** | |
| 217 * @return {boolean} | 229 * @return {boolean} |
| 218 */ | 230 */ |
| 219 _ensureSourcesViewVisible: function() | 231 _ensureSourcesViewVisible: function() |
| 220 { | 232 { |
| 221 if (WebInspector.SourcesPanel.WrapperView.isShowing()) | 233 if (WebInspector.SourcesPanel.WrapperView.isShowing()) |
| 222 return true; | 234 return true; |
| 223 return this === WebInspector.inspectorView.setCurrentPanel(this); | 235 return this === WebInspector.inspectorView.setCurrentPanel(this); |
| 224 }, | 236 }, |
| 225 | 237 |
| 226 onResize: function() | 238 onResize: function() |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 showUILocation: function(uiLocation, omitFocus) | 410 showUILocation: function(uiLocation, omitFocus) |
| 399 { | 411 { |
| 400 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui Location.columnNumber, omitFocus); | 412 this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, ui Location.columnNumber, omitFocus); |
| 401 }, | 413 }, |
| 402 | 414 |
| 403 /** | 415 /** |
| 404 * @param {!WebInspector.UISourceCode} uiSourceCode | 416 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 405 */ | 417 */ |
| 406 _revealInNavigator: function(uiSourceCode) | 418 _revealInNavigator: function(uiSourceCode) |
| 407 { | 419 { |
| 408 var extensions = self.runtime.extensions("view").filter(extension => ext ension.descriptor()["location"] === "navigator-view"); | 420 var extensions = self.runtime.extensions(WebInspector.NavigatorView); |
| 409 Promise.all(extensions.map(extension => extension.instance())).then(filt erNavigators); | 421 Promise.all(extensions.map(extension => extension.instance())).then(filt erNavigators); |
|
dgozman
2016/08/03 19:18:18
runtime.allInstances()
pfeldman
2016/08/03 21:52:18
Done.
| |
| 410 | 422 |
| 411 /** | 423 /** |
| 412 * @param {!Array.<!Object>} objects | 424 * @param {!Array.<!Object>} objects |
| 413 */ | 425 */ |
| 414 function filterNavigators(objects) | 426 function filterNavigators(objects) |
| 415 { | 427 { |
| 416 for (var i = 0; i < objects.length; ++i) { | 428 for (var i = 0; i < objects.length; ++i) { |
| 417 var navigatorView = /** @type {!WebInspector.NavigatorView} */ ( objects[i]); | 429 var navigatorView = /** @type {!WebInspector.NavigatorView} */ ( objects[i]); |
| 418 if (navigatorView.accept(uiSourceCode)) { | 430 if (navigatorView.accept(uiSourceCode)) { |
| 419 navigatorView.revealWidget(); | |
| 420 navigatorView.revealUISourceCode(uiSourceCode, true); | 431 navigatorView.revealUISourceCode(uiSourceCode, true); |
| 432 WebInspector.viewManager.showView(extensions[i].descriptor() ["viewId"]); | |
| 421 } | 433 } |
| 422 } | 434 } |
| 423 } | 435 } |
| 424 }, | 436 }, |
| 425 | 437 |
| 426 /** | 438 /** |
| 427 * @param {!WebInspector.ContextMenu} contextMenu | 439 * @param {!WebInspector.ContextMenu} contextMenu |
| 428 */ | 440 */ |
| 429 _populateNavigatorMenu: function(contextMenu) | 441 _populateNavigatorMenu: function(contextMenu) |
| 430 { | 442 { |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1461 __proto__: WebInspector.VBox.prototype | 1473 __proto__: WebInspector.VBox.prototype |
| 1462 } | 1474 } |
| 1463 | 1475 |
| 1464 /** | 1476 /** |
| 1465 * @return {boolean} | 1477 * @return {boolean} |
| 1466 */ | 1478 */ |
| 1467 WebInspector.SourcesPanel.WrapperView.isShowing = function() | 1479 WebInspector.SourcesPanel.WrapperView.isShowing = function() |
| 1468 { | 1480 { |
| 1469 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); | 1481 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); |
| 1470 } | 1482 } |
| OLD | NEW |