Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js

Issue 2893073002: DevTools: introduce ResourceMapping (Closed)
Patch Set: rebaseline Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** 5 /**
6 * @implements {SDK.SDKModelObserver<!SDK.CSSModel>} 6 * @implements {SDK.SDKModelObserver<!SDK.CSSModel>}
7 */ 7 */
8 Bindings.CSSWorkspaceBinding = class { 8 Bindings.CSSWorkspaceBinding = class {
9 /** 9 /**
10 * @param {!SDK.TargetManager} targetManager 10 * @param {!SDK.TargetManager} targetManager
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 */ 133 */
134 uiLocationToRawLocations(uiLocation) {}, 134 uiLocationToRawLocations(uiLocation) {},
135 }; 135 };
136 136
137 Bindings.CSSWorkspaceBinding.ModelInfo = class { 137 Bindings.CSSWorkspaceBinding.ModelInfo = class {
138 /** 138 /**
139 * @param {!SDK.CSSModel} cssModel 139 * @param {!SDK.CSSModel} cssModel
140 * @param {!Workspace.Workspace} workspace 140 * @param {!Workspace.Workspace} workspace
141 */ 141 */
142 constructor(cssModel, workspace) { 142 constructor(cssModel, workspace) {
143 this._target = cssModel.target();
dgozman 2017/06/12 18:48:50 drop
lushnikov 2017/06/12 22:05:56 Done.
143 this._eventListeners = [ 144 this._eventListeners = [
144 cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._style SheetAdded, this), 145 cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._style SheetAdded, this),
145 cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._sty leSheetRemoved, this) 146 cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._sty leSheetRemoved, this)
146 ]; 147 ];
147 148
148 this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, works pace); 149 this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, works pace);
149 var sourceMapManager = cssModel.sourceMapManager(); 150 var sourceMapManager = cssModel.sourceMapManager();
150 this._sassSourceMapping = new Bindings.SASSSourceMapping(cssModel.target(), sourceMapManager, workspace); 151 this._sassSourceMapping = new Bindings.SASSSourceMapping(cssModel.target(), sourceMapManager, workspace);
151 152
152 /** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.CSSWorkspaceBinding .LiveLocation>} */ 153 /** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.CSSWorkspaceBinding .LiveLocation>} */
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 223 }
223 224
224 /** 225 /**
225 * @param {!SDK.CSSLocation} rawLocation 226 * @param {!SDK.CSSLocation} rawLocation
226 * @return {?Workspace.UILocation} 227 * @return {?Workspace.UILocation}
227 */ 228 */
228 _rawLocationToUILocation(rawLocation) { 229 _rawLocationToUILocation(rawLocation) {
229 var uiLocation = null; 230 var uiLocation = null;
230 uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(r awLocation); 231 uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(r awLocation);
231 uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation (rawLocation); 232 uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation (rawLocation);
232 return uiLocation; 233 if (uiLocation)
234 return uiLocation;
235 var uiSourceCode = Bindings.resourceBindingManager.uiSourceCodeForURL(this._ target, rawLocation.url);
dgozman 2017/06/12 18:48:50 cssLocationToUILocation(cssLocation) and jsLocatio
lushnikov 2017/06/12 22:05:56 Done.
236 return uiSourceCode ? uiSourceCode.uiLocation(rawLocation.lineNumber, rawLoc ation.columnNumber) : null;
233 } 237 }
234 238
235 /** 239 /**
236 * @param {!Workspace.UILocation} uiLocation 240 * @param {!Workspace.UILocation} uiLocation
237 * @return {!Array<!SDK.CSSLocation>} 241 * @return {!Array<!SDK.CSSLocation>}
238 */ 242 */
239 _uiLocationToRawLocations(uiLocation) { 243 _uiLocationToRawLocations(uiLocation) {
240 var rawLocations = this._sassSourceMapping.uiLocationToRawLocations(uiLocati on); 244 var rawLocations = this._sassSourceMapping.uiLocationToRawLocations(uiLocati on);
241 if (rawLocations.length) 245 if (rawLocations.length)
242 return rawLocations; 246 return rawLocations;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 */ 298 */
295 isBlackboxed() { 299 isBlackboxed() {
296 return false; 300 return false;
297 } 301 }
298 }; 302 };
299 303
300 /** 304 /**
301 * @type {!Bindings.CSSWorkspaceBinding} 305 * @type {!Bindings.CSSWorkspaceBinding}
302 */ 306 */
303 Bindings.cssWorkspaceBinding; 307 Bindings.cssWorkspaceBinding;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698