OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 /** | 4 /** |
5 * @implements {SDK.TargetManager.Observer} | 5 * @implements {SDK.TargetManager.Observer} |
6 * @unrestricted | 6 * @unrestricted |
7 */ | 7 */ |
8 Bindings.CSSWorkspaceBinding = class { | 8 Bindings.CSSWorkspaceBinding = class { |
9 /** | 9 /** |
10 * @param {!SDK.TargetManager} targetManager | 10 * @param {!SDK.TargetManager} targetManager |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 /** | 140 /** |
141 * @unrestricted | 141 * @unrestricted |
142 */ | 142 */ |
143 Bindings.CSSWorkspaceBinding.TargetInfo = class { | 143 Bindings.CSSWorkspaceBinding.TargetInfo = class { |
144 /** | 144 /** |
145 * @param {!SDK.CSSModel} cssModel | 145 * @param {!SDK.CSSModel} cssModel |
146 * @param {!Workspace.Workspace} workspace | 146 * @param {!Workspace.Workspace} workspace |
147 */ | 147 */ |
148 constructor(cssModel, workspace) { | 148 constructor(cssModel, workspace) { |
149 this._cssModel = cssModel; | 149 this._cssModel = cssModel; |
150 this._workspace = workspace; | |
151 var networkProject = Bindings.NetworkProject.forTarget(cssModel.target()); | |
150 this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, works pace); | 152 this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, works pace); |
151 this._sassSourceMapping = | 153 this._sassSourceMapping = new Bindings.SASSSourceMapping(cssModel, workspace , networkProject); |
152 new Bindings.SASSSourceMapping(cssModel, workspace, Bindings.NetworkProj ect.forTarget(cssModel.target())); | |
153 | 154 |
154 /** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.LiveLocation>} */ | 155 /** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.LiveLocation>} */ |
155 this._locations = new Multimap(); | 156 this._locations = new Multimap(); |
156 } | 157 } |
157 | 158 |
158 /** | 159 /** |
159 * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location | 160 * @param {!Bindings.CSSWorkspaceBinding.LiveLocation} location |
160 */ | 161 */ |
161 _addLocation(location) { | 162 _addLocation(location) { |
162 var header = location._header; | 163 var header = location._header; |
(...skipping 20 matching lines...) Expand all Loading... | |
183 * @param {!SDK.CSSStyleSheetHeader} header | 184 * @param {!SDK.CSSStyleSheetHeader} header |
184 * @param {number} lineNumber | 185 * @param {number} lineNumber |
185 * @param {number=} columnNumber | 186 * @param {number=} columnNumber |
186 * @return {?Workspace.UILocation} | 187 * @return {?Workspace.UILocation} |
187 */ | 188 */ |
188 _rawLocationToUILocation(header, lineNumber, columnNumber) { | 189 _rawLocationToUILocation(header, lineNumber, columnNumber) { |
189 var rawLocation = new SDK.CSSLocation(header, lineNumber, columnNumber); | 190 var rawLocation = new SDK.CSSLocation(header, lineNumber, columnNumber); |
190 var uiLocation = null; | 191 var uiLocation = null; |
191 uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(r awLocation); | 192 uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(r awLocation); |
192 uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation (rawLocation); | 193 uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation (rawLocation); |
193 return uiLocation; | 194 if (uiLocation) |
195 return uiLocation; | |
196 | |
197 var uiSourceCode = | |
lushnikov
2017/02/15 05:18:48
in future, this green chunk should be:
uiLocat
| |
198 Bindings.NetworkProject.uiSourceCodeForStyleURL(this._workspace, rawLoca tion.url, rawLocation.header()); | |
199 if (!uiSourceCode) | |
200 return null; | |
201 return uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNum ber); | |
194 } | 202 } |
195 | 203 |
196 _dispose() { | 204 _dispose() { |
197 this._stylesSourceMapping.dispose(); | 205 this._stylesSourceMapping.dispose(); |
198 this._sassSourceMapping.dispose(); | 206 this._sassSourceMapping.dispose(); |
199 } | 207 } |
200 }; | 208 }; |
201 | 209 |
202 /** | 210 /** |
203 * @unrestricted | 211 * @unrestricted |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 */ | 302 */ |
295 isBlackboxed() { | 303 isBlackboxed() { |
296 return false; | 304 return false; |
297 } | 305 } |
298 }; | 306 }; |
299 | 307 |
300 /** | 308 /** |
301 * @type {!Bindings.CSSWorkspaceBinding} | 309 * @type {!Bindings.CSSWorkspaceBinding} |
302 */ | 310 */ |
303 Bindings.cssWorkspaceBinding; | 311 Bindings.cssWorkspaceBinding; |
OLD | NEW |