Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 if (table) | 128 if (table) |
| 129 table = this._parameterToRemoteObject(table); | 129 table = this._parameterToRemoteObject(table); |
| 130 if (!table || !table.preview) | 130 if (!table || !table.preview) |
| 131 return formattedMessage; | 131 return formattedMessage; |
| 132 | 132 |
| 133 var columnNames = []; | 133 var columnNames = []; |
| 134 var preview = table.preview; | 134 var preview = table.preview; |
| 135 var rows = []; | 135 var rows = []; |
| 136 for (var i = 0; i < preview.properties.length; ++i) { | 136 for (var i = 0; i < preview.properties.length; ++i) { |
| 137 var rowProperty = preview.properties[i]; | 137 var rowProperty = preview.properties[i]; |
| 138 var rowPreview = rowProperty.valuePreview; | 138 var rowSubProperties; |
| 139 if (!rowPreview) | 139 if (rowProperty.valuePreview) |
| 140 rowSubProperties = rowProperty.valuePreview.properties; | |
| 141 else if (rowProperty.value) | |
| 142 rowSubProperties = [{name: Common.UIString('Value'), type: rowProperty.t ype, value: rowProperty.value}]; | |
|
dgozman
2017/06/02 22:02:32
This new column could match one of the properties.
luoe
2017/06/02 22:18:16
Yeah, I didn't consider that case. Done.
| |
| 143 else | |
| 140 continue; | 144 continue; |
| 141 | 145 |
| 142 var rowValue = {}; | 146 var rowValue = {}; |
| 143 const maxColumnsToRender = 20; | 147 const maxColumnsToRender = 20; |
| 144 for (var j = 0; j < rowPreview.properties.length; ++j) { | 148 for (var j = 0; j < rowSubProperties.length; ++j) { |
| 145 var cellProperty = rowPreview.properties[j]; | 149 var cellProperty = rowSubProperties[j]; |
| 146 var columnRendered = columnNames.indexOf(cellProperty.name) !== -1; | 150 var columnRendered = columnNames.indexOf(cellProperty.name) !== -1; |
| 147 if (!columnRendered) { | 151 if (!columnRendered) { |
| 148 if (columnNames.length === maxColumnsToRender) | 152 if (columnNames.length === maxColumnsToRender) |
| 149 continue; | 153 continue; |
| 150 columnRendered = true; | 154 columnRendered = true; |
| 151 columnNames.push(cellProperty.name); | 155 columnNames.push(cellProperty.name); |
| 152 } | 156 } |
| 153 | 157 |
| 154 if (columnRendered) { | 158 if (columnRendered) { |
| 155 var cellElement = this._renderPropertyPreviewOrAccessor(table, [rowPro perty, cellProperty]); | 159 var cellElement = this._renderPropertyPreviewOrAccessor(table, [rowPro perty, cellProperty]); |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 } | 1282 } |
| 1279 return this._element; | 1283 return this._element; |
| 1280 } | 1284 } |
| 1281 }; | 1285 }; |
| 1282 | 1286 |
| 1283 /** | 1287 /** |
| 1284 * @const | 1288 * @const |
| 1285 * @type {number} | 1289 * @type {number} |
| 1286 */ | 1290 */ |
| 1287 Console.ConsoleViewMessage.MaxLengthForLinks = 40; | 1291 Console.ConsoleViewMessage.MaxLengthForLinks = 40; |
| OLD | NEW |