Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1349 * @param {!Object} object | 1349 * @param {!Object} object |
| 1350 * @return {!Promise} | 1350 * @return {!Promise} |
| 1351 */ | 1351 */ |
| 1352 reveal: function(object) | 1352 reveal: function(object) |
| 1353 { | 1353 { |
| 1354 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.ins tance()); | 1354 WebInspector.inspectorView.setCurrentPanel(WebInspector.SourcesPanel.ins tance()); |
| 1355 return Promise.resolve(); | 1355 return Promise.resolve(); |
| 1356 } | 1356 } |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 | |
| 1360 /** | |
| 1361 * @constructor | |
| 1362 * @implements {WebInspector.Revealer} | |
| 1363 */ | |
| 1364 WebInspector.SourcesPanel.LineMessageRevealer = function() | |
| 1365 { | |
| 1366 } | |
| 1367 | |
| 1368 WebInspector.SourcesPanel.LineMessageRevealer.prototype = { | |
| 1369 /** | |
| 1370 * @override | |
| 1371 * @param {!Object} object | |
| 1372 * @return {!Promise} | |
| 1373 */ | |
| 1374 reveal: function(object) | |
| 1375 { | |
| 1376 var container = /** @type {!WebInspector.UISourceCodeMessages} */ (objec t); | |
| 1377 if (!(container.messages() instanceof Array)) | |
|
pfeldman
2015/10/21 23:47:53
There is a compile-time check for this.
wes
2015/10/23 20:35:30
How so? container is cast from Object to the data
| |
| 1378 return Promise.reject(new Error("Internal error: messages member not an array of line message definition objects")); | |
| 1379 if (!(container.source() instanceof WebInspector.UISourceCode)) | |
| 1380 return Promise.reject(new Error("Internal error: code member not a U ISourceCode objects")); | |
| 1381 | |
| 1382 var frame = WebInspector.SourcesPanel.instance().sourcesView().viewForFi le(container.source()); | |
| 1383 frame.setMessagesForSource(container.messages().map(function(m){ | |
|
pfeldman
2015/10/21 23:47:53
Revealers are for revealing things, not for popula
wes
2015/10/23 04:51:01
I'd actually wavered on if squiggles should be sta
| |
| 1384 return new WebInspector.SourceFrameMessage(m.text(), WebInspector.So urceFrameMessage.Level[m.kind()], { | |
| 1385 line: m.location().startLine, | |
| 1386 column: m.location().startColumn | |
| 1387 }, { | |
| 1388 line: m.location().endLine, | |
| 1389 column: m.location().endColumn | |
| 1390 }); | |
| 1391 })); | |
| 1392 | |
| 1393 return Promise.resolve(); | |
| 1394 } | |
| 1395 } | |
| 1396 | |
| 1359 /** | 1397 /** |
| 1360 * @constructor | 1398 * @constructor |
| 1361 * @implements {WebInspector.ActionDelegate} | 1399 * @implements {WebInspector.ActionDelegate} |
| 1362 */ | 1400 */ |
| 1363 WebInspector.SourcesPanel.RevealingActionDelegate = function() {} | 1401 WebInspector.SourcesPanel.RevealingActionDelegate = function() {} |
| 1364 | 1402 |
| 1365 WebInspector.SourcesPanel.RevealingActionDelegate.prototype = { | 1403 WebInspector.SourcesPanel.RevealingActionDelegate.prototype = { |
| 1366 /** | 1404 /** |
| 1367 * @override | 1405 * @override |
| 1368 * @param {!WebInspector.Context} context | 1406 * @param {!WebInspector.Context} context |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1449 WebInspector.SourcesPanelFactory.prototype = { | 1487 WebInspector.SourcesPanelFactory.prototype = { |
| 1450 /** | 1488 /** |
| 1451 * @override | 1489 * @override |
| 1452 * @return {!WebInspector.Panel} | 1490 * @return {!WebInspector.Panel} |
| 1453 */ | 1491 */ |
| 1454 createPanel: function() | 1492 createPanel: function() |
| 1455 { | 1493 { |
| 1456 return WebInspector.SourcesPanel.instance(); | 1494 return WebInspector.SourcesPanel.instance(); |
| 1457 } | 1495 } |
| 1458 } | 1496 } |
| OLD | NEW |