| OLD | NEW |
| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 this.closeDropdownMenu_(); | 92 this.closeDropdownMenu_(); |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** @private */ | 95 /** @private */ |
| 96 onExportTap_: function() { | 96 onExportTap_: function() { |
| 97 chrome.bookmarks.export(); | 97 chrome.bookmarks.export(); |
| 98 this.closeDropdownMenu_(); | 98 this.closeDropdownMenu_(); |
| 99 }, | 99 }, |
| 100 | 100 |
| 101 /** @private */ | 101 /** @private */ |
| 102 onDeleteSelectionTap_: function() { |
| 103 var selection = this.getState().selection.items; |
| 104 var commandManager = bookmarks.CommandManager.getInstance(); |
| 105 assert(commandManager.canExecute(Command.DELETE, selection)); |
| 106 commandManager.handle(Command.DELETE, selection); |
| 107 }, |
| 108 |
| 109 /** @private */ |
| 102 onClearSelectionTap_: function() { | 110 onClearSelectionTap_: function() { |
| 103 this.dispatch(bookmarks.actions.deselectItems()); | 111 this.dispatch(bookmarks.actions.deselectItems()); |
| 104 }, | 112 }, |
| 105 | 113 |
| 106 /** @private */ | 114 /** @private */ |
| 107 closeDropdownMenu_: function() { | 115 closeDropdownMenu_: function() { |
| 108 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 116 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); |
| 109 menu.close(); | 117 menu.close(); |
| 110 }, | 118 }, |
| 111 | 119 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 }, | 154 }, |
| 147 | 155 |
| 148 /** | 156 /** |
| 149 * @return {string} | 157 * @return {string} |
| 150 * @private | 158 * @private |
| 151 */ | 159 */ |
| 152 getItemsSelectedString_: function() { | 160 getItemsSelectedString_: function() { |
| 153 return loadTimeData.getStringF('itemsSelected', this.selectedCount_); | 161 return loadTimeData.getStringF('itemsSelected', this.selectedCount_); |
| 154 }, | 162 }, |
| 155 }); | 163 }); |
| OLD | NEW |