| 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 * * 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 } | 583 } |
| 584 | 584 |
| 585 /** | 585 /** |
| 586 * @constructor | 586 * @constructor |
| 587 * @extends {WebInspector.ContentProviderBasedProject} | 587 * @extends {WebInspector.ContentProviderBasedProject} |
| 588 * @param {!WebInspector.Workspace} workspace | 588 * @param {!WebInspector.Workspace} workspace |
| 589 * @param {!WebInspector.ScriptSnippetModel} model | 589 * @param {!WebInspector.ScriptSnippetModel} model |
| 590 */ | 590 */ |
| 591 WebInspector.SnippetsProject = function(workspace, model) | 591 WebInspector.SnippetsProject = function(workspace, model) |
| 592 { | 592 { |
| 593 WebInspector.ContentProviderBasedProject.call(this, workspace, "snippets:",
WebInspector.projectTypes.Snippets, "", ""); | 593 WebInspector.ContentProviderBasedProject.call(this, workspace, "snippets:",
WebInspector.projectTypes.Snippets, ""); |
| 594 this._model = model; | 594 this._model = model; |
| 595 } | 595 } |
| 596 | 596 |
| 597 WebInspector.SnippetsProject.prototype = { | 597 WebInspector.SnippetsProject.prototype = { |
| 598 /** | 598 /** |
| 599 * @param {string} name | 599 * @param {string} name |
| 600 * @param {!WebInspector.ContentProvider} contentProvider | 600 * @param {!WebInspector.ContentProvider} contentProvider |
| 601 * @return {!WebInspector.UISourceCode} | 601 * @return {!WebInspector.UISourceCode} |
| 602 */ | 602 */ |
| 603 addSnippet: function(name, contentProvider) | 603 addSnippet: function(name, contentProvider) |
| 604 { | 604 { |
| 605 return this.addContentProvider("", name, name, contentProvider); | 605 return this.addContentProvider(name, contentProvider); |
| 606 }, | 606 }, |
| 607 | 607 |
| 608 /** | 608 /** |
| 609 * @override | 609 * @override |
| 610 * @return {boolean} | 610 * @return {boolean} |
| 611 */ | 611 */ |
| 612 canSetFileContent: function() | 612 canSetFileContent: function() |
| 613 { | 613 { |
| 614 return true; | 614 return true; |
| 615 }, | 615 }, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 this._model.deleteScriptSnippet(path); | 667 this._model.deleteScriptSnippet(path); |
| 668 }, | 668 }, |
| 669 | 669 |
| 670 __proto__: WebInspector.ContentProviderBasedProject.prototype | 670 __proto__: WebInspector.ContentProviderBasedProject.prototype |
| 671 } | 671 } |
| 672 | 672 |
| 673 /** | 673 /** |
| 674 * @type {!WebInspector.ScriptSnippetModel} | 674 * @type {!WebInspector.ScriptSnippetModel} |
| 675 */ | 675 */ |
| 676 WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspect
or.workspace); | 676 WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspect
or.workspace); |
| OLD | NEW |