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

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

Issue 2889013002: DevTools: introduce uiSourceCode.mimeType() method (Closed)
Patch Set: address comments Created 3 years, 7 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 super(workspace, 'snippets:', Workspace.projectTypes.Snippets, '', false /* isServiceProject */); 545 super(workspace, 'snippets:', Workspace.projectTypes.Snippets, '', false /* isServiceProject */);
546 this._model = model; 546 this._model = model;
547 } 547 }
548 548
549 /** 549 /**
550 * @param {string} name 550 * @param {string} name
551 * @param {!Common.ContentProvider} contentProvider 551 * @param {!Common.ContentProvider} contentProvider
552 * @return {!Workspace.UISourceCode} 552 * @return {!Workspace.UISourceCode}
553 */ 553 */
554 addSnippet(name, contentProvider) { 554 addSnippet(name, contentProvider) {
555 return this.addContentProvider(name, contentProvider); 555 return this.addContentProvider(name, contentProvider, 'text/javascript');
556 } 556 }
557 557
558 /** 558 /**
559 * @override 559 * @override
560 * @return {boolean} 560 * @return {boolean}
561 */ 561 */
562 canSetFileContent() { 562 canSetFileContent() {
563 return true; 563 return true;
564 } 564 }
565 565
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 */ 609 */
610 deleteFile(uiSourceCode) { 610 deleteFile(uiSourceCode) {
611 this._model.deleteScriptSnippet(uiSourceCode); 611 this._model.deleteScriptSnippet(uiSourceCode);
612 } 612 }
613 }; 613 };
614 614
615 /** 615 /**
616 * @type {!Snippets.ScriptSnippetModel} 616 * @type {!Snippets.ScriptSnippetModel}
617 */ 617 */
618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e); 618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac e);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698