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

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

Issue 780773002: Fix some closure compilation issues 8n order to update compiler.jar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: roll back *.jar Created 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // TODO(jhawkins): Use hidden instead of showInline* and display:none. 5 // TODO(jhawkins): Use hidden instead of showInline* and display:none.
6 6
7 /** 7 /**
8 * The type of the download object. The definition is based on 8 * The type of the download object. The definition is based on
9 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue() 9 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue()
10 * @typedef {{by_ext_id: (string|undefined), 10 * @typedef {{by_ext_id: (string|undefined),
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Downloads.prototype.updateResults = function() { 168 Downloads.prototype.updateResults = function() {
169 var noDownloadsOrResults = $('no-downloads-or-results'); 169 var noDownloadsOrResults = $('no-downloads-or-results');
170 noDownloadsOrResults.textContent = loadTimeData.getString( 170 noDownloadsOrResults.textContent = loadTimeData.getString(
171 this.searchText_ ? 'no_search_results' : 'no_downloads'); 171 this.searchText_ ? 'no_search_results' : 'no_downloads');
172 172
173 var hasDownloads = this.size() > 0; 173 var hasDownloads = this.size() > 0;
174 this.node_.hidden = !hasDownloads; 174 this.node_.hidden = !hasDownloads;
175 noDownloadsOrResults.hidden = hasDownloads; 175 noDownloadsOrResults.hidden = hasDownloads;
176 176
177 if (loadTimeData.getBoolean('allow_deleting_history')) 177 if (loadTimeData.getBoolean('allow_deleting_history'))
178 $('clear-all').hidden = !hasDownloads || this.searchText_; 178 $('clear-all').hidden = !hasDownloads || this.searchText_.length > 0;
179 }; 179 };
180 180
181 /** 181 /**
182 * Returns the number of downloads in the model. Used by tests. 182 * Returns the number of downloads in the model. Used by tests.
183 * @return {number} Returns the number of downloads shown on the page. 183 * @return {number} Returns the number of downloads shown on the page.
184 */ 184 */
185 Downloads.prototype.size = function() { 185 Downloads.prototype.size = function() {
186 return Object.keys(this.downloads_).length; 186 return Object.keys(this.downloads_).length;
187 }; 187 };
188 188
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 if (Date.now() - start > 50) { 978 if (Date.now() - start > 50) {
979 clearTimeout(resultsTimeout); 979 clearTimeout(resultsTimeout);
980 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); 980 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5);
981 break; 981 break;
982 } 982 }
983 } 983 }
984 } 984 }
985 985
986 // Add handlers to HTML elements. 986 // Add handlers to HTML elements.
987 window.addEventListener('DOMContentLoaded', load); 987 window.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698