| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 /** @type {!Map.<!SDK.Target, !Snippets.SnippetScriptMapping>} */ | 46 /** @type {!Map.<!SDK.Target, !Snippets.SnippetScriptMapping>} */ |
| 47 this._mappingForTarget = new Map(); | 47 this._mappingForTarget = new Map(); |
| 48 this._snippetStorage = new Snippets.SnippetStorage('script', 'Script snippet
#'); | 48 this._snippetStorage = new Snippets.SnippetStorage('script', 'Script snippet
#'); |
| 49 this._lastSnippetEvaluationIndexSetting = Common.settings.createSetting('las
tSnippetEvaluationIndex', 0); | 49 this._lastSnippetEvaluationIndexSetting = Common.settings.createSetting('las
tSnippetEvaluationIndex', 0); |
| 50 this._project = new Snippets.SnippetsProject(workspace, this); | 50 this._project = new Snippets.SnippetsProject(workspace, this); |
| 51 this._loadSnippets(); | 51 this._loadSnippets(); |
| 52 SDK.targetManager.observeTargets(this); | 52 SDK.targetManager.observeTargets(this); |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * @param {!Workspace.UISourceCode} uiSourceCode |
| 57 * @return {boolean} |
| 58 */ |
| 59 static isSnippetUISourceCode(uiSourceCode) { |
| 60 return uiSourceCode.project().type() === Workspace.projectTypes.Snippets; |
| 61 } |
| 62 |
| 63 /** |
| 56 * @override | 64 * @override |
| 57 * @param {!SDK.Target} target | 65 * @param {!SDK.Target} target |
| 58 */ | 66 */ |
| 59 targetAdded(target) { | 67 targetAdded(target) { |
| 60 var debuggerModel = SDK.DebuggerModel.fromTarget(target); | 68 var debuggerModel = SDK.DebuggerModel.fromTarget(target); |
| 61 if (debuggerModel) | 69 if (debuggerModel) |
| 62 this._mappingForTarget.set(target, new Snippets.SnippetScriptMapping(debug
gerModel, this)); | 70 this._mappingForTarget.set(target, new Snippets.SnippetScriptMapping(debug
gerModel, this)); |
| 63 } | 71 } |
| 64 | 72 |
| 65 /** | 73 /** |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 */ | 626 */ |
| 619 deleteFile(url) { | 627 deleteFile(url) { |
| 620 this._model.deleteScriptSnippet(url); | 628 this._model.deleteScriptSnippet(url); |
| 621 } | 629 } |
| 622 }; | 630 }; |
| 623 | 631 |
| 624 /** | 632 /** |
| 625 * @type {!Snippets.ScriptSnippetModel} | 633 * @type {!Snippets.ScriptSnippetModel} |
| 626 */ | 634 */ |
| 627 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac
e); | 635 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac
e); |
| OLD | NEW |