Chromium Code Reviews| Index: chrome/browser/resources/md_bookmarks/store.js |
| diff --git a/chrome/browser/resources/md_bookmarks/store.js b/chrome/browser/resources/md_bookmarks/store.js |
| index eb4cb11c7a3cab9825505dd03faceb876fb8ba14..e90183cabb37323bee3b5ea9470fc920938fd4fa 100644 |
| --- a/chrome/browser/resources/md_bookmarks/store.js |
| +++ b/chrome/browser/resources/md_bookmarks/store.js |
| @@ -79,6 +79,8 @@ var BookmarksStore = Polymer({ |
| // Attach bookmarks API listeners. |
| chrome.bookmarks.onRemoved.addListener(this.onBookmarkRemoved_.bind(this)); |
| chrome.bookmarks.onChanged.addListener(this.onBookmarkChanged_.bind(this)); |
| + chrome.bookmarks.onImportBegan.addListener(this.onImportBegan_.bind(this)); |
| + chrome.bookmarks.onImportEnded.addListener(this.onImportEnded_.bind(this)); |
| }, |
| ////////////////////////////////////////////////////////////////////////////// |
| @@ -326,6 +328,26 @@ var BookmarksStore = Polymer({ |
| this.updateSearchDisplay_(); |
| }, |
| + /** |
| + * Called when importing bookmark is started. |
| + */ |
| + onImportBegan_: function() { |
| + chrome.bookmarks.onRemoved.removeListener(this.onBookmarkRemoved_.bind(this)); |
|
tsergeant
2017/02/24 00:03:18
The docs for importBegan say:
"Expensive observer
rongjie
2017/02/24 00:20:46
Done.
|
| + chrome.bookmarks.onChanged.removeListener(this.onBookmarkChanged_.bind(this)); |
| + }, |
| + |
| + /** |
| + * Called when importing bookmark node is finished. |
| + */ |
| + onImportEnded_: function() { |
| + chrome.bookmarks.getTree(function(results) { |
| + this.setupStore_(results[0]); |
|
tsergeant
2017/02/24 00:03:18
I think you need to call
this.updateSelectedDispl
rongjie
2017/02/24 00:20:46
Done.
|
| + }.bind(this)); |
| + |
| + chrome.bookmarks.onRemoved.addListener(this.onBookmarkRemoved_.bind(this)); |
| + chrome.bookmarks.onChanged.addListener(this.onBookmarkChanged_.bind(this)); |
| + }, |
| + |
| ////////////////////////////////////////////////////////////////////////////// |
| // bookmarks-store, bookmarks app event listeners: |