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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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() { | 99 showSearchField: function() { |
100 /** @type {!CrToolbarElement} */(this.$['main-toolbar']) | 100 /** @type {!CrToolbarElement} */(this.$['main-toolbar']) |
101 .getSearchField() | 101 .getSearchField() |
102 .showAndFocus(); | 102 .showAndFocus(); |
103 }, | 103 }, |
104 | 104 |
Dan Beam
2016/07/15 03:07:41
nit: /** return {boolean} */
lshang
2016/07/15 05:02:09
Since we need to check both the search field is sh
| |
105 showingSearchField: function() { | |
106 return /** @type {!CrToolbarElement} */(this.$['main-toolbar']) | |
107 .getSearchField() | |
108 .showingSearchStatus(); | |
109 }, | |
110 | |
105 /** | 111 /** |
106 * If the user is a supervised user the delete button is not shown. | 112 * If the user is a supervised user the delete button is not shown. |
107 * @private | 113 * @private |
108 */ | 114 */ |
109 deletingAllowed_: function() { | 115 deletingAllowed_: function() { |
110 return loadTimeData.getBoolean('allowDeletingHistory'); | 116 return loadTimeData.getBoolean('allowDeletingHistory'); |
111 }, | 117 }, |
112 | 118 |
113 numberOfItemsSelected_: function(count) { | 119 numberOfItemsSelected_: function(count) { |
114 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 120 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
115 }, | 121 }, |
116 | 122 |
117 getHistoryInterval_: function(queryStartTime, queryEndTime) { | 123 getHistoryInterval_: function(queryStartTime, queryEndTime) { |
118 // TODO(calamity): Fix the format of these dates. | 124 // TODO(calamity): Fix the format of these dates. |
119 return loadTimeData.getStringF( | 125 return loadTimeData.getStringF( |
120 'historyInterval', queryStartTime, queryEndTime); | 126 'historyInterval', queryStartTime, queryEndTime); |
121 } | 127 } |
122 }); | 128 }); |
OLD | NEW |