Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / resources / md_downloads / toolbar.js
blob61716d47eac61a494e248b9b6b674a1fe190cbea
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;
13     },
15     properties: {
16       canClearAll: {
17         type: Boolean,
18         value: false,
19       },
21       showingSearch_: {
22         type: Boolean,
23         value: false,
24       },
25     },
27     /** @return {boolean} Whether removal can be undone. */
28     canUndo: function() {
29       return this.$['search-term'] != document.activeElement;
30     },
32     /** @private */
33     onClearAllClick_: function() {
34       this.actionService_.clearAll();
35     },
37     /** @private */
38     onOpenDownloadsFolderClick_: function() {
39       this.actionService_.openDownloadsFolder();
40     },
42     /** @private */
43     toggleShowingSearch_: function() {
44       this.showingSearch_ = !this.showingSearch_;
45     },
46   });
48   return {Toolbar: Toolbar};
49 });