OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('md_history', function() { | 5 cr.define('md_history', function() { |
6 var lazyLoadPromise = null; | 6 var lazyLoadPromise = null; |
7 function ensureLazyLoaded() { | 7 function ensureLazyLoaded() { |
8 if (!lazyLoadPromise) { | 8 if (!lazyLoadPromise) { |
9 lazyLoadPromise = new Promise(function(resolve, reject) { | 9 lazyLoadPromise = new Promise(function(resolve, reject) { |
10 Polymer.Base.importHref( | 10 Polymer.Base.importHref( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 type: Object, | 43 type: Object, |
44 value: function() { | 44 value: function() { |
45 return { | 45 return { |
46 // Whether the most recent query was incremental. | 46 // Whether the most recent query was incremental. |
47 incremental: false, | 47 incremental: false, |
48 // A query is initiated by page load. | 48 // A query is initiated by page load. |
49 querying: true, | 49 querying: true, |
50 queryingDisabled: false, | 50 queryingDisabled: false, |
51 _range: HistoryRange.ALL_TIME, | 51 _range: HistoryRange.ALL_TIME, |
52 searchTerm: '', | 52 searchTerm: '', |
53 // TODO(calamity): Make history toolbar buttons change the offset | |
54 groupedOffset: 0, | 53 groupedOffset: 0, |
55 | 54 |
56 set range(val) { this._range = Number(val); }, | 55 set range(val) { this._range = Number(val); }, |
57 get range() { return this._range; }, | 56 get range() { return this._range; }, |
58 }; | 57 }; |
59 } | 58 } |
60 }, | 59 }, |
61 | 60 |
62 /** @type {!QueryResult} */ | 61 /** @type {!QueryResult} */ |
63 queryResult_: { | 62 queryResult_: { |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 break; | 394 break; |
396 } | 395 } |
397 break; | 396 break; |
398 } | 397 } |
399 | 398 |
400 md_history.BrowserService.getInstance().recordHistogram( | 399 md_history.BrowserService.getInstance().recordHistogram( |
401 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END | 400 'History.HistoryPageView', histogramValue, HistoryPageViewHistogram.END |
402 ); | 401 ); |
403 }, | 402 }, |
404 }); | 403 }); |
OLD | NEW |