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

Side by Side Diff: chrome/browser/resources/md_history/grouped_list.js

Issue 2481693002: [MD History] Make forward/backward work in grouped mode. (Closed)
Patch Set: rebase Created 4 years 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
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 {{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
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/app.vulcanized.html ('k') | chrome/browser/resources/md_history/history_toolbar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698