| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @typedef {{hasChildren: boolean, | 6 * @typedef {{hasChildren: boolean, |
| 7 * id: string, | 7 * id: string, |
| 8 * idPath: string, | 8 * idPath: string, |
| 9 * title: string, | 9 * title: string, |
| 10 * totalUsage: string, | 10 * totalUsage: string, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * Get cookie data for a given HTML node. | 70 * Get cookie data for a given HTML node. |
| 71 * @param {CookieDetails} data The contents of the cookie. | 71 * @param {CookieDetails} data The contents of the cookie. |
| 72 * @return {!Array<CookieDataForDisplay>} | 72 * @return {!Array<CookieDataForDisplay>} |
| 73 */ | 73 */ |
| 74 var getCookieData = function(data) { | 74 var getCookieData = function(data) { |
| 75 /** @type {!Array<CookieDataForDisplay>} */ | 75 /** @type {!Array<CookieDataForDisplay>} */ |
| 76 var out = []; | 76 var out = []; |
| 77 var fields = cookieInfo[data.type]; | 77 var fields = cookieInfo[data.type]; |
| 78 for (var field of fields) { | 78 for (var i = 0; i < fields.length; i++) { |
| 79 var field = fields[0]; |
| 79 // Iterate through the keys found in |cookieInfo| for the given |type| | 80 // Iterate through the keys found in |cookieInfo| for the given |type| |
| 80 // and see if those keys are present in the data. If so, display them | 81 // and see if those keys are present in the data. If so, display them |
| 81 // (in the order determined by |cookieInfo|). | 82 // (in the order determined by |cookieInfo|). |
| 82 var key = field[0]; | 83 var key = field[0]; |
| 83 if (data[key].length > 0) { | 84 if (data[key].length > 0) { |
| 84 var entry = /** @type {CookieDataForDisplay} */({ | 85 var entry = /** @type {CookieDataForDisplay} */({ |
| 85 label: loadTimeData.getString(field[1]), | 86 label: loadTimeData.getString(field[1]), |
| 86 content: data[key], | 87 content: data[key], |
| 87 }); | 88 }); |
| 88 out.push(entry); | 89 out.push(entry); |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 return out; | 92 return out; |
| 92 }; | 93 }; |
| OLD | NEW |