OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 WebInspector.ScriptsSearchScope.prototype.__proto__ = WebInspector.SearchScope.p
rototype; | 118 WebInspector.ScriptsSearchScope.prototype.__proto__ = WebInspector.SearchScope.p
rototype; |
119 | 119 |
120 /** | 120 /** |
121 * @constructor | 121 * @constructor |
122 * @extends {WebInspector.FileBasedSearchResultsPane} | 122 * @extends {WebInspector.FileBasedSearchResultsPane} |
123 * @param {WebInspector.SearchConfig} searchConfig | 123 * @param {WebInspector.SearchConfig} searchConfig |
124 */ | 124 */ |
125 WebInspector.ScriptsSearchResultsPane = function(searchConfig) | 125 WebInspector.ScriptsSearchResultsPane = function(searchConfig) |
126 { | 126 { |
127 WebInspector.FileBasedSearchResultsPane.call(this, searchConfig) | 127 WebInspector.FileBasedSearchResultsPane.call(this, searchConfig) |
| 128 |
| 129 this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier(new
WebInspector.ScriptsSearchResultsPane.LinkifierFormatter()); |
128 } | 130 } |
129 | 131 |
130 WebInspector.ScriptsSearchResultsPane.prototype = { | 132 WebInspector.ScriptsSearchResultsPane.prototype = { |
131 /** | 133 /** |
132 * @param {Object} file | 134 * @param {Object} file |
133 * @param {number} lineNumber | 135 * @param {number} lineNumber |
| 136 * @param {number} columnNumber |
134 */ | 137 */ |
135 createAnchor: function(file, lineNumber) | 138 createAnchor: function(file, lineNumber, columnNumber) |
136 { | 139 { |
| 140 |
137 var uiSourceCode = file; | 141 var uiSourceCode = file; |
138 | 142 var rawSourceCode = uiSourceCode.rawSourceCode; |
139 var anchor = WebInspector.linkifyURLAsNode(uiSourceCode.url, ""); | 143 var rawLocation = rawSourceCode.sourceMapping.uiLocationToRawLocation(ui
SourceCode, lineNumber, columnNumber); |
140 anchor.setAttribute("preferred_panel", "scripts"); | 144 var anchor = this._linkifier.linkifyRawSourceCode(uiSourceCode.rawSource
Code, rawLocation.lineNumber, rawLocation.columnNumber); |
141 anchor.uiSourceCode = uiSourceCode; | |
142 anchor.lineNumber = lineNumber; | |
143 anchor.removeChildren(); | 145 anchor.removeChildren(); |
144 | |
145 return anchor; | 146 return anchor; |
146 }, | 147 }, |
147 | 148 |
148 /** | 149 /** |
149 * @param {Object} file | 150 * @param {Object} file |
150 * @return {string} | 151 * @return {string} |
151 */ | 152 */ |
152 fileName: function(file) | 153 fileName: function(file) |
153 { | 154 { |
154 var uiSourceCode = file; | 155 var uiSourceCode = file; |
155 return uiSourceCode.url; | 156 return uiSourceCode.url; |
156 }, | 157 }, |
157 } | 158 } |
158 | 159 |
159 WebInspector.ScriptsSearchResultsPane.prototype.__proto__ = WebInspector.FileBas
edSearchResultsPane.prototype; | 160 WebInspector.ScriptsSearchResultsPane.prototype.__proto__ = WebInspector.FileBas
edSearchResultsPane.prototype; |
| 161 |
| 162 /** |
| 163 * @constructor |
| 164 * @implements {WebInspector.DebuggerPresentationModel.LinkifierFormatter} |
| 165 */ |
| 166 WebInspector.ScriptsSearchResultsPane.LinkifierFormatter = function() |
| 167 { |
| 168 } |
| 169 |
| 170 WebInspector.ScriptsSearchResultsPane.LinkifierFormatter.prototype = { |
| 171 /** |
| 172 * @param {WebInspector.RawSourceCode} rawSourceCode |
| 173 * @param {Element} anchor |
| 174 */ |
| 175 formatRawSourceCodeAnchor: function(rawSourceCode, anchor) |
| 176 { |
| 177 // Empty because we don't want to ever update anchor contents after crea
tion. |
| 178 } |
| 179 } |
| 180 |
| 181 WebInspector.ScriptsSearchResultsPane.LinkifierFormatter.prototype.__proto__ = W
ebInspector.DebuggerPresentationModel.LinkifierFormatter.prototype; |
OLD | NEW |