OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Polymer({ | 5 Polymer({ |
6 is: 'history-toolbar', | 6 is: 'history-toolbar', |
7 properties: { | 7 properties: { |
8 // Number of history items currently selected. | 8 // Number of history items currently selected. |
9 count: { | 9 count: { |
10 type: Number, | 10 type: Number, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 }, | 89 }, |
90 | 90 |
91 onClearSelectionTap_: function() { | 91 onClearSelectionTap_: function() { |
92 this.fire('unselect-all'); | 92 this.fire('unselect-all'); |
93 }, | 93 }, |
94 | 94 |
95 onDeleteTap_: function() { | 95 onDeleteTap_: function() { |
96 this.fire('delete-selected'); | 96 this.fire('delete-selected'); |
97 }, | 97 }, |
98 | 98 |
| 99 get searchBar() { |
| 100 return this.$['main-toolbar'].getSearchField(); |
| 101 }, |
| 102 |
99 showSearchField: function() { | 103 showSearchField: function() { |
100 /** @type {!CrToolbarElement} */(this.$['main-toolbar']) | 104 /** @type {!CrToolbarElement} */(this.$['main-toolbar']) |
101 .getSearchField() | 105 .getSearchField() |
102 .showAndFocus(); | 106 .showAndFocus(); |
103 }, | 107 }, |
104 | 108 |
105 /** | 109 /** |
106 * If the user is a supervised user the delete button is not shown. | 110 * If the user is a supervised user the delete button is not shown. |
107 * @private | 111 * @private |
108 */ | 112 */ |
109 deletingAllowed_: function() { | 113 deletingAllowed_: function() { |
110 return loadTimeData.getBoolean('allowDeletingHistory'); | 114 return loadTimeData.getBoolean('allowDeletingHistory'); |
111 }, | 115 }, |
112 | 116 |
113 numberOfItemsSelected_: function(count) { | 117 numberOfItemsSelected_: function(count) { |
114 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 118 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
115 }, | 119 }, |
116 | 120 |
117 getHistoryInterval_: function(queryStartTime, queryEndTime) { | 121 getHistoryInterval_: function(queryStartTime, queryEndTime) { |
118 // TODO(calamity): Fix the format of these dates. | 122 // TODO(calamity): Fix the format of these dates. |
119 return loadTimeData.getStringF( | 123 return loadTimeData.getStringF( |
120 'historyInterval', queryStartTime, queryEndTime); | 124 'historyInterval', queryStartTime, queryEndTime); |
121 } | 125 } |
122 }); | 126 }); |
OLD | NEW |