| 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 24 matching lines...) Expand all Loading... |
| 35 type: Boolean, | 35 type: Boolean, |
| 36 value: false | 36 value: false |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 hasDrawer: { | 39 hasDrawer: { |
| 40 type: Boolean, | 40 type: Boolean, |
| 41 observer: 'hasDrawerChanged_', | 41 observer: 'hasDrawerChanged_', |
| 42 reflectToAttribute: true, | 42 reflectToAttribute: true, |
| 43 }, | 43 }, |
| 44 | 44 |
| 45 showSyncNotice: Boolean, |
| 46 |
| 45 // Whether domain-grouped history is enabled. | 47 // Whether domain-grouped history is enabled. |
| 46 isGroupedMode: { | 48 isGroupedMode: { |
| 47 type: Boolean, | 49 type: Boolean, |
| 48 reflectToAttribute: true, | 50 reflectToAttribute: true, |
| 49 }, | 51 }, |
| 50 | 52 |
| 51 // The period to search over. Matches BrowsingHistoryHandler::Range. | 53 // The period to search over. Matches BrowsingHistoryHandler::Range. |
| 52 groupedRange: { | 54 groupedRange: { |
| 53 type: Number, | 55 type: Number, |
| 54 value: 0, | 56 value: 0, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 }, | 91 }, |
| 90 | 92 |
| 91 /** | 93 /** |
| 92 * @param {!CustomEvent} event | 94 * @param {!CustomEvent} event |
| 93 * @private | 95 * @private |
| 94 */ | 96 */ |
| 95 onSearchChanged_: function(event) { | 97 onSearchChanged_: function(event) { |
| 96 this.searchTerm = /** @type {string} */ (event.detail); | 98 this.searchTerm = /** @type {string} */ (event.detail); |
| 97 }, | 99 }, |
| 98 | 100 |
| 101 /** @private */ |
| 102 onInfoButtonTap_: function() { |
| 103 this.$.syncNotice.get().then(function(dropdown) { |
| 104 dropdown.positionTarget = this.$$('#info-button-icon'); |
| 105 // It is possible for this listener to trigger while the dialog is |
| 106 // closing. Ensure the dialog is fully closed before reopening it. |
| 107 if (dropdown.style.display == 'none') |
| 108 dropdown.open(); |
| 109 }.bind(this)); |
| 110 }, |
| 111 |
| 99 onClearSelectionTap_: function() { | 112 onClearSelectionTap_: function() { |
| 100 this.fire('unselect-all'); | 113 this.fire('unselect-all'); |
| 101 }, | 114 }, |
| 102 | 115 |
| 103 onDeleteTap_: function() { | 116 onDeleteTap_: function() { |
| 104 this.fire('delete-selected'); | 117 this.fire('delete-selected'); |
| 105 }, | 118 }, |
| 106 | 119 |
| 107 get searchBar() { | 120 get searchBar() { |
| 108 return this.$['main-toolbar'].getSearchField(); | 121 return this.$['main-toolbar'].getSearchField(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 130 // TODO(calamity): Fix the format of these dates. | 143 // TODO(calamity): Fix the format of these dates. |
| 131 return loadTimeData.getStringF( | 144 return loadTimeData.getStringF( |
| 132 'historyInterval', queryStartTime, queryEndTime); | 145 'historyInterval', queryStartTime, queryEndTime); |
| 133 }, | 146 }, |
| 134 | 147 |
| 135 /** @private */ | 148 /** @private */ |
| 136 hasDrawerChanged_: function() { | 149 hasDrawerChanged_: function() { |
| 137 this.updateStyles(); | 150 this.updateStyles(); |
| 138 }, | 151 }, |
| 139 }); | 152 }); |
| OLD | NEW |