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.
5 cr.define('downloads', function() {
6 var Toolbar = Polymer({
7 is: 'downloads-toolbar',
9 /** @param {!downloads.ActionService} actionService */
10 setActionService: function(actionService) {
11 /** @private {!downloads.ActionService} */
12 this.actionService_ = actionService;
27 /** @return {boolean} Whether removal can be undone. */
29 return this.$['search-term'] != document.activeElement;
33 onClearAllClick_: function() {
34 this.actionService_.clearAll();
38 onOpenDownloadsFolderClick_: function() {
39 this.actionService_.openDownloadsFolder();
43 toggleShowingSearch_: function() {
44 this.showingSearch_ = !this.showingSearch_;
48 return {Toolbar: Toolbar};