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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js

Issue 2695123004: DevTools: Only provide static script content to UISourceCode (Closed)
Patch Set: Return null original for snippets Created 3 years, 10 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 * @param {string} newContent 576 * @param {string} newContent
577 * @param {function(?string)} callback 577 * @param {function(?string)} callback
578 */ 578 */
579 setFileContent(uiSourceCode, newContent, callback) { 579 setFileContent(uiSourceCode, newContent, callback) {
580 this._model._setScriptSnippetContent(uiSourceCode.url(), newContent); 580 this._model._setScriptSnippetContent(uiSourceCode.url(), newContent);
581 callback(''); 581 callback('');
582 } 582 }
583 583
584 /** 584 /**
585 * @override 585 * @override
586 * @param {!Workspace.UISourceCode} uiSourceCode
587 * @return {!Promise<?string>}
588 */
589 requestOriginalFileContent(uiSourceCode) {
590 return Promise.resolve(/** @type {?string} **/ (null));
591 }
592
593 /**
594 * @override
586 * @return {boolean} 595 * @return {boolean}
587 */ 596 */
588 canRename() { 597 canRename() {
589 return true; 598 return true;
590 } 599 }
591 600
592 /** 601 /**
593 * @override 602 * @override
594 * @param {string} url 603 * @param {string} url
595 * @param {string} newName 604 * @param {string} newName
(...skipping 20 matching lines...) Expand all
616 */ 625 */
617 deleteFile(url) { 626 deleteFile(url) {
618 this._model.deleteScriptSnippet(url); 627 this._model.deleteScriptSnippet(url);
619 } 628 }
620 }; 629 };
621 630
622 /** 631 /**
623 * @type {!Snippets.ScriptSnippetModel} 632 * @type {!Snippets.ScriptSnippetModel}
624 */ 633 */
625 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e); 634 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698