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

Side by Side Diff: chrome/browser/resources/md_bookmarks/toolbar.js

Issue 2745993002: MD Bookmarks: Update URL router to work in new data binding system (Closed)
Patch Set: Change initialization, add integration test Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'bookmarks-toolbar', 6 is: 'bookmarks-toolbar',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); 70 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown);
71 menu.close(); 71 menu.close();
72 }, 72 },
73 73
74 /** 74 /**
75 * @param {Event} e 75 * @param {Event} e
76 * @private 76 * @private
77 */ 77 */
78 onSearchChanged_: function(e) { 78 onSearchChanged_: function(e) {
79 var searchTerm = /** @type {string} */ (e.detail); 79 var searchTerm = /** @type {string} */ (e.detail);
80 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); 80 if (searchTerm != this.searchTerm_)
calamity 2017/03/20 06:34:28 What makes this necessary?
tsergeant 2017/03/21 00:27:07 This is just a small optimisation to avoid firing
81 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm));
81 }, 82 },
82 83
83 /** @private */ 84 /** @private */
84 onSearchTermChanged_: function() { 85 onSearchTermChanged_: function() {
85 this.searchField.setValue(this.searchTerm_ || ''); 86 this.searchField.setValue(this.searchTerm_ || '');
86 }, 87 },
87 }); 88 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698