| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 }, | 60 }, |
| 61 | 61 |
| 62 // The start time of the query range. | 62 // The start time of the query range. |
| 63 queryStartTime: String, | 63 queryStartTime: String, |
| 64 | 64 |
| 65 // The end time of the query range. | 65 // The end time of the query range. |
| 66 queryEndTime: String, | 66 queryEndTime: String, |
| 67 | 67 |
| 68 // Whether to show the menu promo (a tooltip that points at the menu button | 68 // Whether to show the menu promo (a tooltip that points at the menu button |
| 69 // in narrow mode). | 69 // in narrow mode). |
| 70 showMenuPromo_: { | 70 showMenuPromo: Boolean, |
| 71 type: Boolean, | |
| 72 value: function() { | |
| 73 return loadTimeData.getBoolean('showMenuPromo'); | |
| 74 }, | |
| 75 }, | |
| 76 }, | 71 }, |
| 77 | 72 |
| 78 /** @return {CrToolbarSearchFieldElement} */ | 73 /** @return {CrToolbarSearchFieldElement} */ |
| 79 get searchField() { | 74 get searchField() { |
| 80 return /** @type {CrToolbarElement} */ (this.$['main-toolbar']) | 75 return /** @type {CrToolbarElement} */ (this.$['main-toolbar']) |
| 81 .getSearchField(); | 76 .getSearchField(); |
| 82 }, | 77 }, |
| 83 | 78 |
| 84 showSearchField: function() { | 79 showSearchField: function() { |
| 85 this.searchField.showAndFocus(); | 80 this.searchField.showAndFocus(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 98 * When changing the search term externally, update the search field to | 93 * When changing the search term externally, update the search field to |
| 99 * reflect the new search term. | 94 * reflect the new search term. |
| 100 */ | 95 */ |
| 101 searchTermChanged_: function() { | 96 searchTermChanged_: function() { |
| 102 if (this.searchField.getValue() != this.searchTerm) { | 97 if (this.searchField.getValue() != this.searchTerm) { |
| 103 this.searchField.showAndFocus(); | 98 this.searchField.showAndFocus(); |
| 104 this.searchField.setValue(this.searchTerm); | 99 this.searchField.setValue(this.searchTerm); |
| 105 } | 100 } |
| 106 }, | 101 }, |
| 107 | 102 |
| 108 /** @private */ | |
| 109 onMenuPromoShown_: function() { | |
| 110 md_history.BrowserService.getInstance().menuPromoShown(); | |
| 111 }, | |
| 112 | |
| 113 /** | 103 /** |
| 114 * @param {!CustomEvent} event | 104 * @param {!CustomEvent} event |
| 115 * @private | 105 * @private |
| 116 */ | 106 */ |
| 117 onSearchChanged_: function(event) { | 107 onSearchChanged_: function(event) { |
| 118 this.searchTerm = /** @type {string} */ (event.detail); | 108 this.searchTerm = /** @type {string} */ (event.detail); |
| 119 }, | 109 }, |
| 120 | 110 |
| 121 /** @private */ | 111 /** @private */ |
| 122 onInfoButtonTap_: function() { | 112 onInfoButtonTap_: function() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 152 // TODO(calamity): Fix the format of these dates. | 142 // TODO(calamity): Fix the format of these dates. |
| 153 return loadTimeData.getStringF( | 143 return loadTimeData.getStringF( |
| 154 'historyInterval', queryStartTime, queryEndTime); | 144 'historyInterval', queryStartTime, queryEndTime); |
| 155 }, | 145 }, |
| 156 | 146 |
| 157 /** @private */ | 147 /** @private */ |
| 158 hasDrawerChanged_: function() { | 148 hasDrawerChanged_: function() { |
| 159 this.updateStyles(); | 149 this.updateStyles(); |
| 160 }, | 150 }, |
| 161 }); | 151 }); |
| OLD | NEW |