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

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

Issue 1613233003: MD Downloads: make Ctrl+f invoke in-page search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dl-vulcanize
Patch Set: Created 4 years, 11 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/md_downloads/toolbar.js
diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js
index ff9173ee452a3612eb349db0c76cedc94147a62a..1ff3e31efe9848ed633ef5b0d681cd4adba018f3 100644
--- a/chrome/browser/resources/md_downloads/toolbar.js
+++ b/chrome/browser/resources/md_downloads/toolbar.js
@@ -20,7 +20,7 @@ cr.define('downloads', function() {
reflectToAttribute: true,
type: Boolean,
value: false,
- observer: 'onDownloadsShowingChange_',
+ observer: 'downloadsShowingChanged_',
},
overflowAlign_: {
@@ -39,6 +39,15 @@ cr.define('downloads', function() {
return !this.$['search-input'].getValue() && this.downloadsShowing;
},
+ onFindCommand: function() {
+ var searchInput = this.$ && this.$['search-input'];
michaelpg 2016/01/21 22:04:14 this should already be true anyway (the element sh
Dan Beam 2016/01/21 23:39:27 I'm not sure calling .focus() should show; I'd rat
+ if (!searchInput)
+ return;
+
+ searchInput.showingSearch = true;
+ searchInput.focus();
michaelpg 2016/01/21 22:04:14 doesn't this need to be async if showingSearch was
Dan Beam 2016/01/21 22:14:46 yeah, I think it was working because bugs. maybe
michaelpg 2016/01/21 22:19:01 i agree. or just have focus() do it... seems like
Dan Beam 2016/01/21 23:39:27 eh, I think it's more reasonable to compose out sh
michaelpg 2016/01/21 23:43:34 sgtm
+ },
+
/** @private */
onClearAllTap_: function() {
assert(this.canClearAll());
@@ -46,7 +55,7 @@ cr.define('downloads', function() {
},
/** @private */
- onDownloadsShowingChange_: function() {
+ downloadsShowingChanged_: function() {
this.updateClearAll_();
},

Powered by Google App Engine
This is Rietveld 408576698