| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @param {!WebInspector.SourcesPanel} sourcesPanel | 8 * @param {!WebInspector.SourcesPanel} sourcesPanel |
| 9 * @param {!WebInspector.Workspace} workspace | 9 * @param {!WebInspector.Workspace} workspace |
| 10 */ | 10 */ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // First try mapping filesystem -> network. | 51 // First try mapping filesystem -> network. |
| 52 if (!this._workspaceMappingInfobarDisabledSetting.get() && uiSourceCode.
project().type() === WebInspector.projectTypes.FileSystem) { | 52 if (!this._workspaceMappingInfobarDisabledSetting.get() && uiSourceCode.
project().type() === WebInspector.projectTypes.FileSystem) { |
| 53 var networkURL = WebInspector.networkMapping.networkURL(uiSourceCode
); | 53 var networkURL = WebInspector.networkMapping.networkURL(uiSourceCode
); |
| 54 var hasMappings = !!networkURL; | 54 var hasMappings = !!networkURL; |
| 55 if (hasMappings) | 55 if (hasMappings) |
| 56 return; | 56 return; |
| 57 | 57 |
| 58 var networkProjects = this._workspace.projectsForType(WebInspector.p
rojectTypes.Network); | 58 var networkProjects = this._workspace.projectsForType(WebInspector.p
rojectTypes.Network); |
| 59 networkProjects = networkProjects.concat(this._workspace.projectsFor
Type(WebInspector.projectTypes.ContentScripts)); | 59 networkProjects = networkProjects.concat(this._workspace.projectsFor
Type(WebInspector.projectTypes.ContentScripts)); |
| 60 for (var i = 0; i < networkProjects.length; ++i) { | 60 for (var i = 0; i < networkProjects.length; ++i) { |
| 61 if (!this._isLocalHost(networkProjects[i].url())) | |
| 62 continue; | |
| 63 var name = uiSourceCode.name(); | 61 var name = uiSourceCode.name(); |
| 64 var networkUiSourceCodes = networkProjects[i].uiSourceCodes(); | 62 var networkUiSourceCodes = networkProjects[i].uiSourceCodes(); |
| 65 for (var j = 0; j < networkUiSourceCodes.length; ++j) { | 63 for (var j = 0; j < networkUiSourceCodes.length; ++j) { |
| 66 if (networkUiSourceCodes[j].name() === name) { | 64 if (networkUiSourceCodes[j].name() === name && this._isLocal
Host(networkUiSourceCodes[j].originURL())) { |
| 67 this._showMappingInfobar(uiSourceCode, false); | 65 this._showMappingInfobar(uiSourceCode, false); |
| 68 return; | 66 return; |
| 69 } | 67 } |
| 70 } | 68 } |
| 71 } | 69 } |
| 72 } | 70 } |
| 73 | 71 |
| 74 // Then map network -> filesystem. | 72 // Then map network -> filesystem. |
| 75 if (uiSourceCode.project().type() === WebInspector.projectTypes.Network
|| uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) { | 73 if (uiSourceCode.project().type() === WebInspector.projectTypes.Network
|| uiSourceCode.project().type() === WebInspector.projectTypes.ContentScripts) { |
| 76 // Suggest for localhost only. | 74 // Suggest for localhost only. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); | 161 var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); |
| 164 | 162 |
| 165 var rowElement = infobar.createDetailsRowMessage(WebInspector.UIString("
For more information on workspaces, refer to the ")); | 163 var rowElement = infobar.createDetailsRowMessage(WebInspector.UIString("
For more information on workspaces, refer to the ")); |
| 166 rowElement.appendChild(WebInspector.linkifyDocumentationURLAsNode("../se
tup/setup-workflow", WebInspector.UIString("workspaces documentation"))); | 164 rowElement.appendChild(WebInspector.linkifyDocumentationURLAsNode("../se
tup/setup-workflow", WebInspector.UIString("workspaces documentation"))); |
| 167 rowElement.createTextChild("."); | 165 rowElement.createTextChild("."); |
| 168 uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol] = infobar; | 166 uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol] = infobar; |
| 169 uiSourceCodeFrame.attachInfobars([infobar]); | 167 uiSourceCodeFrame.attachInfobars([infobar]); |
| 170 WebInspector.runCSSAnimationOnce(infobar.element, "source-frame-infobar-
animation"); | 168 WebInspector.runCSSAnimationOnce(infobar.element, "source-frame-infobar-
animation"); |
| 171 } | 169 } |
| 172 } | 170 } |
| OLD | NEW |