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

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

Issue 2720473002: MD Downloads: announce search results (Closed)
Patch Set: closure Created 3 years, 10 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 | « chrome/browser/resources/md_downloads/manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_downloads/toolbar.js
diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js
index 4a40daa66e85142ae2ac100b333b6bc0731ffe7a..d533889dca3bf60446ad774a830013e47d3f8298 100644
--- a/chrome/browser/resources/md_downloads/toolbar.js
+++ b/chrome/browser/resources/md_downloads/toolbar.js
@@ -27,8 +27,12 @@ cr.define('downloads', function() {
/** @return {boolean} Whether "Clear all" should be allowed. */
canClearAll: function() {
- return !this.$.toolbar.getSearchField().getValue() &&
- this.downloadsShowing;
+ return this.getSearchText().length == 0 && this.downloadsShowing;
+ },
+
+ /** @return {string} The full text being searched. */
+ getSearchText: function() {
+ return this.$.toolbar.getSearchField().getValue();
},
onFindCommand: function() {
« no previous file with comments | « chrome/browser/resources/md_downloads/manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698