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

Unified Diff: chrome/browser/resources/downloads/downloads.js

Issue 22773003: Fix searching on chrome://downloads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/downloads_dom_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/downloads/downloads.js
diff --git a/chrome/browser/resources/downloads/downloads.js b/chrome/browser/resources/downloads/downloads.js
index 0979d0cdf10ea9600fdc74cdb54e1a8ef0eee753..d50f5eb66fc04bfd039868bc30a91a4b90ac36db 100644
--- a/chrome/browser/resources/downloads/downloads.js
+++ b/chrome/browser/resources/downloads/downloads.js
@@ -758,7 +758,19 @@ function load() {
function setSearch(searchText) {
fifoResults.length = 0;
downloads.setSearchText(searchText);
- chrome.send('getDownloads', [searchText.toString()]);
+ searchText = searchText.toString().match(/(?:[^\s"]+|"[^"]*")+/g);
+ if (searchText) {
+ searchText = searchText.map(function(term) {
+ // strip quotes
+ return (term.match(/\s/) &&
+ term[0].match(/["']/) &&
+ term[term.length - 1] == term[0]) ?
+ term.substr(1, term.length - 2) : term;
+ });
+ } else {
+ searchText = [];
+ }
+ chrome.send('getDownloads', searchText);
}
function clearAll() {
« no previous file with comments | « no previous file | chrome/browser/ui/webui/downloads_dom_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698