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 // TODO(calamity): bind this to | 9 // TODO(calamity): bind this to |
10 // listContainer.selectedItem.selectedPaths.length. | 10 // listContainer.selectedItem.selectedPaths.length. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 type: Number, | 53 type: Number, |
54 reflectToAttribute: true, | 54 reflectToAttribute: true, |
55 notify: true, | 55 notify: true, |
56 }, | 56 }, |
57 | 57 |
58 groupedOffset: { | 58 groupedOffset: { |
59 type: Number, | 59 type: Number, |
60 notify: true, | 60 notify: true, |
61 }, | 61 }, |
62 | 62 |
| 63 hasMoreResults: Boolean, |
| 64 |
63 querying: Boolean, | 65 querying: Boolean, |
64 | 66 |
65 hasMoreResults: Boolean, | 67 queryInfo: Object, |
66 | |
67 // The start time of the query range. | |
68 queryStartTime: String, | |
69 | |
70 // The end time of the query range. | |
71 queryEndTime: String, | |
72 | 68 |
73 // Whether to show the menu promo (a tooltip that points at the menu button | 69 // Whether to show the menu promo (a tooltip that points at the menu button |
74 // in narrow mode). | 70 // in narrow mode). |
75 showMenuPromo: Boolean, | 71 showMenuPromo: Boolean, |
76 | 72 |
77 showSyncNotice: Boolean, | 73 showSyncNotice: Boolean, |
78 }, | 74 }, |
79 | 75 |
80 /** @return {CrToolbarSearchFieldElement} */ | 76 /** @return {CrToolbarSearchFieldElement} */ |
81 get searchField() { | 77 get searchField() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 deletingAllowed_: function() { | 139 deletingAllowed_: function() { |
144 return loadTimeData.getBoolean('allowDeletingHistory'); | 140 return loadTimeData.getBoolean('allowDeletingHistory'); |
145 }, | 141 }, |
146 | 142 |
147 /** @private */ | 143 /** @private */ |
148 numberOfItemsSelected_: function(count) { | 144 numberOfItemsSelected_: function(count) { |
149 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 145 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
150 }, | 146 }, |
151 | 147 |
152 /** @private */ | 148 /** @private */ |
153 getHistoryInterval_: function(queryStartTime, queryEndTime) { | 149 getHistoryInterval_: function() { |
154 // TODO(calamity): Fix the format of these dates. | 150 var info = this.queryInfo; |
155 return loadTimeData.getStringF( | 151 if (this.groupedRange == HistoryRange.WEEK) |
156 'historyInterval', queryStartTime, queryEndTime); | 152 return info.queryInterval; |
| 153 |
| 154 if (this.groupedRange == HistoryRange.MONTH) |
| 155 return info.queryStartMonth; |
157 }, | 156 }, |
158 | 157 |
159 /** @private */ | 158 /** @private */ |
160 onTodayTap_: function() { | 159 onTodayTap_: function() { |
161 if (!this.querying) | 160 if (!this.querying) |
162 this.groupedOffset = 0; | 161 this.groupedOffset = 0; |
163 }, | 162 }, |
164 | 163 |
165 /** @private */ | 164 /** @private */ |
166 onPrevTap_: function() { | 165 onPrevTap_: function() { |
167 if (!this.querying) | 166 if (!this.querying) |
168 this.groupedOffset = this.groupedOffset + 1; | 167 this.groupedOffset = this.groupedOffset + 1; |
169 }, | 168 }, |
170 | 169 |
171 /** @private */ | 170 /** @private */ |
172 onNextTap_: function() { | 171 onNextTap_: function() { |
173 if (!this.querying) | 172 if (!this.querying) |
174 this.groupedOffset = this.groupedOffset - 1; | 173 this.groupedOffset = this.groupedOffset - 1; |
175 }, | 174 }, |
176 | 175 |
177 /** | 176 /** |
178 * @private | 177 * @private |
179 * @return {boolean} | 178 * @return {boolean} |
180 */ | 179 */ |
181 isToday_: function() { | 180 isToday_: function() { |
182 return this.groupedOffset == 0; | 181 return this.groupedOffset == 0; |
183 }, | 182 }, |
184 }); | 183 }); |
OLD | NEW |