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

Unified Diff: chrome/browser/resources/print_preview/search/destination_list.js

Issue 540183002: Add search to Print Preview advanced options and enable them in the UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: chrome/browser/resources/print_preview/search/destination_list.js
diff --git a/chrome/browser/resources/print_preview/search/destination_list.js b/chrome/browser/resources/print_preview/search/destination_list.js
index b96f8076f0903bf45c32510a385a217092fbb9b4..ed6e53fc3441ddf06e0dec932e9080677f0cf3fb 100644
--- a/chrome/browser/resources/print_preview/search/destination_list.js
+++ b/chrome/browser/resources/print_preview/search/destination_list.js
@@ -189,15 +189,9 @@ cr.define('print_preview', function() {
this.renderDestinations_();
},
- /** @param {?string} query Query to update the filter with. */
+ /** @param {RegExp} query Query to update the filter with. */
updateSearchQuery: function(query) {
- if (!query) {
- this.query_ = null;
- } else {
- // Generate regexp-safe query by escaping metacharacters.
- var safeQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
- this.query_ = new RegExp('(' + safeQuery + ')', 'ig');
- }
+ this.query_ = query;
this.renderDestinations_();
},

Powered by Google App Engine
This is Rietveld 408576698