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

Side by Side Diff: Source/devtools/front_end/workspace/Workspace.js

Issue 1264133002: Devtools: [WIP] Implement enhanced devtools extension language APIs Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modify override dropdown to apply to console completions & transpile Created 5 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
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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 { 566 {
567 this._fileSystemMapping = fileSystemMapping; 567 this._fileSystemMapping = fileSystemMapping;
568 /** @type {!Object.<string, !WebInspector.Project>} */ 568 /** @type {!Object.<string, !WebInspector.Project>} */
569 this._projects = {}; 569 this._projects = {};
570 this._hasResourceContentTrackingExtensions = false; 570 this._hasResourceContentTrackingExtensions = false;
571 } 571 }
572 572
573 WebInspector.Workspace.Events = { 573 WebInspector.Workspace.Events = {
574 UISourceCodeAdded: "UISourceCodeAdded", 574 UISourceCodeAdded: "UISourceCodeAdded",
575 UISourceCodeRemoved: "UISourceCodeRemoved", 575 UISourceCodeRemoved: "UISourceCodeRemoved",
576 UISourceCodeEdited: "UISourceCodeEdited",
576 UISourceCodeContentCommitted: "UISourceCodeContentCommitted", 577 UISourceCodeContentCommitted: "UISourceCodeContentCommitted",
577 ProjectAdded: "ProjectAdded", 578 ProjectAdded: "ProjectAdded",
578 ProjectRemoved: "ProjectRemoved" 579 ProjectRemoved: "ProjectRemoved"
579 } 580 }
580 581
581 WebInspector.Workspace.prototype = { 582 WebInspector.Workspace.prototype = {
582 /** 583 /**
583 * @return {!Array.<!WebInspector.UISourceCode>} 584 * @return {!Array.<!WebInspector.UISourceCode>}
584 */ 585 */
585 unsavedSourceCodes: function() 586 unsavedSourceCodes: function()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 for (var i = 0; i < projects.length; ++i) { 624 for (var i = 0; i < projects.length; ++i) {
624 var project = projects[i]; 625 var project = projects[i];
625 var uiSourceCode = project.uiSourceCodeForOriginURL(originURL); 626 var uiSourceCode = project.uiSourceCodeForOriginURL(originURL);
626 if (uiSourceCode) 627 if (uiSourceCode)
627 return uiSourceCode; 628 return uiSourceCode;
628 } 629 }
629 return null; 630 return null;
630 }, 631 },
631 632
632 /** 633 /**
634 * @param {string} url
635 * @return {?WebInspector.UISourceCode}
636 */
637 uiSourceCodeForFilePath: function(url) {
pfeldman 2015/08/13 21:15:47 You should not distinguish resources from the file
wes 2015/08/14 00:55:06 I'll double check something but at some point I ad
wes 2015/08/14 01:13:32 Right! I found the other bit I added (the answer t
638 var items = this.uiSourceCodesForProjectType(WebInspector.projectTypes.F ileSystem);
639 for (var i = 0; i < items.length; ++i) {
640 var item = items[i];
641 if (item.uri() === url)
642 return item;
643 }
644 return null;
645 },
646
647 /**
633 * @param {string} type 648 * @param {string} type
634 * @return {!Array.<!WebInspector.UISourceCode>} 649 * @return {!Array.<!WebInspector.UISourceCode>}
635 */ 650 */
636 uiSourceCodesForProjectType: function(type) 651 uiSourceCodesForProjectType: function(type)
637 { 652 {
638 var result = []; 653 var result = [];
639 for (var projectName in this._projects) { 654 for (var projectName in this._projects) {
640 var project = this._projects[projectName]; 655 var project = this._projects[projectName];
641 if (project.type() === type) 656 if (project.type() === type)
642 result = result.concat(project.uiSourceCodes()); 657 result = result.concat(project.uiSourceCodes());
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 return this._hasResourceContentTrackingExtensions; 743 return this._hasResourceContentTrackingExtensions;
729 }, 744 },
730 745
731 __proto__: WebInspector.Object.prototype 746 __proto__: WebInspector.Object.prototype
732 } 747 }
733 748
734 /** 749 /**
735 * @type {!WebInspector.Workspace} 750 * @type {!WebInspector.Workspace}
736 */ 751 */
737 WebInspector.workspace; 752 WebInspector.workspace;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698