| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @interface | 32 * @interface |
| 33 */ | 33 */ |
| 34 WebInspector.ProjectSearchConfig = function() {} | 34 WebInspector.ProjectSearchConfig = function() {}; |
| 35 | 35 |
| 36 WebInspector.ProjectSearchConfig.prototype = { | 36 WebInspector.ProjectSearchConfig.prototype = { |
| 37 /** | 37 /** |
| 38 * @return {string} | 38 * @return {string} |
| 39 */ | 39 */ |
| 40 query: function() { }, | 40 query: function() { }, |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * @return {boolean} | 43 * @return {boolean} |
| 44 */ | 44 */ |
| 45 ignoreCase: function() { }, | 45 ignoreCase: function() { }, |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * @return {boolean} | 48 * @return {boolean} |
| 49 */ | 49 */ |
| 50 isRegex: function() { }, | 50 isRegex: function() { }, |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * @return {!Array.<string>} | 53 * @return {!Array.<string>} |
| 54 */ | 54 */ |
| 55 queries: function() { }, | 55 queries: function() { }, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * @param {string} filePath | 58 * @param {string} filePath |
| 59 * @return {boolean} | 59 * @return {boolean} |
| 60 */ | 60 */ |
| 61 filePathMatchesFileQuery: function(filePath) { } | 61 filePathMatchesFileQuery: function(filePath) { } |
| 62 } | 62 }; |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @interface | 65 * @interface |
| 66 */ | 66 */ |
| 67 WebInspector.Project = function() { } | 67 WebInspector.Project = function() { }; |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * @param {!WebInspector.Project} project | 70 * @param {!WebInspector.Project} project |
| 71 * @return {boolean} | 71 * @return {boolean} |
| 72 */ | 72 */ |
| 73 WebInspector.Project.isServiceProject = function(project) | 73 WebInspector.Project.isServiceProject = function(project) |
| 74 { | 74 { |
| 75 return project.type() === WebInspector.projectTypes.Debugger || project.type
() === WebInspector.projectTypes.Formatter || project.type() === WebInspector.pr
ojectTypes.Service; | 75 return project.type() === WebInspector.projectTypes.Debugger || project.type
() === WebInspector.projectTypes.Formatter || project.type() === WebInspector.pr
ojectTypes.Service; |
| 76 } | 76 }; |
| 77 | 77 |
| 78 WebInspector.Project.prototype = { | 78 WebInspector.Project.prototype = { |
| 79 /** | 79 /** |
| 80 * @return {!WebInspector.Workspace} | 80 * @return {!WebInspector.Workspace} |
| 81 */ | 81 */ |
| 82 workspace: function() { }, | 82 workspace: function() { }, |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * @return {string} | 85 * @return {string} |
| 86 */ | 86 */ |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 /** | 177 /** |
| 178 * @param {string} url | 178 * @param {string} url |
| 179 * @return {?WebInspector.UISourceCode} | 179 * @return {?WebInspector.UISourceCode} |
| 180 */ | 180 */ |
| 181 uiSourceCodeForURL: function(url) { }, | 181 uiSourceCodeForURL: function(url) { }, |
| 182 | 182 |
| 183 /** | 183 /** |
| 184 * @return {!Array.<!WebInspector.UISourceCode>} | 184 * @return {!Array.<!WebInspector.UISourceCode>} |
| 185 */ | 185 */ |
| 186 uiSourceCodes: function() { } | 186 uiSourceCodes: function() { } |
| 187 } | 187 }; |
| 188 | 188 |
| 189 /** | 189 /** |
| 190 * @enum {string} | 190 * @enum {string} |
| 191 */ | 191 */ |
| 192 WebInspector.projectTypes = { | 192 WebInspector.projectTypes = { |
| 193 Debugger: "debugger", | 193 Debugger: "debugger", |
| 194 Formatter: "formatter", | 194 Formatter: "formatter", |
| 195 Network: "network", | 195 Network: "network", |
| 196 Snippets: "snippets", | 196 Snippets: "snippets", |
| 197 FileSystem: "filesystem", | 197 FileSystem: "filesystem", |
| 198 ContentScripts: "contentscripts", | 198 ContentScripts: "contentscripts", |
| 199 Service: "service" | 199 Service: "service" |
| 200 } | 200 }; |
| 201 | 201 |
| 202 /** | 202 /** |
| 203 * @constructor | 203 * @constructor |
| 204 * @param {!WebInspector.Workspace} workspace | 204 * @param {!WebInspector.Workspace} workspace |
| 205 * @param {string} id | 205 * @param {string} id |
| 206 * @param {!WebInspector.projectTypes} type | 206 * @param {!WebInspector.projectTypes} type |
| 207 * @param {string} displayName | 207 * @param {string} displayName |
| 208 */ | 208 */ |
| 209 WebInspector.ProjectStore = function(workspace, id, type, displayName) | 209 WebInspector.ProjectStore = function(workspace, id, type, displayName) |
| 210 { | 210 { |
| 211 this._workspace = workspace; | 211 this._workspace = workspace; |
| 212 this._id = id; | 212 this._id = id; |
| 213 this._type = type; | 213 this._type = type; |
| 214 this._displayName = displayName; | 214 this._displayName = displayName; |
| 215 | 215 |
| 216 /** @type {!Map.<string, !{uiSourceCode: !WebInspector.UISourceCode, index:
number}>} */ | 216 /** @type {!Map.<string, !{uiSourceCode: !WebInspector.UISourceCode, index:
number}>} */ |
| 217 this._uiSourceCodesMap = new Map(); | 217 this._uiSourceCodesMap = new Map(); |
| 218 /** @type {!Array.<!WebInspector.UISourceCode>} */ | 218 /** @type {!Array.<!WebInspector.UISourceCode>} */ |
| 219 this._uiSourceCodesList = []; | 219 this._uiSourceCodesList = []; |
| 220 | 220 |
| 221 this._project = /** @type {!WebInspector.Project} */(this); | 221 this._project = /** @type {!WebInspector.Project} */(this); |
| 222 } | 222 }; |
| 223 | 223 |
| 224 WebInspector.ProjectStore.prototype = { | 224 WebInspector.ProjectStore.prototype = { |
| 225 /** | 225 /** |
| 226 * @return {string} | 226 * @return {string} |
| 227 */ | 227 */ |
| 228 id: function() | 228 id: function() |
| 229 { | 229 { |
| 230 return this._id; | 230 return this._id; |
| 231 }, | 231 }, |
| 232 | 232 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 * @param {string} newName | 333 * @param {string} newName |
| 334 */ | 334 */ |
| 335 renameUISourceCode: function(uiSourceCode, newName) | 335 renameUISourceCode: function(uiSourceCode, newName) |
| 336 { | 336 { |
| 337 var oldPath = uiSourceCode.url(); | 337 var oldPath = uiSourceCode.url(); |
| 338 var newPath = uiSourceCode.parentURL() ? uiSourceCode.parentURL() + "/"
+ newName : newName; | 338 var newPath = uiSourceCode.parentURL() ? uiSourceCode.parentURL() + "/"
+ newName : newName; |
| 339 var value = /** @type {!{uiSourceCode: !WebInspector.UISourceCode, index
: number}} */ (this._uiSourceCodesMap.get(oldPath)); | 339 var value = /** @type {!{uiSourceCode: !WebInspector.UISourceCode, index
: number}} */ (this._uiSourceCodesMap.get(oldPath)); |
| 340 this._uiSourceCodesMap.set(newPath, value); | 340 this._uiSourceCodesMap.set(newPath, value); |
| 341 this._uiSourceCodesMap.delete(oldPath); | 341 this._uiSourceCodesMap.delete(oldPath); |
| 342 } | 342 } |
| 343 } | 343 }; |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * @constructor | 346 * @constructor |
| 347 * @extends {WebInspector.Object} | 347 * @extends {WebInspector.Object} |
| 348 */ | 348 */ |
| 349 WebInspector.Workspace = function() | 349 WebInspector.Workspace = function() |
| 350 { | 350 { |
| 351 /** @type {!Map<string, !WebInspector.Project>} */ | 351 /** @type {!Map<string, !WebInspector.Project>} */ |
| 352 this._projects = new Map(); | 352 this._projects = new Map(); |
| 353 this._hasResourceContentTrackingExtensions = false; | 353 this._hasResourceContentTrackingExtensions = false; |
| 354 } | 354 }; |
| 355 | 355 |
| 356 /** @enum {symbol} */ | 356 /** @enum {symbol} */ |
| 357 WebInspector.Workspace.Events = { | 357 WebInspector.Workspace.Events = { |
| 358 UISourceCodeAdded: Symbol("UISourceCodeAdded"), | 358 UISourceCodeAdded: Symbol("UISourceCodeAdded"), |
| 359 UISourceCodeRemoved: Symbol("UISourceCodeRemoved"), | 359 UISourceCodeRemoved: Symbol("UISourceCodeRemoved"), |
| 360 WorkingCopyChanged: Symbol("WorkingCopyChanged"), | 360 WorkingCopyChanged: Symbol("WorkingCopyChanged"), |
| 361 WorkingCopyCommitted: Symbol("WorkingCopyCommitted"), | 361 WorkingCopyCommitted: Symbol("WorkingCopyCommitted"), |
| 362 WorkingCopyCommittedByUser: Symbol("WorkingCopyCommittedByUser"), | 362 WorkingCopyCommittedByUser: Symbol("WorkingCopyCommittedByUser"), |
| 363 ProjectAdded: Symbol("ProjectAdded"), | 363 ProjectAdded: Symbol("ProjectAdded"), |
| 364 ProjectRemoved: Symbol("ProjectRemoved") | 364 ProjectRemoved: Symbol("ProjectRemoved") |
| 365 } | 365 }; |
| 366 | 366 |
| 367 WebInspector.Workspace.prototype = { | 367 WebInspector.Workspace.prototype = { |
| 368 /** | 368 /** |
| 369 * @param {string} projectId | 369 * @param {string} projectId |
| 370 * @param {string} url | 370 * @param {string} url |
| 371 * @return {?WebInspector.UISourceCode} | 371 * @return {?WebInspector.UISourceCode} |
| 372 */ | 372 */ |
| 373 uiSourceCode: function(projectId, url) | 373 uiSourceCode: function(projectId, url) |
| 374 { | 374 { |
| 375 var project = this._projects.get(projectId); | 375 var project = this._projects.get(projectId); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 /** | 475 /** |
| 476 * @return {boolean} | 476 * @return {boolean} |
| 477 */ | 477 */ |
| 478 hasResourceContentTrackingExtensions: function() | 478 hasResourceContentTrackingExtensions: function() |
| 479 { | 479 { |
| 480 return this._hasResourceContentTrackingExtensions; | 480 return this._hasResourceContentTrackingExtensions; |
| 481 }, | 481 }, |
| 482 | 482 |
| 483 __proto__: WebInspector.Object.prototype | 483 __proto__: WebInspector.Object.prototype |
| 484 } | 484 }; |
| 485 | 485 |
| 486 /** | 486 /** |
| 487 * @type {!WebInspector.Workspace} | 487 * @type {!WebInspector.Workspace} |
| 488 */ | 488 */ |
| 489 WebInspector.workspace; | 489 WebInspector.workspace; |
| OLD | NEW |