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

Unified Diff: chrome/browser/resources/md_downloads/action_service.js

Issue 1428833005: MD Downloads: track downloads in C++, dispatch discrete JS updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar testz Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_downloads/action_service.js
diff --git a/chrome/browser/resources/md_downloads/action_service.js b/chrome/browser/resources/md_downloads/action_service.js
index f984fe5a14614e3b853993e4dcaad33b70577641..e2c8c53213ec4ad772e70a7c889eefb03c2f6dcd 100644
--- a/chrome/browser/resources/md_downloads/action_service.js
+++ b/chrome/browser/resources/md_downloads/action_service.js
@@ -45,7 +45,7 @@ cr.define('downloads', function() {
* (i.e. has a non-empty search term).
*/
isSearching: function() {
- return this.searchText_.length > 0;
+ return (this.searchText_ || '').length > 0;
},
/** Opens the current local destination for downloads. */
@@ -80,7 +80,8 @@ cr.define('downloads', function() {
// Split quoted terms (e.g., 'The "lazy" dog' => ['The', 'lazy', 'dog']).
function trim(s) { return s.trim(); }
dpapad 2015/11/20 21:55:15 Nit: Add @param, @return?
Dan Beam 2015/11/21 01:40:42 Done.
- chrome.send('getDownloads', searchText.split(/"([^"]*)"/).map(trim));
+ chrome.send('getDownloads',
+ searchText ? searchText.split(/"([^"]*)"/).map(trim) : []);
dpapad 2015/11/20 21:55:15 Nit: Use isSearching instead of implicit conversio
Dan Beam 2015/11/21 01:40:42 ehhhhhhhhh
},
/**
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/crisper.js » ('j') | chrome/browser/resources/md_downloads/manager.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698