| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 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 * | 10 * |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode)) | 156 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode)) |
| 157 return false; | 157 return false; |
| 158 return uiSourceCode.project().type() !== WebInspector.projectTypes.Conte
ntScripts && uiSourceCode.project().type() !== WebInspector.projectTypes.Snippet
s; | 158 return uiSourceCode.project().type() !== WebInspector.projectTypes.Conte
ntScripts && uiSourceCode.project().type() !== WebInspector.projectTypes.Snippet
s; |
| 159 }, | 159 }, |
| 160 | 160 |
| 161 /** | 161 /** |
| 162 * @param {!WebInspector.Event} event | 162 * @param {!WebInspector.Event} event |
| 163 */ | 163 */ |
| 164 _inspectedURLChanged: function(event) | 164 _inspectedURLChanged: function(event) |
| 165 { | 165 { |
| 166 var nodes = this._uiSourceCodeNodes.valuesArray(); | 166 var mainTarget = WebInspector.targetManager.mainTarget(); |
| 167 for (var i = 0; i < nodes.length; ++i) { | 167 if (event.data !== mainTarget) |
| 168 var uiSourceCode = nodes[i].uiSourceCode(); | 168 return; |
| 169 var inspectedPageURL = WebInspector.targetManager.inspectedPageURL()
; | 169 var inspectedURL = mainTarget && mainTarget.inspectedURL(); |
| 170 if (inspectedPageURL && WebInspector.networkMapping.networkURL(uiSou
rceCode) === inspectedPageURL) | 170 if (!inspectedURL) |
| 171 return |
| 172 for (var node of this._uiSourceCodeNodes.valuesArray()) { |
| 173 var uiSourceCode = node.uiSourceCode(); |
| 174 if (WebInspector.networkMapping.networkURL(uiSourceCode) === inspect
edURL) |
| 171 this.revealUISourceCode(uiSourceCode, true); | 175 this.revealUISourceCode(uiSourceCode, true); |
| 172 } | 176 } |
| 173 }, | 177 }, |
| 174 | 178 |
| 175 /** | 179 /** |
| 176 * @override | 180 * @override |
| 177 * @param {!WebInspector.UISourceCode} uiSourceCode | 181 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 178 */ | 182 */ |
| 179 uiSourceCodeAdded: function(uiSourceCode) | 183 uiSourceCodeAdded: function(uiSourceCode) |
| 180 { | 184 { |
| 181 var inspectedPageURL = WebInspector.targetManager.inspectedPageURL(); | 185 var inspectedPageURL = WebInspector.targetManager.mainTarget().inspected
URL(); |
| 182 if (inspectedPageURL && WebInspector.networkMapping.networkURL(uiSourceC
ode) === inspectedPageURL) | 186 if (inspectedPageURL && WebInspector.networkMapping.networkURL(uiSourceC
ode) === inspectedPageURL) |
| 183 this.revealUISourceCode(uiSourceCode, true); | 187 this.revealUISourceCode(uiSourceCode, true); |
| 184 }, | 188 }, |
| 185 | 189 |
| 186 __proto__: WebInspector.NavigatorView.prototype | 190 __proto__: WebInspector.NavigatorView.prototype |
| 187 } | 191 } |
| 188 | 192 |
| 189 /** | 193 /** |
| 190 * @constructor | 194 * @constructor |
| 191 * @extends {WebInspector.NavigatorView} | 195 * @extends {WebInspector.NavigatorView} |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 /** | 293 /** |
| 290 * @override | 294 * @override |
| 291 */ | 295 */ |
| 292 sourceDeleted: function(uiSourceCode) | 296 sourceDeleted: function(uiSourceCode) |
| 293 { | 297 { |
| 294 this._handleRemoveSnippet(uiSourceCode); | 298 this._handleRemoveSnippet(uiSourceCode); |
| 295 }, | 299 }, |
| 296 | 300 |
| 297 __proto__: WebInspector.NavigatorView.prototype | 301 __proto__: WebInspector.NavigatorView.prototype |
| 298 } | 302 } |
| OLD | NEW |