| 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 21 matching lines...) Expand all Loading... |
| 32 Sources.SourcesPanel = class extends UI.Panel { | 32 Sources.SourcesPanel = class extends UI.Panel { |
| 33 constructor() { | 33 constructor() { |
| 34 super('sources'); | 34 super('sources'); |
| 35 Sources.SourcesPanel._instance = this; | 35 Sources.SourcesPanel._instance = this; |
| 36 this.registerRequiredCSS('sources/sourcesPanel.css'); | 36 this.registerRequiredCSS('sources/sourcesPanel.css'); |
| 37 new UI.DropTarget( | 37 new UI.DropTarget( |
| 38 this.element, [UI.DropTarget.Types.Files], Common.UIString('Drop workspa
ce folder here'), | 38 this.element, [UI.DropTarget.Types.Files], Common.UIString('Drop workspa
ce folder here'), |
| 39 this._handleDrop.bind(this)); | 39 this._handleDrop.bind(this)); |
| 40 | 40 |
| 41 this._workspace = Workspace.workspace; | 41 this._workspace = Workspace.workspace; |
| 42 this._networkMapping = Bindings.networkMapping; | |
| 43 | 42 |
| 44 this._togglePauseAction = | 43 this._togglePauseAction = |
| 45 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-pau
se')); | 44 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-pau
se')); |
| 46 this._stepOverAction = | 45 this._stepOverAction = |
| 47 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-over'
)); | 46 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-over'
)); |
| 48 this._stepIntoAction = | 47 this._stepIntoAction = |
| 49 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-into'
)); | 48 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.step-into'
)); |
| 50 this._stepOutAction = /** @type {!UI.Action }*/ (UI.actionRegistry.action('d
ebugger.step-out')); | 49 this._stepOutAction = /** @type {!UI.Action }*/ (UI.actionRegistry.action('d
ebugger.step-out')); |
| 51 this._toggleBreakpointsActiveAction = | 50 this._toggleBreakpointsActiveAction = |
| 52 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-bre
akpoints-active')); | 51 /** @type {!UI.Action }*/ (UI.actionRegistry.action('debugger.toggle-bre
akpoints-active')); |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 * @param {!Workspace.Project} project | 806 * @param {!Workspace.Project} project |
| 808 */ | 807 */ |
| 809 function filterProject(project) { | 808 function filterProject(project) { |
| 810 return project.type() === Workspace.projectTypes.FileSystem; | 809 return project.type() === Workspace.projectTypes.FileSystem; |
| 811 } | 810 } |
| 812 | 811 |
| 813 if (uiSourceCode.project().type() === Workspace.projectTypes.Network || | 812 if (uiSourceCode.project().type() === Workspace.projectTypes.Network || |
| 814 uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts)
{ | 813 uiSourceCode.project().type() === Workspace.projectTypes.ContentScripts)
{ |
| 815 if (!this._workspace.projects().filter(filterProject).length) | 814 if (!this._workspace.projects().filter(filterProject).length) |
| 816 return; | 815 return; |
| 817 if (this._networkMapping.uiSourceCodeForURLForAnyTarget(uiSourceCode.url()
) === uiSourceCode) { | 816 if (this._workspace.uiSourceCodeForURL(uiSourceCode.url()) === uiSourceCod
e) { |
| 818 contextMenu.appendItem( | 817 contextMenu.appendItem( |
| 819 Common.UIString.capitalize('Map to ^file ^system ^resource\u2026'), | 818 Common.UIString.capitalize('Map to ^file ^system ^resource\u2026'), |
| 820 this.mapNetworkToFileSystem.bind(this, uiSourceCode)); | 819 this.mapNetworkToFileSystem.bind(this, uiSourceCode)); |
| 821 } | 820 } |
| 822 } | 821 } |
| 823 } | 822 } |
| 824 | 823 |
| 825 /** | 824 /** |
| 826 * @param {!Event} event | 825 * @param {!Event} event |
| 827 * @param {!UI.ContextMenu} contextMenu | 826 * @param {!UI.ContextMenu} contextMenu |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 } | 908 } |
| 910 | 909 |
| 911 /** | 910 /** |
| 912 * @param {!UI.ContextMenu} contextMenu | 911 * @param {!UI.ContextMenu} contextMenu |
| 913 * @param {!Object} target | 912 * @param {!Object} target |
| 914 */ | 913 */ |
| 915 _appendNetworkRequestItems(contextMenu, target) { | 914 _appendNetworkRequestItems(contextMenu, target) { |
| 916 if (!(target instanceof SDK.NetworkRequest)) | 915 if (!(target instanceof SDK.NetworkRequest)) |
| 917 return; | 916 return; |
| 918 var request = /** @type {!SDK.NetworkRequest} */ (target); | 917 var request = /** @type {!SDK.NetworkRequest} */ (target); |
| 919 var uiSourceCode = this._networkMapping.uiSourceCodeForURLForAnyTarget(reque
st.url); | 918 var uiSourceCode = this._workspace.uiSourceCodeForURL(request.url); |
| 920 if (!uiSourceCode) | 919 if (!uiSourceCode) |
| 921 return; | 920 return; |
| 922 var openText = Common.UIString.capitalize('Open in Sources ^panel'); | 921 var openText = Common.UIString.capitalize('Open in Sources ^panel'); |
| 923 contextMenu.appendItem(openText, this.showUILocation.bind(this, uiSourceCode
.uiLocation(0, 0))); | 922 contextMenu.appendItem(openText, this.showUILocation.bind(this, uiSourceCode
.uiLocation(0, 0))); |
| 924 } | 923 } |
| 925 | 924 |
| 926 /** | 925 /** |
| 927 * @param {!SDK.RemoteObject} remoteObject | 926 * @param {!SDK.RemoteObject} remoteObject |
| 928 */ | 927 */ |
| 929 _saveToTempVariable(remoteObject) { | 928 _saveToTempVariable(remoteObject) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 */ | 1322 */ |
| 1324 willHide() { | 1323 willHide() { |
| 1325 UI.inspectorView.setDrawerMinimized(false); | 1324 UI.inspectorView.setDrawerMinimized(false); |
| 1326 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc
es.SourcesPanel.instance())); | 1325 setImmediate(() => Sources.SourcesPanel.updateResizerAndSidebarButtons(Sourc
es.SourcesPanel.instance())); |
| 1327 } | 1326 } |
| 1328 | 1327 |
| 1329 _showViewInWrapper() { | 1328 _showViewInWrapper() { |
| 1330 this._view.show(this.element); | 1329 this._view.show(this.element); |
| 1331 } | 1330 } |
| 1332 }; | 1331 }; |
| OLD | NEW |