| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 _addUISourceCode: function(uiSourceCode) | 182 _addUISourceCode: function(uiSourceCode) |
| 183 { | 183 { |
| 184 if (!this.accept(uiSourceCode)) | 184 if (!this.accept(uiSourceCode)) |
| 185 return; | 185 return; |
| 186 | 186 |
| 187 var isFromSourceMap = uiSourceCode.contentType().isFromSourceMap(); | 187 var isFromSourceMap = uiSourceCode.contentType().isFromSourceMap(); |
| 188 var path; | 188 var path; |
| 189 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst
em) | 189 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst
em) |
| 190 path = WebInspector.FileSystemWorkspaceBinding.relativePath(uiSource
Code).slice(0, -1); | 190 path = WebInspector.FileSystemWorkspaceBinding.relativePath(uiSource
Code).slice(0, -1); |
| 191 else | 191 else |
| 192 path = WebInspector.ParsedURL.splitURLIntoPathComponents(uiSourceCod
e.path()).slice(1, -1); | 192 path = WebInspector.ParsedURL.splitURLIntoPathComponents(uiSourceCod
e.url()).slice(1, -1); |
| 193 | 193 |
| 194 var project = uiSourceCode.project(); | 194 var project = uiSourceCode.project(); |
| 195 var target = WebInspector.NetworkProject.targetForUISourceCode(uiSourceC
ode); | 195 var target = WebInspector.NetworkProject.targetForUISourceCode(uiSourceC
ode); |
| 196 var frame = this._uiSourceCodeFrame(uiSourceCode); | 196 var frame = this._uiSourceCodeFrame(uiSourceCode); |
| 197 | 197 |
| 198 var folderNode = this._folderNode(uiSourceCode, project, target, frame,
uiSourceCode.host(), path, isFromSourceMap); | 198 var folderNode = this._folderNode(uiSourceCode, project, target, frame,
uiSourceCode.origin(), path, isFromSourceMap); |
| 199 var uiSourceCodeNode = new WebInspector.NavigatorUISourceCodeTreeNode(th
is, uiSourceCode); | 199 var uiSourceCodeNode = new WebInspector.NavigatorUISourceCodeTreeNode(th
is, uiSourceCode); |
| 200 this._uiSourceCodeNodes.set(uiSourceCode, uiSourceCodeNode); | 200 this._uiSourceCodeNodes.set(uiSourceCode, uiSourceCodeNode); |
| 201 folderNode.appendChild(uiSourceCodeNode); | 201 folderNode.appendChild(uiSourceCodeNode); |
| 202 this.uiSourceCodeAdded(uiSourceCode); | 202 this.uiSourceCodeAdded(uiSourceCode); |
| 203 }, | 203 }, |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * @param {!WebInspector.UISourceCode} uiSourceCode | 206 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 207 */ | 207 */ |
| 208 uiSourceCodeAdded: function(uiSourceCode) | 208 uiSourceCodeAdded: function(uiSourceCode) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 var uiSourceCodes = project.uiSourceCodes(); | 241 var uiSourceCodes = project.uiSourceCodes(); |
| 242 for (var i = 0; i < uiSourceCodes.length; ++i) | 242 for (var i = 0; i < uiSourceCodes.length; ++i) |
| 243 this._removeUISourceCode(uiSourceCodes[i]); | 243 this._removeUISourceCode(uiSourceCodes[i]); |
| 244 }, | 244 }, |
| 245 | 245 |
| 246 /** | 246 /** |
| 247 * @param {!WebInspector.Project} project | 247 * @param {!WebInspector.Project} project |
| 248 * @param {?WebInspector.Target} target | 248 * @param {?WebInspector.Target} target |
| 249 * @param {?WebInspector.ResourceTreeFrame} frame | 249 * @param {?WebInspector.ResourceTreeFrame} frame |
| 250 * @param {string} projectHost | 250 * @param {string} projectOrigin |
| 251 * @param {string} path | 251 * @param {string} path |
| 252 * @return {string} | 252 * @return {string} |
| 253 */ | 253 */ |
| 254 _folderNodeId: function(project, target, frame, projectHost, path) | 254 _folderNodeId: function(project, target, frame, projectOrigin, path) |
| 255 { | 255 { |
| 256 var targetId = target ? target.id() : ""; | 256 var targetId = target ? target.id() : ""; |
| 257 var projectId = project.type() === WebInspector.projectTypes.FileSystem
? project.id() : ""; | 257 var projectId = project.type() === WebInspector.projectTypes.FileSystem
? project.id() : ""; |
| 258 var frameId = this._groupByFrame && frame ? frame.id : ""; | 258 var frameId = this._groupByFrame && frame ? frame.id : ""; |
| 259 return targetId + ":" + projectId + ":" + frameId + ":" + projectHost +
":" + path; | 259 return targetId + ":" + projectId + ":" + frameId + ":" + projectOrigin
+ ":" + path; |
| 260 }, | 260 }, |
| 261 | 261 |
| 262 /** | 262 /** |
| 263 * @param {!WebInspector.UISourceCode} uiSourceCode | 263 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 264 * @param {!WebInspector.Project} project | 264 * @param {!WebInspector.Project} project |
| 265 * @param {?WebInspector.Target} target | 265 * @param {?WebInspector.Target} target |
| 266 * @param {?WebInspector.ResourceTreeFrame} frame | 266 * @param {?WebInspector.ResourceTreeFrame} frame |
| 267 * @param {string} projectHost | 267 * @param {string} projectOrigin |
| 268 * @param {!Array<string>} path | 268 * @param {!Array<string>} path |
| 269 * @param {boolean} fromSourceMap | 269 * @param {boolean} fromSourceMap |
| 270 * @return {!WebInspector.NavigatorTreeNode} | 270 * @return {!WebInspector.NavigatorTreeNode} |
| 271 */ | 271 */ |
| 272 _folderNode: function(uiSourceCode, project, target, frame, projectHost, pat
h, fromSourceMap) | 272 _folderNode: function(uiSourceCode, project, target, frame, projectOrigin, p
ath, fromSourceMap) |
| 273 { | 273 { |
| 274 if (project.type() === WebInspector.projectTypes.Snippets) | 274 if (project.type() === WebInspector.projectTypes.Snippets) |
| 275 return this._rootNode; | 275 return this._rootNode; |
| 276 | 276 |
| 277 if (target && !this._groupByFolder && !fromSourceMap) | 277 if (target && !this._groupByFolder && !fromSourceMap) |
| 278 return this._domainNode(uiSourceCode, project, target, frame, projec
tHost); | 278 return this._domainNode(uiSourceCode, project, target, frame, projec
tOrigin); |
| 279 | 279 |
| 280 var folderPath = path.join("/"); | 280 var folderPath = path.join("/"); |
| 281 var folderId = this._folderNodeId(project, target, frame, projectHost, f
olderPath); | 281 var folderId = this._folderNodeId(project, target, frame, projectOrigin,
folderPath); |
| 282 var folderNode = this._subfolderNodes.get(folderId); | 282 var folderNode = this._subfolderNodes.get(folderId); |
| 283 if (folderNode) | 283 if (folderNode) |
| 284 return folderNode; | 284 return folderNode; |
| 285 | 285 |
| 286 if (!path.length) { | 286 if (!path.length) { |
| 287 if (target) | 287 if (target) |
| 288 return this._domainNode(uiSourceCode, project, target, frame, pr
ojectHost); | 288 return this._domainNode(uiSourceCode, project, target, frame, pr
ojectOrigin); |
| 289 var fileSystemNode = this._rootNode.child(project.id()); | 289 var fileSystemNode = this._rootNode.child(project.id()); |
| 290 if (!fileSystemNode) { | 290 if (!fileSystemNode) { |
| 291 fileSystemNode = new WebInspector.NavigatorGroupTreeNode(this, p
roject, project.id(), WebInspector.NavigatorView.Types.FileSystem, project.disp
layName()); | 291 fileSystemNode = new WebInspector.NavigatorGroupTreeNode(this, p
roject, project.id(), WebInspector.NavigatorView.Types.FileSystem, project.disp
layName()); |
| 292 this._rootNode.appendChild(fileSystemNode); | 292 this._rootNode.appendChild(fileSystemNode); |
| 293 } | 293 } |
| 294 return fileSystemNode; | 294 return fileSystemNode; |
| 295 } | 295 } |
| 296 | 296 |
| 297 var parentNode = this._folderNode(uiSourceCode, project, target, frame,
projectHost, path.slice(0, -1), fromSourceMap); | 297 var parentNode = this._folderNode(uiSourceCode, project, target, frame,
projectOrigin, path.slice(0, -1), fromSourceMap); |
| 298 var type = fromSourceMap ? WebInspector.NavigatorView.Types.SourceMapFol
der : WebInspector.NavigatorView.Types.NetworkFolder; | 298 var type = fromSourceMap ? WebInspector.NavigatorView.Types.SourceMapFol
der : WebInspector.NavigatorView.Types.NetworkFolder; |
| 299 if (project.type() === WebInspector.projectTypes.FileSystem) | 299 if (project.type() === WebInspector.projectTypes.FileSystem) |
| 300 type = WebInspector.NavigatorView.Types.FileSystemFolder; | 300 type = WebInspector.NavigatorView.Types.FileSystemFolder; |
| 301 var name = path[path.length - 1]; | 301 var name = path[path.length - 1]; |
| 302 | 302 |
| 303 folderNode = new WebInspector.NavigatorFolderTreeNode(this, project, fol
derId, type, folderPath, name); | 303 folderNode = new WebInspector.NavigatorFolderTreeNode(this, project, fol
derId, type, folderPath, name); |
| 304 this._subfolderNodes.set(folderId, folderNode); | 304 this._subfolderNodes.set(folderId, folderNode); |
| 305 parentNode.appendChild(folderNode); | 305 parentNode.appendChild(folderNode); |
| 306 return folderNode; | 306 return folderNode; |
| 307 }, | 307 }, |
| 308 | 308 |
| 309 /** | 309 /** |
| 310 * @param {!WebInspector.UISourceCode} uiSourceCode | 310 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 311 * @param {!WebInspector.Project} project | 311 * @param {!WebInspector.Project} project |
| 312 * @param {!WebInspector.Target} target | 312 * @param {!WebInspector.Target} target |
| 313 * @param {?WebInspector.ResourceTreeFrame} frame | 313 * @param {?WebInspector.ResourceTreeFrame} frame |
| 314 * @param {string} projectHost | 314 * @param {string} projectOrigin |
| 315 * @return {!WebInspector.NavigatorTreeNode} | 315 * @return {!WebInspector.NavigatorTreeNode} |
| 316 */ | 316 */ |
| 317 _domainNode: function(uiSourceCode, project, target, frame, projectHost) | 317 _domainNode: function(uiSourceCode, project, target, frame, projectOrigin) |
| 318 { | 318 { |
| 319 var frameNode = this._frameNode(project, target, frame); | 319 var frameNode = this._frameNode(project, target, frame); |
| 320 if (!this._groupByDomain) | 320 if (!this._groupByDomain) |
| 321 return frameNode; | 321 return frameNode; |
| 322 var domainNode = frameNode.child(projectHost); | 322 var domainNode = frameNode.child(projectOrigin); |
| 323 if (domainNode) | 323 if (domainNode) |
| 324 return domainNode; | 324 return domainNode; |
| 325 | 325 |
| 326 domainNode = new WebInspector.NavigatorGroupTreeNode(this, project, proj
ectHost, WebInspector.NavigatorView.Types.Domain, this._computeProjectDisplayNa
me(target, projectHost)); | 326 domainNode = new WebInspector.NavigatorGroupTreeNode(this, project, proj
ectOrigin, WebInspector.NavigatorView.Types.Domain, this._computeProjectDisplay
Name(target, projectOrigin)); |
| 327 if (frame && projectHost === WebInspector.ParsedURL.splitURLIntoPathComp
onents(frame.url)[0]) | 327 if (frame && projectOrigin === WebInspector.ParsedURL.extractOrigin(fram
e.url)) |
| 328 domainNode.treeNode()._boostOrder = true; | 328 domainNode.treeNode()._boostOrder = true; |
| 329 frameNode.appendChild(domainNode); | 329 frameNode.appendChild(domainNode); |
| 330 return domainNode; | 330 return domainNode; |
| 331 }, | 331 }, |
| 332 | 332 |
| 333 /** | 333 /** |
| 334 * @param {!WebInspector.Project} project | 334 * @param {!WebInspector.Project} project |
| 335 * @param {!WebInspector.Target} target | 335 * @param {!WebInspector.Target} target |
| 336 * @param {?WebInspector.ResourceTreeFrame} frame | 336 * @param {?WebInspector.ResourceTreeFrame} frame |
| 337 * @return {!WebInspector.NavigatorTreeNode} | 337 * @return {!WebInspector.NavigatorTreeNode} |
| (...skipping 28 matching lines...) Expand all Loading... |
| 366 var targetNode = this._rootNode.child("target:" + target.id()); | 366 var targetNode = this._rootNode.child("target:" + target.id()); |
| 367 if (!targetNode) { | 367 if (!targetNode) { |
| 368 targetNode = new WebInspector.NavigatorGroupTreeNode(this, project,
"target:" + target.id(), target.isWorker() ? WebInspector.NavigatorView.Types.Wo
rker : WebInspector.NavigatorView.Types.NetworkFolder, target.name()); | 368 targetNode = new WebInspector.NavigatorGroupTreeNode(this, project,
"target:" + target.id(), target.isWorker() ? WebInspector.NavigatorView.Types.Wo
rker : WebInspector.NavigatorView.Types.NetworkFolder, target.name()); |
| 369 this._rootNode.appendChild(targetNode); | 369 this._rootNode.appendChild(targetNode); |
| 370 } | 370 } |
| 371 return targetNode; | 371 return targetNode; |
| 372 }, | 372 }, |
| 373 | 373 |
| 374 /** | 374 /** |
| 375 * @param {!WebInspector.Target} target | 375 * @param {!WebInspector.Target} target |
| 376 * @param {string} projectHost | 376 * @param {string} projectOrigin |
| 377 * @return {string} | 377 * @return {string} |
| 378 */ | 378 */ |
| 379 _computeProjectDisplayName: function(target, projectHost) | 379 _computeProjectDisplayName: function(target, projectOrigin) |
| 380 { | 380 { |
| 381 for (var context of target.runtimeModel.executionContexts()) { | 381 for (var context of target.runtimeModel.executionContexts()) { |
| 382 if (context.name && context.origin && projectHost.startsWith(context
.origin)) | 382 if (context.name && context.origin && projectOrigin.startsWith(conte
xt.origin)) |
| 383 return context.name; | 383 return context.name; |
| 384 } | 384 } |
| 385 | 385 |
| 386 if (!projectHost) | 386 if (!projectOrigin) |
| 387 return WebInspector.UIString("(no domain)"); | 387 return WebInspector.UIString("(no domain)"); |
| 388 | 388 |
| 389 var parsedURL = new WebInspector.ParsedURL(projectHost); | 389 var parsedURL = new WebInspector.ParsedURL(projectOrigin); |
| 390 var prettyURL = parsedURL.isValid ? parsedURL.host + (parsedURL.port ? (
":" + parsedURL.port) : "") : ""; | 390 var prettyURL = parsedURL.isValid ? parsedURL.host + (parsedURL.port ? (
":" + parsedURL.port) : "") : ""; |
| 391 | 391 |
| 392 return (prettyURL || projectHost); | 392 return (prettyURL || projectOrigin); |
| 393 }, | 393 }, |
| 394 | 394 |
| 395 /** | 395 /** |
| 396 * @param {!WebInspector.UISourceCode} uiSourceCode | 396 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 397 * @param {boolean=} select | 397 * @param {boolean=} select |
| 398 */ | 398 */ |
| 399 revealUISourceCode: function(uiSourceCode, select) | 399 revealUISourceCode: function(uiSourceCode, select) |
| 400 { | 400 { |
| 401 var node = this._uiSourceCodeNodes.get(uiSourceCode); | 401 var node = this._uiSourceCodeNodes.get(uiSourceCode); |
| 402 if (!node) | 402 if (!node) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 var parentNode = node.parent; | 441 var parentNode = node.parent; |
| 442 this._uiSourceCodeNodes.delete(uiSourceCode); | 442 this._uiSourceCodeNodes.delete(uiSourceCode); |
| 443 parentNode.removeChild(node); | 443 parentNode.removeChild(node); |
| 444 node = parentNode; | 444 node = parentNode; |
| 445 | 445 |
| 446 while (node) { | 446 while (node) { |
| 447 parentNode = node.parent; | 447 parentNode = node.parent; |
| 448 if (!parentNode || !node.isEmpty() || !(node instanceof WebInspector
.NavigatorFolderTreeNode)) | 448 if (!parentNode || !node.isEmpty() || !(node instanceof WebInspector
.NavigatorFolderTreeNode)) |
| 449 break; | 449 break; |
| 450 | 450 |
| 451 var folderId = this._folderNodeId(project, target, frame, uiSourceCo
de.host(), node._folderPath); | 451 var folderId = this._folderNodeId(project, target, frame, uiSourceCo
de.origin(), node._folderPath); |
| 452 this._subfolderNodes.delete(folderId); | 452 this._subfolderNodes.delete(folderId); |
| 453 parentNode.removeChild(node); | 453 parentNode.removeChild(node); |
| 454 node = parentNode; | 454 node = parentNode; |
| 455 } | 455 } |
| 456 }, | 456 }, |
| 457 | 457 |
| 458 reset: function() | 458 reset: function() |
| 459 { | 459 { |
| 460 var nodes = this._uiSourceCodeNodes.valuesArray(); | 460 var nodes = this._uiSourceCodeNodes.valuesArray(); |
| 461 for (var i = 0; i < nodes.length; ++i) | 461 for (var i = 0; i < nodes.length; ++i) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 519 } |
| 520 }, | 520 }, |
| 521 | 521 |
| 522 /** | 522 /** |
| 523 * @param {!WebInspector.UISourceCode} uiSourceCode | 523 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 524 */ | 524 */ |
| 525 _handleContextMenuDelete: function(uiSourceCode) | 525 _handleContextMenuDelete: function(uiSourceCode) |
| 526 { | 526 { |
| 527 var shouldDelete = window.confirm(WebInspector.UIString("Are you sure yo
u want to delete this file?")); | 527 var shouldDelete = window.confirm(WebInspector.UIString("Are you sure yo
u want to delete this file?")); |
| 528 if (shouldDelete) | 528 if (shouldDelete) |
| 529 uiSourceCode.project().deleteFile(uiSourceCode.path()); | 529 uiSourceCode.project().deleteFile(uiSourceCode.url()); |
| 530 }, | 530 }, |
| 531 | 531 |
| 532 /** | 532 /** |
| 533 * @param {!Event} event | 533 * @param {!Event} event |
| 534 * @param {!WebInspector.UISourceCode} uiSourceCode | 534 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 535 */ | 535 */ |
| 536 handleFileContextMenu: function(event, uiSourceCode) | 536 handleFileContextMenu: function(event, uiSourceCode) |
| 537 { | 537 { |
| 538 var contextMenu = new WebInspector.ContextMenu(event); | 538 var contextMenu = new WebInspector.ContextMenu(event); |
| 539 contextMenu.appendApplicableItems(uiSourceCode); | 539 contextMenu.appendApplicableItems(uiSourceCode); |
| 540 contextMenu.appendSeparator(); | 540 contextMenu.appendSeparator(); |
| 541 | 541 |
| 542 var project = uiSourceCode.project(); | 542 var project = uiSourceCode.project(); |
| 543 if (project.type() === WebInspector.projectTypes.FileSystem) { | 543 if (project.type() === WebInspector.projectTypes.FileSystem) { |
| 544 var path = uiSourceCode.parentPath(); | 544 var parentURL = uiSourceCode.parentURL(); |
| 545 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202
6"), this._handleContextMenuRename.bind(this, uiSourceCode)); | 545 contextMenu.appendItem(WebInspector.UIString.capitalize("Rename\u202
6"), this._handleContextMenuRename.bind(this, uiSourceCode)); |
| 546 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop
y\u2026"), this._handleContextMenuCreate.bind(this, project, path, uiSourceCode)
); | 546 contextMenu.appendItem(WebInspector.UIString.capitalize("Make a ^cop
y\u2026"), this._handleContextMenuCreate.bind(this, project, parentURL, uiSource
Code)); |
| 547 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t
his._handleContextMenuDelete.bind(this, uiSourceCode)); | 547 contextMenu.appendItem(WebInspector.UIString.capitalize("Delete"), t
his._handleContextMenuDelete.bind(this, uiSourceCode)); |
| 548 contextMenu.appendSeparator(); | 548 contextMenu.appendSeparator(); |
| 549 } | 549 } |
| 550 | 550 |
| 551 contextMenu.show(); | 551 contextMenu.show(); |
| 552 }, | 552 }, |
| 553 | 553 |
| 554 /** | 554 /** |
| 555 * @param {!Event} event | 555 * @param {!Event} event |
| 556 * @param {!WebInspector.NavigatorFolderTreeNode} node | 556 * @param {!WebInspector.NavigatorFolderTreeNode} node |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 * @param {!WebInspector.NavigatorView} navigatorView | 829 * @param {!WebInspector.NavigatorView} navigatorView |
| 830 * @param {!WebInspector.UISourceCode} uiSourceCode | 830 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 831 * @param {string} title | 831 * @param {string} title |
| 832 */ | 832 */ |
| 833 WebInspector.NavigatorSourceTreeElement = function(navigatorView, uiSourceCode,
title) | 833 WebInspector.NavigatorSourceTreeElement = function(navigatorView, uiSourceCode,
title) |
| 834 { | 834 { |
| 835 TreeElement.call(this, "", false); | 835 TreeElement.call(this, "", false); |
| 836 this._nodeType = WebInspector.NavigatorView.Types.File; | 836 this._nodeType = WebInspector.NavigatorView.Types.File; |
| 837 this.title = title; | 837 this.title = title; |
| 838 this.listItemElement.classList.add("navigator-" + uiSourceCode.contentType()
.name() + "-tree-item", "navigator-file-tree-item"); | 838 this.listItemElement.classList.add("navigator-" + uiSourceCode.contentType()
.name() + "-tree-item", "navigator-file-tree-item"); |
| 839 this.tooltip = uiSourceCode.originURL(); | 839 this.tooltip = uiSourceCode.url(); |
| 840 this.createIcon(); | 840 this.createIcon(); |
| 841 | 841 |
| 842 | 842 |
| 843 this._navigatorView = navigatorView; | 843 this._navigatorView = navigatorView; |
| 844 this._uiSourceCode = uiSourceCode; | 844 this._uiSourceCode = uiSourceCode; |
| 845 } | 845 } |
| 846 | 846 |
| 847 WebInspector.NavigatorSourceTreeElement.prototype = { | 847 WebInspector.NavigatorSourceTreeElement.prototype = { |
| 848 /** | 848 /** |
| 849 * @return {!WebInspector.UISourceCode} | 849 * @return {!WebInspector.UISourceCode} |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 /** | 1144 /** |
| 1145 * @constructor | 1145 * @constructor |
| 1146 * @extends {WebInspector.NavigatorTreeNode} | 1146 * @extends {WebInspector.NavigatorTreeNode} |
| 1147 * @param {!WebInspector.NavigatorView} navigatorView | 1147 * @param {!WebInspector.NavigatorView} navigatorView |
| 1148 * @param {!WebInspector.UISourceCode} uiSourceCode | 1148 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 1149 */ | 1149 */ |
| 1150 WebInspector.NavigatorUISourceCodeTreeNode = function(navigatorView, uiSourceCod
e) | 1150 WebInspector.NavigatorUISourceCodeTreeNode = function(navigatorView, uiSourceCod
e) |
| 1151 { | 1151 { |
| 1152 WebInspector.NavigatorTreeNode.call(this, uiSourceCode.project().id() + ":"
+ uiSourceCode.path(), WebInspector.NavigatorView.Types.File); | 1152 WebInspector.NavigatorTreeNode.call(this, uiSourceCode.project().id() + ":"
+ uiSourceCode.url(), WebInspector.NavigatorView.Types.File); |
| 1153 this._navigatorView = navigatorView; | 1153 this._navigatorView = navigatorView; |
| 1154 this._uiSourceCode = uiSourceCode; | 1154 this._uiSourceCode = uiSourceCode; |
| 1155 this._treeElement = null; | 1155 this._treeElement = null; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 WebInspector.NavigatorUISourceCodeTreeNode.prototype = { | 1158 WebInspector.NavigatorUISourceCodeTreeNode.prototype = { |
| 1159 /** | 1159 /** |
| 1160 * @return {!WebInspector.UISourceCode} | 1160 * @return {!WebInspector.UISourceCode} |
| 1161 */ | 1161 */ |
| 1162 uiSourceCode: function() | 1162 uiSourceCode: function() |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1189 updateTitle: function(ignoreIsDirty) | 1189 updateTitle: function(ignoreIsDirty) |
| 1190 { | 1190 { |
| 1191 if (!this._treeElement) | 1191 if (!this._treeElement) |
| 1192 return; | 1192 return; |
| 1193 | 1193 |
| 1194 var titleText = this._uiSourceCode.displayName(); | 1194 var titleText = this._uiSourceCode.displayName(); |
| 1195 if (!ignoreIsDirty && (this._uiSourceCode.isDirty() || this._uiSourceCod
e.hasUnsavedCommittedChanges())) | 1195 if (!ignoreIsDirty && (this._uiSourceCode.isDirty() || this._uiSourceCod
e.hasUnsavedCommittedChanges())) |
| 1196 titleText = "*" + titleText; | 1196 titleText = "*" + titleText; |
| 1197 this._treeElement.title = titleText; | 1197 this._treeElement.title = titleText; |
| 1198 | 1198 |
| 1199 var tooltip = this._uiSourceCode.originURL(); | 1199 var tooltip = this._uiSourceCode.url(); |
| 1200 if (this._uiSourceCode.contentType().isFromSourceMap()) | 1200 if (this._uiSourceCode.contentType().isFromSourceMap()) |
| 1201 tooltip = WebInspector.UIString("%s (from source map)", this._uiSour
ceCode.displayName()); | 1201 tooltip = WebInspector.UIString("%s (from source map)", this._uiSour
ceCode.displayName()); |
| 1202 this._treeElement.tooltip = tooltip; | 1202 this._treeElement.tooltip = tooltip; |
| 1203 }, | 1203 }, |
| 1204 | 1204 |
| 1205 /** | 1205 /** |
| 1206 * @override | 1206 * @override |
| 1207 * @return {boolean} | 1207 * @return {boolean} |
| 1208 */ | 1208 */ |
| 1209 hasChildren: function() | 1209 hasChildren: function() |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 { | 1485 { |
| 1486 if (this._treeElement) | 1486 if (this._treeElement) |
| 1487 return this._treeElement; | 1487 return this._treeElement; |
| 1488 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); | 1488 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na
vigatorView, this._type, this._title); |
| 1489 this._treeElement.setNode(this); | 1489 this._treeElement.setNode(this); |
| 1490 return this._treeElement; | 1490 return this._treeElement; |
| 1491 }, | 1491 }, |
| 1492 | 1492 |
| 1493 __proto__: WebInspector.NavigatorTreeNode.prototype | 1493 __proto__: WebInspector.NavigatorTreeNode.prototype |
| 1494 } | 1494 } |
| OLD | NEW |