OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('downloads', function() { |
| 6 var Toolbar = Polymer({ |
| 7 is: 'downloads-toolbar', |
| 8 |
| 9 /** @param {!downloads.ActionService} actionService */ |
| 10 setActionService: function(actionService) { |
| 11 /** @private {!downloads.ActionService} */ |
| 12 this.actionService_ = actionService; |
| 13 }, |
| 14 |
| 15 properties: { |
| 16 canClearAll: { |
| 17 type: Boolean, |
| 18 value: false, |
| 19 }, |
| 20 |
| 21 showingSearch_: { |
| 22 type: Boolean, |
| 23 value: false, |
| 24 }, |
| 25 }, |
| 26 |
| 27 /** @return {boolean} Whether removal can be undone. */ |
| 28 canUndo: function() { |
| 29 return this.$['search-term'] != document.activeElement; |
| 30 }, |
| 31 |
| 32 /** @private */ |
| 33 onClearAllClick_: function() { |
| 34 this.actionService_.clearAll(); |
| 35 }, |
| 36 |
| 37 /** @private */ |
| 38 onOpenDownloadsFolderClick_: function() { |
| 39 this.actionService_.openDownloadsFolder(); |
| 40 }, |
| 41 |
| 42 /** @private */ |
| 43 toggleShowingSearch_: function() { |
| 44 this.showingSearch_ = !this.showingSearch_; |
| 45 }, |
| 46 }); |
| 47 |
| 48 return {Toolbar: Toolbar}; |
| 49 }); |
OLD | NEW |