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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 get searchField() { | 71 get searchField() { |
72 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar')) | 72 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar')) |
73 .getSearchField(); | 73 .getSearchField(); |
74 }, | 74 }, |
75 | 75 |
76 /** | 76 /** |
77 * @param {Event} e | 77 * @param {Event} e |
78 * @private | 78 * @private |
79 */ | 79 */ |
80 onMenuButtonOpenTap_: function(e) { | 80 onMenuButtonOpenTap_: function(e) { |
81 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 81 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown.get()); |
82 menu.showAt(/** @type {!Element} */ (e.target)); | 82 menu.showAt(/** @type {!Element} */ (e.target)); |
83 }, | 83 }, |
84 | 84 |
85 /** @private */ | 85 /** @private */ |
86 onSortTap_: function() { | 86 onSortTap_: function() { |
87 chrome.bookmarkManagerPrivate.sortChildren( | 87 chrome.bookmarkManagerPrivate.sortChildren( |
88 assert(this.getState().selectedFolder)); | 88 assert(this.getState().selectedFolder)); |
89 bookmarks.ToastManager.getInstance().show( | 89 bookmarks.ToastManager.getInstance().show( |
90 loadTimeData.getString('toastFolderSorted'), true); | 90 loadTimeData.getString('toastFolderSorted'), true); |
91 this.closeDropdownMenu_(); | 91 this.closeDropdownMenu_(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 commandManager.handle(Command.DELETE, selection); | 127 commandManager.handle(Command.DELETE, selection); |
128 }, | 128 }, |
129 | 129 |
130 /** @private */ | 130 /** @private */ |
131 onClearSelectionTap_: function() { | 131 onClearSelectionTap_: function() { |
132 this.dispatch(bookmarks.actions.deselectItems()); | 132 this.dispatch(bookmarks.actions.deselectItems()); |
133 }, | 133 }, |
134 | 134 |
135 /** @private */ | 135 /** @private */ |
136 closeDropdownMenu_: function() { | 136 closeDropdownMenu_: function() { |
137 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 137 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown.get()); |
138 menu.close(); | 138 menu.close(); |
139 }, | 139 }, |
140 | 140 |
141 /** | 141 /** |
142 * @param {Event} e | 142 * @param {Event} e |
143 * @private | 143 * @private |
144 */ | 144 */ |
145 onSearchChanged_: function(e) { | 145 onSearchChanged_: function(e) { |
146 var searchTerm = /** @type {string} */ (e.detail); | 146 var searchTerm = /** @type {string} */ (e.detail); |
147 if (searchTerm != this.searchTerm_) | 147 if (searchTerm != this.searchTerm_) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 }, | 182 }, |
183 | 183 |
184 /** | 184 /** |
185 * @return {string} | 185 * @return {string} |
186 * @private | 186 * @private |
187 */ | 187 */ |
188 getItemsSelectedString_: function() { | 188 getItemsSelectedString_: function() { |
189 return loadTimeData.getStringF('itemsSelected', this.selectedItems_.size); | 189 return loadTimeData.getStringF('itemsSelected', this.selectedItems_.size); |
190 }, | 190 }, |
191 }); | 191 }); |
OLD | NEW |