| 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 // Globals: | 5 // Globals: |
| 6 /** @const */ var RESULTS_PER_PAGE = 150; | 6 /** @const */ var RESULTS_PER_PAGE = 150; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Amount of time between pageviews that we consider a 'break' in browsing, | 9 * Amount of time between pageviews that we consider a 'break' in browsing, |
| 10 * measured in milliseconds. | 10 * measured in milliseconds. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Resizing browser window will cause the overflow menu to close. | 56 * Resizing browser window will cause the overflow menu to close. |
| 57 */ | 57 */ |
| 58 window.addEventListener('resize', function() { | 58 window.addEventListener('resize', function() { |
| 59 $('history-card-manager').closeMenu(); | 59 $('history-card-manager').closeMenu(); |
| 60 }); | 60 }); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * When the search is changed refresh the results and load either search results | 63 * When the search is changed refresh the results and load either search results |
| 64 * or normal history results. | 64 * or normal history results. If they are search results, make sure the search |
| 65 * bar reflects the search term being used. |
| 65 */ | 66 */ |
| 66 window.addEventListener('refresh-results', function(e) { | 67 window.addEventListener('refresh-results', function(e) { |
| 68 if (e.detail.search != '') |
| 69 $('toolbar').setSearchTerm(e.detail.search); |
| 67 $('history-card-manager').resetHistoryResults(); | 70 $('history-card-manager').resetHistoryResults(); |
| 68 chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]); | 71 chrome.send('queryHistory', [e.detail.search, 0, 0, 0, RESULTS_PER_PAGE]); |
| 69 }); | 72 }); |
| OLD | NEW |