Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3807)

Unified Diff: chrome/browser/resources/md_downloads/toolbar.js

Issue 1240853002: Slice MD downloads into more components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: import position Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_downloads/toolbar.js
diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js
new file mode 100644
index 0000000000000000000000000000000000000000..61716d47eac61a494e248b9b6b674a1fe190cbea
--- /dev/null
+++ b/chrome/browser/resources/md_downloads/toolbar.js
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('downloads', function() {
+ var Toolbar = Polymer({
+ is: 'downloads-toolbar',
+
+ /** @param {!downloads.ActionService} actionService */
+ setActionService: function(actionService) {
+ /** @private {!downloads.ActionService} */
+ this.actionService_ = actionService;
+ },
+
+ properties: {
+ canClearAll: {
+ type: Boolean,
+ value: false,
+ },
+
+ showingSearch_: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
+ /** @return {boolean} Whether removal can be undone. */
+ canUndo: function() {
+ return this.$['search-term'] != document.activeElement;
+ },
+
+ /** @private */
+ onClearAllClick_: function() {
+ this.actionService_.clearAll();
+ },
+
+ /** @private */
+ onOpenDownloadsFolderClick_: function() {
+ this.actionService_.openDownloadsFolder();
+ },
+
+ /** @private */
+ toggleShowingSearch_: function() {
+ this.showingSearch_ = !this.showingSearch_;
+ },
+ });
+
+ return {Toolbar: Toolbar};
+});

Powered by Google App Engine
This is Rietveld 408576698