| 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));
|
| + }.bind(this));
|
| + },
|
| });
|
|
|