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 showSearchField: function() { |
| 100 /** @type {!CrToolbarElement} */(this.$['main-toolbar']) |
| 101 .getSearchField() |
| 102 .showAndFocus(); |
| 103 }, |
| 104 |
99 /** | 105 /** |
100 * If the user is a supervised user the delete button is not shown. | 106 * If the user is a supervised user the delete button is not shown. |
101 * @private | 107 * @private |
102 */ | 108 */ |
103 deletingAllowed_: function() { | 109 deletingAllowed_: function() { |
104 return loadTimeData.getBoolean('allowDeletingHistory'); | 110 return loadTimeData.getBoolean('allowDeletingHistory'); |
105 }, | 111 }, |
106 | 112 |
107 numberOfItemsSelected_: function(count) { | 113 numberOfItemsSelected_: function(count) { |
108 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 114 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
109 }, | 115 }, |
110 | 116 |
111 getHistoryInterval_: function(queryStartTime, queryEndTime) { | 117 getHistoryInterval_: function(queryStartTime, queryEndTime) { |
112 // TODO(calamity): Fix the format of these dates. | 118 // TODO(calamity): Fix the format of these dates. |
113 return loadTimeData.getStringF( | 119 return loadTimeData.getStringF( |
114 'historyInterval', queryStartTime, queryEndTime); | 120 'historyInterval', queryStartTime, queryEndTime); |
115 } | 121 } |
116 }); | 122 }); |
OLD | NEW |