Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: Source/devtools/front_end/sources/NavigatorView.js

Issue 485713002: DevTools: Use targetManager.inspectedPageUrl() instead of resourceTreeModel.inspectedPageUrl() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addrss comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/sdk/Target.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 __proto__: WebInspector.VBox.prototype 492 __proto__: WebInspector.VBox.prototype
493 } 493 }
494 494
495 /** 495 /**
496 * @constructor 496 * @constructor
497 * @extends {WebInspector.NavigatorView} 497 * @extends {WebInspector.NavigatorView}
498 */ 498 */
499 WebInspector.SourcesNavigatorView = function() 499 WebInspector.SourcesNavigatorView = function()
500 { 500 {
501 WebInspector.NavigatorView.call(this); 501 WebInspector.NavigatorView.call(this);
502 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.InspectedURLChanged, this._inspectedURLChanged, this); 502 WebInspector.targetManager.addEventListener(WebInspector.ResourceTreeModel.E ventTypes.InspectedURLChanged, this._inspectedURLChanged, this);
503 } 503 }
504 504
505 WebInspector.SourcesNavigatorView.prototype = { 505 WebInspector.SourcesNavigatorView.prototype = {
506 /** 506 /**
507 * @override 507 * @override
508 * @param {!WebInspector.UISourceCode} uiSourceCode 508 * @param {!WebInspector.UISourceCode} uiSourceCode
509 * @return {boolean} 509 * @return {boolean}
510 */ 510 */
511 accept: function(uiSourceCode) 511 accept: function(uiSourceCode)
512 { 512 {
513 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode)) 513 if (!WebInspector.NavigatorView.prototype.accept(uiSourceCode))
514 return false; 514 return false;
515 return uiSourceCode.project().type() !== WebInspector.projectTypes.Conte ntScripts && uiSourceCode.project().type() !== WebInspector.projectTypes.Snippet s; 515 return uiSourceCode.project().type() !== WebInspector.projectTypes.Conte ntScripts && uiSourceCode.project().type() !== WebInspector.projectTypes.Snippet s;
516 516
517 }, 517 },
518 518
519 /** 519 /**
520 * @param {!WebInspector.Event} event 520 * @param {!WebInspector.Event} event
521 */ 521 */
522 _inspectedURLChanged: function(event) 522 _inspectedURLChanged: function(event)
523 { 523 {
524 var nodes = this._uiSourceCodeNodes.values(); 524 var nodes = this._uiSourceCodeNodes.values();
525 for (var i = 0; i < nodes.length; ++i) { 525 for (var i = 0; i < nodes.length; ++i) {
526 var uiSourceCode = nodes[i].uiSourceCode(); 526 var uiSourceCode = nodes[i].uiSourceCode();
527 if (WebInspector.resourceTreeModel.inspectedPageURL() && uiSourceCode .url === WebInspector.resourceTreeModel.inspectedPageURL()) 527 var inspectedPageURL = WebInspector.targetManager.inspectedPageURL();
528 if (inspectedPageURL && uiSourceCode.url === inspectedPageURL)
528 this.revealUISourceCode(uiSourceCode, true); 529 this.revealUISourceCode(uiSourceCode, true);
529 } 530 }
530 }, 531 },
531 532
532 /** 533 /**
533 * @param {!WebInspector.UISourceCode} uiSourceCode 534 * @param {!WebInspector.UISourceCode} uiSourceCode
534 */ 535 */
535 _addUISourceCode: function(uiSourceCode) 536 _addUISourceCode: function(uiSourceCode)
536 { 537 {
537 WebInspector.NavigatorView.prototype._addUISourceCode.call(this, uiSourc eCode); 538 WebInspector.NavigatorView.prototype._addUISourceCode.call(this, uiSourc eCode);
538 if (uiSourceCode.url === WebInspector.resourceTreeModel.inspectedPageURL ()) 539 if (uiSourceCode.url === WebInspector.targetManager.inspectedPageURL())
539 this.revealUISourceCode(uiSourceCode, true); 540 this.revealUISourceCode(uiSourceCode, true);
540 }, 541 },
541 542
542 __proto__: WebInspector.NavigatorView.prototype 543 __proto__: WebInspector.NavigatorView.prototype
543 } 544 }
544 545
545 /** 546 /**
546 * @constructor 547 * @constructor
547 * @extends {WebInspector.NavigatorView} 548 * @extends {WebInspector.NavigatorView}
548 */ 549 */
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 * @param {!TreeElement} treeElement2 594 * @param {!TreeElement} treeElement2
594 * @return {number} 595 * @return {number}
595 */ 596 */
596 WebInspector.NavigatorTreeOutline._treeElementsCompare = function compare(treeEl ement1, treeElement2) 597 WebInspector.NavigatorTreeOutline._treeElementsCompare = function compare(treeEl ement1, treeElement2)
597 { 598 {
598 // Insert in the alphabetical order, first domains, then folders, then scrip ts. 599 // Insert in the alphabetical order, first domains, then folders, then scrip ts.
599 function typeWeight(treeElement) 600 function typeWeight(treeElement)
600 { 601 {
601 var type = treeElement.type(); 602 var type = treeElement.type();
602 if (type === WebInspector.NavigatorTreeOutline.Types.Domain) { 603 if (type === WebInspector.NavigatorTreeOutline.Types.Domain) {
603 if (treeElement.titleText === WebInspector.resourceTreeModel.inspect edPageDomain()) 604 if (treeElement.titleText === WebInspector.targetManager.inspectedPa geDomain())
604 return 1; 605 return 1;
605 return 2; 606 return 2;
606 } 607 }
607 if (type === WebInspector.NavigatorTreeOutline.Types.FileSystem) 608 if (type === WebInspector.NavigatorTreeOutline.Types.FileSystem)
608 return 3; 609 return 3;
609 if (type === WebInspector.NavigatorTreeOutline.Types.Folder) 610 if (type === WebInspector.NavigatorTreeOutline.Types.Folder)
610 return 4; 611 return 4;
611 return 5; 612 return 5;
612 } 613 }
613 614
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 1415
1415 willRemoveChild: function(node) 1416 willRemoveChild: function(node)
1416 { 1417 {
1417 if (node._isMerged || !this.isPopulated()) 1418 if (node._isMerged || !this.isPopulated())
1418 return; 1419 return;
1419 this._treeElement.removeChild(node._treeElement); 1420 this._treeElement.removeChild(node._treeElement);
1420 }, 1421 },
1421 1422
1422 __proto__: WebInspector.NavigatorTreeNode.prototype 1423 __proto__: WebInspector.NavigatorTreeNode.prototype
1423 } 1424 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/Target.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698