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

Unified Diff: chrome/browser/resources/md_history/history_toolbar.js

Issue 1572383006: MD History: Hook all elements into the page and add tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch
Patch Set: Rebase and replace with correct filenames. Created 4 years, 11 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_history/history_toolbar.js
diff --git a/chrome/browser/resources/md_history/history_toolbar.js b/chrome/browser/resources/md_history/history_toolbar.js
new file mode 100644
index 0000000000000000000000000000000000000000..7339c516daf92daab305ef90c8ad6a948541c0af
--- /dev/null
+++ b/chrome/browser/resources/md_history/history_toolbar.js
@@ -0,0 +1,35 @@
+// 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.
+
+Polymer({
+ is: 'history-toolbar',
+ properties: {
+ // Number of history items currently selected.
+ count: {
+ type: Number,
+ value: 0,
+ observer: 'changeToolbarView_'
+ },
+ // True if 1 or more history items are selected. When this value changes
+ // the background colour changes.
+ itemsSelected_: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true
+ }
+ },
+
+ /**
+ * This function changes the toolbar background color depending on whether or
+ * not any history items are currently selected.
+ * @private
+ */
+ changeToolbarView_: function() {
+ this.itemsSelected_ = this.count != 0;
+ },
+
+ clearSelection: function() {
+ this.fire('unselect-all');
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698