Chromium Code Reviews| Index: chrome/browser/resources/md_bookmarks/app.js |
| diff --git a/chrome/browser/resources/md_bookmarks/app.js b/chrome/browser/resources/md_bookmarks/app.js |
| index 23bb4984359987ce975042b8e94972673d61d652..026fc9c643241198206edde1f80f2552019252ce 100644 |
| --- a/chrome/browser/resources/md_bookmarks/app.js |
| +++ b/chrome/browser/resources/md_bookmarks/app.js |
| @@ -9,8 +9,20 @@ Polymer({ |
| bookmarks.StoreClient, |
| ], |
| + properties: { |
| + /** @private */ |
| + searchTerm_: { |
| + type: String, |
| + observer: 'searchTermChanged_', |
| + }, |
| + }, |
| + |
| /** @override */ |
| attached: function() { |
| + this.watch('searchTerm_', function(store) { |
| + return store.search.term; |
| + }); |
| + |
| chrome.bookmarks.getTree(function(results) { |
| var nodeList = bookmarks.util.normalizeNodes(results[0]); |
| var initialState = bookmarks.util.createEmptyState(); |
| @@ -21,4 +33,16 @@ Polymer({ |
| bookmarks.ApiListener.init(); |
| }.bind(this)); |
| }, |
| + |
| + searchTermChanged_: function() { |
| + if (!this.searchTerm_) |
| + return; |
| + |
| + chrome.bookmarks.search(this.searchTerm_, function(results) { |
| + var ids = results.map(function(node) { |
| + return node.id; |
| + }); |
| + this.dispatch(bookmarks.actions.setSearchResults(ids)); |
|
calamity
2017/03/13 04:50:36
If we're going to do search results by id, we need
tsergeant
2017/03/14 02:40:36
I was working yesterday on a follow-up CL which pu
calamity
2017/03/14 03:32:18
Taking a glance at the API implementation, timing
tsergeant
2017/03/14 05:51:10
As discussed in person, I've added in an assertion
|
| + }.bind(this)); |
| + }, |
| }); |