Chromium Code Reviews| 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 |
|
tsergeant
2016/01/22 02:37:11
Remove "this function" (it's implied):
Change the
|
| + * not any history items are currently selected. |
| + * @private |
| + */ |
| + changeToolbarView_: function() { |
| + this.itemsSelected_ = this.count != 0; |
| + }, |
| + |
| + clearSelection: function() { |
| + this.fire('unselect-all'); |
| + } |
| +}); |