| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {WebInspector.TargetManager.Observer} | 7 * @implements {WebInspector.TargetManager.Observer} |
| 8 * @param {!WebInspector.TargetManager} targetManager | 8 * @param {!WebInspector.TargetManager} targetManager |
| 9 * @param {!WebInspector.Workspace} workspace | 9 * @param {!WebInspector.Workspace} workspace |
| 10 * @param {!WebInspector.NetworkMapping} networkMapping | 10 * @param {!WebInspector.NetworkMapping} networkMapping |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 */ | 93 */ |
| 94 updateLocations: function(header) | 94 updateLocations: function(header) |
| 95 { | 95 { |
| 96 var info = this._headerInfo(header); | 96 var info = this._headerInfo(header); |
| 97 if (info) | 97 if (info) |
| 98 info._updateLocations(); | 98 info._updateLocations(); |
| 99 }, | 99 }, |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * @param {!WebInspector.CSSLocation} rawLocation | 102 * @param {!WebInspector.CSSLocation} rawLocation |
| 103 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel
egate | 103 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 104 * @return {!WebInspector.CSSWorkspaceBinding.LiveLocation} | 104 * @return {!WebInspector.CSSWorkspaceBinding.LiveLocation} |
| 105 */ | 105 */ |
| 106 createLiveLocation: function(rawLocation, updateDelegate) | 106 createLiveLocation: function(rawLocation, updateDelegate) |
| 107 { | 107 { |
| 108 var header = rawLocation.styleSheetId ? rawLocation.cssModel().styleShee
tHeaderForId(rawLocation.styleSheetId) : null; | 108 var header = rawLocation.styleSheetId ? rawLocation.cssModel().styleShee
tHeaderForId(rawLocation.styleSheetId) : null; |
| 109 return new WebInspector.CSSWorkspaceBinding.LiveLocation(rawLocation.css
Model(), header, rawLocation, this, updateDelegate); | 109 return new WebInspector.CSSWorkspaceBinding.LiveLocation(rawLocation.css
Model(), header, rawLocation, this, updateDelegate); |
| 110 }, | 110 }, |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location | 113 * @param {!WebInspector.CSSWorkspaceBinding.LiveLocation} location |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 /** | 310 /** |
| 311 * @constructor | 311 * @constructor |
| 312 * @extends {WebInspector.LiveLocation} | 312 * @extends {WebInspector.LiveLocation} |
| 313 * @param {!WebInspector.CSSStyleModel} cssModel | 313 * @param {!WebInspector.CSSStyleModel} cssModel |
| 314 * @param {?WebInspector.CSSStyleSheetHeader} header | 314 * @param {?WebInspector.CSSStyleSheetHeader} header |
| 315 * @param {!WebInspector.CSSLocation} rawLocation | 315 * @param {!WebInspector.CSSLocation} rawLocation |
| 316 * @param {!WebInspector.CSSWorkspaceBinding} binding | 316 * @param {!WebInspector.CSSWorkspaceBinding} binding |
| 317 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat
e | 317 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 318 */ | 318 */ |
| 319 WebInspector.CSSWorkspaceBinding.LiveLocation = function(cssModel, header, rawLo
cation, binding, updateDelegate) | 319 WebInspector.CSSWorkspaceBinding.LiveLocation = function(cssModel, header, rawLo
cation, binding, updateDelegate) |
| 320 { | 320 { |
| 321 WebInspector.LiveLocation.call(this, updateDelegate); | 321 WebInspector.LiveLocation.call(this, updateDelegate); |
| 322 this._cssModel = cssModel; | 322 this._cssModel = cssModel; |
| 323 this._rawLocation = rawLocation; | 323 this._rawLocation = rawLocation; |
| 324 this._binding = binding; | 324 this._binding = binding; |
| 325 if (!header) | 325 if (!header) |
| 326 this._clearStyleSheet(); | 326 this._clearStyleSheet(); |
| 327 else | 327 else |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 { | 368 { |
| 369 delete this._header; | 369 delete this._header; |
| 370 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetRemoved, this._styleSheetRemoved, this); | 370 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetRemoved, this._styleSheetRemoved, this); |
| 371 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetAdded, this._styleSheetAdded, this); | 371 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleS
heetAdded, this._styleSheetAdded, this); |
| 372 }, | 372 }, |
| 373 | 373 |
| 374 /** | 374 /** |
| 375 * @override | 375 * @override |
| 376 * @return {?WebInspector.UILocation} | 376 * @return {?WebInspector.UILocation} |
| 377 */ | 377 */ |
| 378 uiLocation: function() | 378 _updateUILocation: function() |
| 379 { | 379 { |
| 380 var cssLocation = this._rawLocation; | 380 var cssLocation = this._rawLocation; |
| 381 if (this._header) { | 381 if (this._header) { |
| 382 var headerInfo = this._binding._headerInfo(this._header); | 382 var headerInfo = this._binding._headerInfo(this._header); |
| 383 return headerInfo._rawLocationToUILocation(cssLocation.lineNumber, c
ssLocation.columnNumber); | 383 return headerInfo._rawLocationToUILocation(cssLocation.lineNumber, c
ssLocation.columnNumber); |
| 384 } | 384 } |
| 385 var uiSourceCode = this._binding._networkMapping.uiSourceCodeForStyleURL
(cssLocation.url, cssLocation.header()); | 385 var uiSourceCode = this._binding._networkMapping.uiSourceCodeForStyleURL
(cssLocation.url, cssLocation.header()); |
| 386 if (!uiSourceCode) | 386 if (!uiSourceCode) |
| 387 return null; | 387 return null; |
| 388 return uiSourceCode.uiLocation(cssLocation.lineNumber, cssLocation.colum
nNumber); | 388 return uiSourceCode.uiLocation(cssLocation.lineNumber, cssLocation.colum
nNumber); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 * @param {number} lineNumber | 432 * @param {number} lineNumber |
| 433 * @return {boolean} | 433 * @return {boolean} |
| 434 */ | 434 */ |
| 435 uiLineHasMapping: function(uiSourceCode, lineNumber) { } | 435 uiLineHasMapping: function(uiSourceCode, lineNumber) { } |
| 436 } | 436 } |
| 437 | 437 |
| 438 /** | 438 /** |
| 439 * @type {!WebInspector.CSSWorkspaceBinding} | 439 * @type {!WebInspector.CSSWorkspaceBinding} |
| 440 */ | 440 */ |
| 441 WebInspector.cssWorkspaceBinding; | 441 WebInspector.cssWorkspaceBinding; |
| OLD | NEW |