| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {SearchFieldDelegate} | 7 * @implements {SearchFieldDelegate} |
| 8 * @param {!HistoryToolbarElement} toolbar This history-toolbar. | 8 * @param {!HistoryToolbarElement} toolbar This history-toolbar. |
| 9 */ | 9 */ |
| 10 function ToolbarSearchFieldDelegate(toolbar) { | 10 function ToolbarSearchFieldDelegate(toolbar) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 * reflect the new search term. | 84 * reflect the new search term. |
| 85 * @param {string} search | 85 * @param {string} search |
| 86 */ | 86 */ |
| 87 setSearchTerm: function(search) { | 87 setSearchTerm: function(search) { |
| 88 if (this.searchTerm == search) | 88 if (this.searchTerm == search) |
| 89 return; | 89 return; |
| 90 | 90 |
| 91 this.searchTerm = search; | 91 this.searchTerm = search; |
| 92 var searchField = /** @type {!CrToolbarElement} */(this.$['main-toolbar']) | 92 var searchField = /** @type {!CrToolbarElement} */(this.$['main-toolbar']) |
| 93 .getSearchField(); | 93 .getSearchField(); |
| 94 searchField.showAndFocus().then(function(showing) { | 94 searchField.showAndFocus(); |
| 95 if (showing) searchField.setValue(search); | 95 searchField.setValue(search); |
| 96 }); | |
| 97 }, | 96 }, |
| 98 | 97 |
| 99 /** | 98 /** |
| 100 * If the search term has changed reload for the new search. | 99 * If the search term has changed reload for the new search. |
| 101 */ | 100 */ |
| 102 onSearch: function(searchTerm) { | 101 onSearch: function(searchTerm) { |
| 103 if (searchTerm != this.searchTerm) | 102 if (searchTerm != this.searchTerm) |
| 104 this.searchTerm = searchTerm; | 103 this.searchTerm = searchTerm; |
| 105 }, | 104 }, |
| 106 | 105 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 129 numberOfItemsSelected_: function(count) { | 128 numberOfItemsSelected_: function(count) { |
| 130 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 129 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
| 131 }, | 130 }, |
| 132 | 131 |
| 133 getHistoryInterval_: function(queryStartTime, queryEndTime) { | 132 getHistoryInterval_: function(queryStartTime, queryEndTime) { |
| 134 // TODO(calamity): Fix the format of these dates. | 133 // TODO(calamity): Fix the format of these dates. |
| 135 return loadTimeData.getStringF( | 134 return loadTimeData.getStringF( |
| 136 'historyInterval', queryStartTime, queryEndTime); | 135 'historyInterval', queryStartTime, queryEndTime); |
| 137 } | 136 } |
| 138 }); | 137 }); |
| OLD | NEW |