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

Side by Side Diff: Source/devtools/front_end/sdk/Linkifier.js

Issue 299443016: DevTools: Decouple debugger model from UI entities (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge DebuggerScriptMapping into DebuggerWorkspaceBinding Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 * @return {!Element} 151 * @return {!Element}
152 */ 152 */
153 linkifyScriptLocation: function(target, scriptId, sourceURL, lineNumber, col umnNumber, classes) 153 linkifyScriptLocation: function(target, scriptId, sourceURL, lineNumber, col umnNumber, classes)
154 { 154 {
155 var rawLocation = target && !target.isDetached() ? target.debuggerModel. createRawLocationByScriptId(scriptId, sourceURL, lineNumber, columnNumber || 0) : null; 155 var rawLocation = target && !target.isDetached() ? target.debuggerModel. createRawLocationByScriptId(scriptId, sourceURL, lineNumber, columnNumber || 0) : null;
156 var fallbackAnchor = WebInspector.linkifyResourceAsNode(sourceURL, lineN umber, classes); 156 var fallbackAnchor = WebInspector.linkifyResourceAsNode(sourceURL, lineN umber, classes);
157 if (!rawLocation) 157 if (!rawLocation)
158 return fallbackAnchor; 158 return fallbackAnchor;
159 159
160 var anchor = this._createAnchor(classes); 160 var anchor = this._createAnchor(classes);
161 var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bin d(this, anchor)); 161 var liveLocation = WebInspector.debuggerWorkspaceBinding.createLiveLocat ion(rawLocation, this._updateAnchor.bind(this, anchor));
162 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation}); 162 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation});
163 anchor.__fallbackAnchor = fallbackAnchor; 163 anchor.__fallbackAnchor = fallbackAnchor;
164 return anchor; 164 return anchor;
165 }, 165 },
166 166
167 /** 167 /**
168 * @param {!WebInspector.DebuggerModel.Location} rawLocation 168 * @param {!WebInspector.DebuggerModel.Location} rawLocation
169 * @param {string} fallbackUrl 169 * @param {string} fallbackUrl
170 * @param {string=} classes 170 * @param {string=} classes
171 * @return {!Element} 171 * @return {!Element}
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 */ 352 */
353 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber) 353 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber)
354 { 354 {
355 var script = target.debuggerModel.scriptForId(scriptId); 355 var script = target.debuggerModel.scriptForId(scriptId);
356 if (!script) 356 if (!script)
357 return ""; 357 return "";
358 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0)); 358 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0));
359 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug gerWorkspaceBinding.rawLocationToUILocation(location)); 359 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug gerWorkspaceBinding.rawLocationToUILocation(location));
360 return uiLocation.linkText(); 360 return uiLocation.linkText();
361 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698