| 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 22 matching lines...) Expand all Loading... |
| 33 * @extends {WebInspector.Object} | 33 * @extends {WebInspector.Object} |
| 34 */ | 34 */ |
| 35 WebInspector.IsolatedFileSystemManager = function() | 35 WebInspector.IsolatedFileSystemManager = function() |
| 36 { | 36 { |
| 37 /** @type {!Object.<string, !WebInspector.IsolatedFileSystem>} */ | 37 /** @type {!Object.<string, !WebInspector.IsolatedFileSystem>} */ |
| 38 this._fileSystems = {}; | 38 this._fileSystems = {}; |
| 39 | 39 |
| 40 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemsLoaded, this._onFileSystemsLoaded, this); | 40 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemsLoaded, this._onFileSystemsLoaded, this); |
| 41 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemRemoved, this._onFileSystemRemoved, this); | 41 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemRemoved, this._onFileSystemRemoved, this); |
| 42 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemAdded, this._onFileSystemAdded, this); | 42 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemAdded, this._onFileSystemAdded, this); |
| 43 InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Event
s.FileSystemFilesChanged, this._onFileSystemFilesChanged, this); |
| 43 | 44 |
| 44 this._initExcludePatterSetting(); | 45 this._initExcludePatterSetting(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 /** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}
} */ | 48 /** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}
} */ |
| 48 WebInspector.IsolatedFileSystemManager.FileSystem; | 49 WebInspector.IsolatedFileSystemManager.FileSystem; |
| 49 | 50 |
| 50 WebInspector.IsolatedFileSystemManager.Events = { | 51 WebInspector.IsolatedFileSystemManager.Events = { |
| 51 FileSystemAdded: "FileSystemAdded", | 52 FileSystemAdded: "FileSystemAdded", |
| 52 FileSystemRemoved: "FileSystemRemoved", | 53 FileSystemRemoved: "FileSystemRemoved", |
| 53 FileSystemsLoaded: "FileSystemsLoaded", | 54 FileSystemsLoaded: "FileSystemsLoaded", |
| 55 FileSystemFilesChanged: "FileSystemFilesChanged", |
| 54 ExcludedFolderAdded: "ExcludedFolderAdded", | 56 ExcludedFolderAdded: "ExcludedFolderAdded", |
| 55 ExcludedFolderRemoved: "ExcludedFolderRemoved" | 57 ExcludedFolderRemoved: "ExcludedFolderRemoved" |
| 56 } | 58 } |
| 57 | 59 |
| 58 WebInspector.IsolatedFileSystemManager.prototype = { | 60 WebInspector.IsolatedFileSystemManager.prototype = { |
| 59 /** | 61 /** |
| 60 * @param {function()} callback | 62 * @param {function()} callback |
| 61 */ | 63 */ |
| 62 initialize: function(callback) | 64 initialize: function(callback) |
| 63 { | 65 { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 151 |
| 150 /** | 152 /** |
| 151 * @param {!WebInspector.Event} event | 153 * @param {!WebInspector.Event} event |
| 152 */ | 154 */ |
| 153 _onFileSystemRemoved: function(event) | 155 _onFileSystemRemoved: function(event) |
| 154 { | 156 { |
| 155 this._fileSystemRemoved(/** @type {string} */ (event.data)); | 157 this._fileSystemRemoved(/** @type {string} */ (event.data)); |
| 156 }, | 158 }, |
| 157 | 159 |
| 158 /** | 160 /** |
| 161 * @param {!WebInspector.Event} event |
| 162 */ |
| 163 _onFileSystemFilesChanged: function(event) |
| 164 { |
| 165 this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Eve
nts.FileSystemFilesChanged, event.data); |
| 166 }, |
| 167 |
| 168 /** |
| 159 * @param {string} fileSystemPath | 169 * @param {string} fileSystemPath |
| 160 */ | 170 */ |
| 161 _fileSystemRemoved: function(fileSystemPath) | 171 _fileSystemRemoved: function(fileSystemPath) |
| 162 { | 172 { |
| 163 var isolatedFileSystem = this._fileSystems[fileSystemPath]; | 173 var isolatedFileSystem = this._fileSystems[fileSystemPath]; |
| 164 delete this._fileSystems[fileSystemPath]; | 174 delete this._fileSystems[fileSystemPath]; |
| 165 if (isolatedFileSystem) { | 175 if (isolatedFileSystem) { |
| 166 isolatedFileSystem.fileSystemRemoved(); | 176 isolatedFileSystem.fileSystemRemoved(); |
| 167 this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager
.Events.FileSystemRemoved, isolatedFileSystem); | 177 this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager
.Events.FileSystemRemoved, isolatedFileSystem); |
| 168 } | 178 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return this._workspaceFolderExcludePatternSetting; | 244 return this._workspaceFolderExcludePatternSetting; |
| 235 }, | 245 }, |
| 236 | 246 |
| 237 __proto__: WebInspector.Object.prototype | 247 __proto__: WebInspector.Object.prototype |
| 238 } | 248 } |
| 239 | 249 |
| 240 /** | 250 /** |
| 241 * @type {!WebInspector.IsolatedFileSystemManager} | 251 * @type {!WebInspector.IsolatedFileSystemManager} |
| 242 */ | 252 */ |
| 243 WebInspector.isolatedFileSystemManager; | 253 WebInspector.isolatedFileSystemManager; |
| OLD | NEW |