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

Side by Side Diff: chrome/browser/resources/settings/site_settings/cookie_info.js

Issue 2687553003: MD Settings: Fix site data details regression and add test. (Closed)
Patch Set: resetRoutForTesting() Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/resources/settings/site_settings/site_data_details_subpage.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 i = 0; i < fields.length; i++) { 78 for (var i = 0; i < fields.length; i++) {
79 var field = fields[0]; 79 var field = fields[i];
80 // Iterate through the keys found in |cookieInfo| for the given |type| 80 // Iterate through the keys found in |cookieInfo| for the given |type|
81 // 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
82 // (in the order determined by |cookieInfo|). 82 // (in the order determined by |cookieInfo|).
83 var key = field[0]; 83 var key = field[0];
84 if (data[key].length > 0) { 84 if (data[key].length > 0) {
85 var entry = /** @type {CookieDataForDisplay} */({ 85 var entry = /** @type {CookieDataForDisplay} */({
86 label: loadTimeData.getString(field[1]), 86 label: loadTimeData.getString(field[1]),
87 content: data[key], 87 content: data[key],
88 }); 88 });
89 out.push(entry); 89 out.push(entry);
90 } 90 }
91 } 91 }
92 return out; 92 return out;
93 }; 93 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/site_settings/site_data_details_subpage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698