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

Unified Diff: chrome/browser/resources/md_history/history_toolbar.js

Issue 2060023002: WebUI: cr-search-field: Remove delegation pattern, use simple event instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_box0
Patch Set: Address comments, fix compilation. Created 4 years, 6 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_history/history_toolbar.js
diff --git a/chrome/browser/resources/md_history/history_toolbar.js b/chrome/browser/resources/md_history/history_toolbar.js
index 2e514abada67910df4a93420b6aaef78ea092b73..13f9c35d6c704424fc288305e4f4d533a484c1ca 100644
--- a/chrome/browser/resources/md_history/history_toolbar.js
+++ b/chrome/browser/resources/md_history/history_toolbar.js
@@ -2,22 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/**
- * @constructor
- * @implements {SearchFieldDelegate}
- * @param {!HistoryToolbarElement} toolbar This history-toolbar.
- */
-function ToolbarSearchFieldDelegate(toolbar) {
- this.toolbar_ = toolbar;
-}
-
-ToolbarSearchFieldDelegate.prototype = {
- /** @override */
- onSearchTermSearch: function(searchTerm) {
- this.toolbar_.onSearch(searchTerm);
- }
-};
-
Polymer({
is: 'history-toolbar',
properties: {
@@ -97,16 +81,11 @@ Polymer({
},
/**
- * @param {string} searchTerm
+ * @param {!CustomEvent} event
+ * @private
*/
- onSearch: function(searchTerm) {
- this.searchTerm = searchTerm;
- },
-
- attached: function() {
- this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this);
- /** @type {!CrToolbarElement} */(this.$['main-toolbar']).getSearchField()
- .setDelegate(this.searchFieldDelegate_);
+ onSearchChanged_: function(event) {
+ this.searchTerm = /** @type {string} */ (event.detail);
},
onClearSelectionTap_: function() {

Powered by Google App Engine
This is Rietveld 408576698