| 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 properties: { | 8 properties: { |
| 9 searchTerm: { | 9 searchTerm: { |
| 10 type: String, | 10 type: String, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 onSortTap_: function() { | 36 onSortTap_: function() { |
| 37 this.closeDropdownMenu_(); | 37 this.closeDropdownMenu_(); |
| 38 }, | 38 }, |
| 39 | 39 |
| 40 /** @private */ | 40 /** @private */ |
| 41 onAddBookmarkTap_: function() { | 41 onAddBookmarkTap_: function() { |
| 42 this.closeDropdownMenu_(); | 42 this.closeDropdownMenu_(); |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 /** @private */ | 45 /** @private */ |
| 46 onAddImportTap_: function() { | 46 onImportTap_: function() { |
| 47 chrome.bookmarks.import(); |
| 47 this.closeDropdownMenu_(); | 48 this.closeDropdownMenu_(); |
| 48 }, | 49 }, |
| 49 | 50 |
| 50 /** @private */ | 51 /** @private */ |
| 51 onAddExportTap_: function() { | 52 onExportTap_: function() { |
| 53 chrome.bookmarks.export(); |
| 52 this.closeDropdownMenu_(); | 54 this.closeDropdownMenu_(); |
| 53 }, | 55 }, |
| 54 | 56 |
| 55 /** @private */ | 57 /** @private */ |
| 56 closeDropdownMenu_: function() { | 58 closeDropdownMenu_: function() { |
| 57 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); | 59 var menu = /** @type {!CrActionMenuElement} */ (this.$.dropdown); |
| 58 menu.close(); | 60 menu.close(); |
| 59 }, | 61 }, |
| 60 | 62 |
| 61 /** | 63 /** |
| 62 * @param {Event} e | 64 * @param {Event} e |
| 63 * @private | 65 * @private |
| 64 */ | 66 */ |
| 65 onSearchChanged_: function(e) { | 67 onSearchChanged_: function(e) { |
| 66 var searchTerm = /** @type {string} */ (e.detail); | 68 var searchTerm = /** @type {string} */ (e.detail); |
| 67 this.fire('search-term-changed', searchTerm); | 69 this.fire('search-term-changed', searchTerm); |
| 68 }, | 70 }, |
| 69 | 71 |
| 70 /** @private */ | 72 /** @private */ |
| 71 onSearchTermChanged_: function() { | 73 onSearchTermChanged_: function() { |
| 72 this.searchField.setValue(this.searchTerm || ''); | 74 this.searchField.setValue(this.searchTerm || ''); |
| 73 }, | 75 }, |
| 74 }); | 76 }); |
| OLD | NEW |