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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 /** | 104 /** |
105 * @param {!WebInspector.CSSStyleSheetHeader} header | 105 * @param {!WebInspector.CSSStyleSheetHeader} header |
106 */ | 106 */ |
107 addHeader: function(header) | 107 addHeader: function(header) |
108 { | 108 { |
109 var url = header.resourceURL(); | 109 var url = header.resourceURL(); |
110 if (!url) | 110 if (!url) |
111 return; | 111 return; |
112 | 112 |
113 header.pushSourceMapping(this); | 113 WebInspector.cssWorkspaceBinding.pushSourceMapping(header, this); |
114 var map = this._urlToHeadersByFrameId[url]; | 114 var map = this._urlToHeadersByFrameId[url]; |
115 if (!map) { | 115 if (!map) { |
116 map = /** @type {!StringMap.<!StringMap.<!WebInspector.CSSStyleSheet
Header>>} */ (new StringMap()); | 116 map = /** @type {!StringMap.<!StringMap.<!WebInspector.CSSStyleSheet
Header>>} */ (new StringMap()); |
117 this._urlToHeadersByFrameId[url] = map; | 117 this._urlToHeadersByFrameId[url] = map; |
118 } | 118 } |
119 var headersById = map.get(header.frameId); | 119 var headersById = map.get(header.frameId); |
120 if (!headersById) { | 120 if (!headersById) { |
121 headersById = /** @type {!StringMap.<!WebInspector.CSSStyleSheetHead
er>} */ (new StringMap()); | 121 headersById = /** @type {!StringMap.<!WebInspector.CSSStyleSheetHead
er>} */ (new StringMap()); |
122 map.put(header.frameId, headersById); | 122 map.put(header.frameId, headersById); |
123 } | 123 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 /** | 180 /** |
181 * @param {!WebInspector.UISourceCode} uiSourceCode | 181 * @param {!WebInspector.UISourceCode} uiSourceCode |
182 * @param {!WebInspector.CSSStyleSheetHeader} header | 182 * @param {!WebInspector.CSSStyleSheetHeader} header |
183 */ | 183 */ |
184 _bindUISourceCode: function(uiSourceCode, header) | 184 _bindUISourceCode: function(uiSourceCode, header) |
185 { | 185 { |
186 if (this._styleFiles.get(uiSourceCode) || header.isInline) | 186 if (this._styleFiles.get(uiSourceCode) || header.isInline) |
187 return; | 187 return; |
188 var url = uiSourceCode.url; | 188 var url = uiSourceCode.url; |
189 this._styleFiles.put(uiSourceCode, new WebInspector.StyleFile(uiSourceCo
de, this)); | 189 this._styleFiles.put(uiSourceCode, new WebInspector.StyleFile(uiSourceCo
de, this)); |
190 header.updateLocations(); | 190 WebInspector.cssWorkspaceBinding.updateLocations(header); |
191 }, | 191 }, |
192 | 192 |
193 /** | 193 /** |
194 * @param {!WebInspector.Event} event | 194 * @param {!WebInspector.Event} event |
195 */ | 195 */ |
196 _projectRemoved: function(event) | 196 _projectRemoved: function(event) |
197 { | 197 { |
198 var project = /** @type {!WebInspector.Project} */ (event.data); | 198 var project = /** @type {!WebInspector.Project} */ (event.data); |
199 var uiSourceCodes = project.uiSourceCodes(); | 199 var uiSourceCodes = project.uiSourceCodes(); |
200 for (var i = 0; i < uiSourceCodes.length; ++i) | 200 for (var i = 0; i < uiSourceCodes.length; ++i) |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 this._uiSourceCode.addRevision(content); | 391 this._uiSourceCode.addRevision(content); |
392 delete this._isAddingRevision; | 392 delete this._isAddingRevision; |
393 }, | 393 }, |
394 | 394 |
395 dispose: function() | 395 dispose: function() |
396 { | 396 { |
397 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyCommitted, this._workingCopyCommitted, this); | 397 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyCommitted, this._workingCopyCommitted, this); |
398 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyChanged, this._workingCopyChanged, this); | 398 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyChanged, this._workingCopyChanged, this); |
399 } | 399 } |
400 } | 400 } |
OLD | NEW |