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 {{domain: string, | 6 * @typedef {{domain: string, |
7 * visits: !Array<HistoryEntry>, | 7 * visits: !Array<HistoryEntry>, |
8 * rendered: boolean, | 8 * rendered: boolean, |
9 * expanded: boolean}} | 9 * expanded: boolean}} |
10 */ | 10 */ |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 domains[domainIndexes[domain]].visits.push(visit); | 75 domains[domainIndexes[domain]].visits.push(visit); |
76 } | 76 } |
77 var sortByVisits = function(a, b) { | 77 var sortByVisits = function(a, b) { |
78 return b.visits.length - a.visits.length; | 78 return b.visits.length - a.visits.length; |
79 }; | 79 }; |
80 domains.sort(sortByVisits); | 80 domains.sort(sortByVisits); |
81 | 81 |
82 return domains; | 82 return domains; |
83 }, | 83 }, |
84 | 84 |
| 85 /** @private */ |
85 updateGroupedHistoryData_: function() { | 86 updateGroupedHistoryData_: function() { |
86 if (this.historyData.length == 0) { | 87 if (this.historyData.length == 0) { |
87 this.groupedHistoryData_ = []; | 88 this.groupedHistoryData_ = []; |
88 return; | 89 return; |
89 } | 90 } |
90 | 91 |
91 if (this.range == HistoryRange.WEEK) { | 92 if (this.range == HistoryRange.WEEK) { |
92 // Group each day into a list of results. | 93 // Group each day into a list of results. |
93 var days = []; | 94 var days = []; |
94 var currentDayVisits = [this.historyData[0]]; | 95 var currentDayVisits = [this.historyData[0]]; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 182 |
182 /** | 183 /** |
183 * @param {boolean} expanded | 184 * @param {boolean} expanded |
184 * @return {string} | 185 * @return {string} |
185 * @private | 186 * @private |
186 */ | 187 */ |
187 getDropdownIcon_: function(expanded) { | 188 getDropdownIcon_: function(expanded) { |
188 return expanded ? 'cr:expand-less' : 'cr:expand-more'; | 189 return expanded ? 'cr:expand-less' : 'cr:expand-more'; |
189 }, | 190 }, |
190 }); | 191 }); |
OLD | NEW |