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 |
| index 882bf037278832d0ed47061e7b92f1f095d0333d..479c476e77373f056bdb1fb299ac7e3f12726fa9 100644 |
| --- a/chrome/browser/resources/md_history/history_toolbar.js |
| +++ b/chrome/browser/resources/md_history/history_toolbar.js |
| @@ -8,19 +8,11 @@ Polymer({ |
| // Number of history items currently selected. |
| // TODO(calamity): bind this to |
| // listContainer.selectedItem.selectedPaths.length. |
| - count: { |
| - type: Number, |
| - value: 0, |
| - observer: 'changeToolbarView_' |
| - }, |
| + 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 |
| - }, |
| + itemsSelected_: {type: Boolean, value: false, reflectToAttribute: true}, |
| // The most recent term entered in the search field. Updated incrementally |
| // as the user types. |
| @@ -32,10 +24,7 @@ Polymer({ |
| // True if the backend is processing and a spinner should be shown in the |
| // toolbar. |
| - spinnerActive: { |
| - type: Boolean, |
| - value: false |
| - }, |
| + spinnerActive: {type: Boolean, value: false}, |
| hasDrawer: { |
| type: Boolean, |
| @@ -54,11 +43,19 @@ Polymer({ |
| // The period to search over. Matches BrowsingHistoryHandler::Range. |
| groupedRange: { |
| type: Number, |
| - value: 0, |
| reflectToAttribute: true, |
| - notify: true |
| + notify: true, |
| }, |
| + groupedOffset: { |
| + type: Number, |
| + notify: true, |
| + }, |
| + |
| + querying: Boolean, |
| + |
| + queryFinished: Boolean, |
|
tsergeant
2016/11/11 02:34:27
I was a bit confused by this name, because it soun
calamity
2016/11/22 06:44:56
hasMoreResults is probably optimally clear. Even w
|
| + |
| // The start time of the query range. |
| queryStartTime: String, |
| @@ -76,22 +73,19 @@ Polymer({ |
| .getSearchField(); |
| }, |
| - showSearchField: function() { |
| - this.searchField.showAndFocus(); |
| - }, |
| + showSearchField: function() { this.searchField.showAndFocus(); }, |
| /** |
| * Changes the toolbar background color depending on whether any history items |
| * are currently selected. |
| * @private |
| */ |
| - changeToolbarView_: function() { |
| - this.itemsSelected_ = this.count > 0; |
| - }, |
| + changeToolbarView_: function() { this.itemsSelected_ = this.count > 0; }, |
| /** |
| * When changing the search term externally, update the search field to |
| * reflect the new search term. |
| + * @private |
| */ |
| searchTermChanged_: function() { |
| if (this.searchField.getValue() != this.searchTerm) { |
| @@ -118,13 +112,11 @@ Polymer({ |
| dropdown.open(); |
| }, |
| - onClearSelectionTap_: function() { |
| - this.fire('unselect-all'); |
| - }, |
| + /** @private */ |
| + onClearSelectionTap_: function() { this.fire('unselect-all'); }, |
| - onDeleteTap_: function() { |
| - this.fire('delete-selected'); |
| - }, |
| + /** @private */ |
| + onDeleteTap_: function() { this.fire('delete-selected'); }, |
| /** |
| * If the user is a supervised user the delete button is not shown. |
| @@ -134,10 +126,12 @@ Polymer({ |
| return loadTimeData.getBoolean('allowDeletingHistory'); |
| }, |
| + /** @private */ |
| numberOfItemsSelected_: function(count) { |
| return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
| }, |
| + /** @private */ |
| getHistoryInterval_: function(queryStartTime, queryEndTime) { |
| // TODO(calamity): Fix the format of these dates. |
| return loadTimeData.getStringF( |
| @@ -145,7 +139,29 @@ Polymer({ |
| }, |
| /** @private */ |
| - hasDrawerChanged_: function() { |
| - this.updateStyles(); |
| + hasDrawerChanged_: function() { this.updateStyles(); }, |
|
tsergeant
2016/11/11 02:34:27
While you're here...
I'm pretty sure this listene
calamity
2016/11/22 06:44:56
Done.
|
| + |
| + /** @private */ |
| + todayTapped_: function() { |
| + if (!this.querying) |
| + this.groupedOffset = 0; |
| }, |
| + |
| + /** @private */ |
| + prevTapped_: function() { |
| + if (!this.querying) |
| + this.groupedOffset = this.groupedOffset + 1; |
| + }, |
| + |
| + /** @private */ |
| + nextTapped_: function() { |
| + if (!this.querying) |
| + this.groupedOffset = this.groupedOffset - 1; |
| + }, |
| + |
| + /** |
| + * @private |
| + * @return {boolean} |
| + */ |
| + isToday_: function() { return this.groupedOffset == 0; }, |
| }); |