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 25 matching lines...) Expand all Loading... |
36 reflectToAttribute: true | 36 reflectToAttribute: true |
37 }, | 37 }, |
38 | 38 |
39 // The most recent term entered in the search field. Updated incrementally | 39 // The most recent term entered in the search field. Updated incrementally |
40 // as the user types. | 40 // as the user types. |
41 searchTerm: { | 41 searchTerm: { |
42 type: String, | 42 type: String, |
43 value: '' | 43 value: '' |
44 }, | 44 }, |
45 | 45 |
46 // True if it's searching at the backend. | 46 // True if waiting on the search backend. |
47 searching: { | 47 searching: { |
48 type: Boolean, | 48 type: Boolean, |
49 value: false | 49 value: false |
50 }, | 50 }, |
| 51 |
| 52 // Whether domain-grouped history is enabled. |
| 53 isGroupedMode: { |
| 54 type: Boolean, |
| 55 reflectToAttribute: true, |
| 56 observer: 'groupedModeChanged_' |
| 57 }, |
| 58 |
| 59 // Whether the page is displaying in RTL. |
| 60 isRtl_: { |
| 61 type: Boolean, |
| 62 reflectToAttribute: true |
| 63 }, |
| 64 |
| 65 // The period to search over. Matches BrowsingHistoryHandler::Range. |
| 66 groupedPeriod: { |
| 67 type: Number, |
| 68 value: 0, |
| 69 reflectToAttribute: true |
| 70 }, |
| 71 |
| 72 // The start time of the query range. |
| 73 queryStartTime: String, |
| 74 |
| 75 // The end time of the query range. |
| 76 queryEndTime: String, |
51 }, | 77 }, |
52 | 78 |
53 /** | 79 /** |
54 * Changes the toolbar background color depending on whether any history items | 80 * Changes the toolbar background color depending on whether any history items |
55 * are currently selected. | 81 * are currently selected. |
56 * @private | 82 * @private |
57 */ | 83 */ |
58 changeToolbarView_: function() { | 84 changeToolbarView_: function() { |
59 this.itemsSelected_ = this.count > 0; | 85 this.itemsSelected_ = this.count > 0; |
60 }, | 86 }, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 /** | 127 /** |
102 * If the user is a supervised user the delete button is not shown. | 128 * If the user is a supervised user the delete button is not shown. |
103 * @private | 129 * @private |
104 */ | 130 */ |
105 deletingAllowed_: function() { | 131 deletingAllowed_: function() { |
106 return loadTimeData.getBoolean('allowDeletingHistory'); | 132 return loadTimeData.getBoolean('allowDeletingHistory'); |
107 }, | 133 }, |
108 | 134 |
109 numberOfItemsSelected_: function(count) { | 135 numberOfItemsSelected_: function(count) { |
110 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; | 136 return count > 0 ? loadTimeData.getStringF('itemsSelected', count) : ''; |
| 137 }, |
| 138 |
| 139 groupedModeChanged_: function() { |
| 140 this.isRtl_ = isRTL(); |
| 141 }, |
| 142 |
| 143 getHistoryInterval_: function(queryStartTime, queryEndTime) { |
| 144 // TODO(calamity): Fix the format of these dates. |
| 145 return loadTimeData.getStringF( |
| 146 'historyInterval', queryStartTime, queryEndTime); |
111 } | 147 } |
112 }); | 148 }); |
OLD | NEW |