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

Side by Side Diff: chrome/browser/resources/new_new_tab.js

Issue 149685: NNTP: Only show completed downloads.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Helpers 2 // Helpers
3 3
4 function $(id) { 4 function $(id) {
5 return document.getElementById(id); 5 return document.getElementById(id);
6 } 6 }
7 7
8 // TODO(arv): Remove these when classList is available in HTML5. 8 // TODO(arv): Remove these when classList is available in HTML5.
9 // https://bugs.webkit.org/show_bug.cgi?id=20709 9 // https://bugs.webkit.org/show_bug.cgi?id=20709
10 function hasClass(el, name) { 10 function hasClass(el, name) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 mostVisitedData = data; 85 mostVisitedData = data;
86 renderMostVisited(data); 86 renderMostVisited(data);
87 87
88 gotMostVisited = true; 88 gotMostVisited = true;
89 onDataLoaded(); 89 onDataLoaded();
90 } 90 }
91 91
92 function downloadsList(data) { 92 function downloadsList(data) {
93 logEvent('received downloads'); 93 logEvent('received downloads');
94
95 // We should only show complete downloads.
96 data = data.filter(function(d) {
97 return d.state == 'COMPLETE';
98 });
94 data.length = Math.min(data.length, 5); 99 data.length = Math.min(data.length, 5);
95 processData('#download-items', data); 100 processData('#download-items', data);
96 } 101 }
97 102
98 function recentlyClosedTabs(data) { 103 function recentlyClosedTabs(data) {
99 logEvent('received recently closed tabs'); 104 logEvent('received recently closed tabs');
100 data.length = Math.min(data.length, 5); 105 data.length = Math.min(data.length, 5);
101 processData('#tab-items', data); 106 processData('#tab-items', data);
102 } 107 }
103 108
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 el.addEventListener('dragover', bind(this.handleDragOver, this)); 1203 el.addEventListener('dragover', bind(this.handleDragOver, this));
1199 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); 1204 el.addEventListener('dragleave', bind(this.handleDragLeave, this));
1200 el.addEventListener('drop', bind(this.handleDrop, this)); 1205 el.addEventListener('drop', bind(this.handleDrop, this));
1201 el.addEventListener('dragend', bind(this.handleDragEnd, this)); 1206 el.addEventListener('dragend', bind(this.handleDragEnd, this));
1202 el.addEventListener('drag', bind(this.handleDrag, this)); 1207 el.addEventListener('drag', bind(this.handleDrag, this));
1203 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); 1208 el.addEventListener('mousedown', bind(this.handleMouseDown, this));
1204 } 1209 }
1205 }; 1210 };
1206 1211
1207 dnd.init(); 1212 dnd.init();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698