Chromium Code Reviews| 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 * title: string, | 8 * title: string, |
| 9 * totalUsage: string, | 9 * totalUsage: string, |
| 10 * type: string}} | 10 * type: string}} |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 | 168 |
| 169 for (var j = 0; j < siteEntry.children_.length; ++j) { | 169 for (var j = 0; j < siteEntry.children_.length; ++j) { |
| 170 var descriptionNode = siteEntry.children_[j]; | 170 var descriptionNode = siteEntry.children_[j]; |
| 171 if (j > 0) | 171 if (j > 0) |
| 172 description += ', '; | 172 description += ', '; |
| 173 | 173 |
| 174 // Some types, like quota, have no description nodes. | 174 // Some types, like quota, have no description nodes. |
| 175 var dataType = ''; | 175 var dataType = ''; |
| 176 if (descriptionNode.data_.type != undefined) | 176 if (descriptionNode.data_.type != undefined) |
| 177 dataType = descriptionNode.data_.type; | 177 dataType = descriptionNode.data_.type; |
| 178 else | 178 else { |
|
dschuyler
2016/09/29 19:40:27
If the |else| has braces {} the |if| should also
(
Finnur
2016/09/30 09:19:42
Ah, yes, I indeed.
| |
| 179 dataType = descriptionNode.children_[0].data_.type; | 179 // A description node can have no children when in the process of |
| 180 // being deleted. | |
|
dschuyler
2016/09/29 19:40:27
optional:
// A description node might not have chi
Finnur
2016/09/30 09:19:42
Done.
| |
| 181 if (descriptionNode.children_.length > 0) | |
| 182 dataType = descriptionNode.children_[0].data_.type; | |
|
Finnur
2016/09/29 15:54:01
This is not listed in the bug, but was discovered
dschuyler
2016/09/29 19:40:27
Thanks for the explanation!
| |
| 183 } | |
| 180 | 184 |
| 181 var count = | 185 var count = |
| 182 (dataType == 'cookie') ? descriptionNode.children_.length : 0; | 186 (dataType == 'cookie') ? descriptionNode.children_.length : 0; |
| 183 if (count > 1) { | 187 if (count > 1) { |
| 184 description += loadTimeData.getStringF('cookiePlural', count); | 188 description += loadTimeData.getStringF('cookiePlural', count); |
| 185 } else { | 189 } else { |
| 186 description += getCookieDataCategoryText( | 190 description += getCookieDataCategoryText( |
| 187 dataType, descriptionNode.data_.totalUsage); | 191 dataType, descriptionNode.data_.totalUsage); |
| 188 } | 192 } |
| 189 | 193 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 root.appendChild(content); | 244 root.appendChild(content); |
| 241 } | 245 } |
| 242 } | 246 } |
| 243 }, | 247 }, |
| 244 }; | 248 }; |
| 245 | 249 |
| 246 return { | 250 return { |
| 247 CookieTreeNode: CookieTreeNode, | 251 CookieTreeNode: CookieTreeNode, |
| 248 }; | 252 }; |
| 249 }); | 253 }); |
| OLD | NEW |