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 cr.define('md_history', function() { | 5 cr.define('md_history', function() { |
6 var HistoryItem = Polymer({ | 6 var HistoryItem = Polymer({ |
7 is: 'history-item', | 7 is: 'history-item', |
8 | 8 |
9 properties: { | 9 properties: { |
10 // Underlying HistoryEntry data for this item. Contains read-only fields | 10 // Underlying HistoryEntry data for this item. Contains read-only fields |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Stops the 'tap' event from closing the menu when it opens. | 89 // Stops the 'tap' event from closing the menu when it opens. |
90 e.stopPropagation(); | 90 e.stopPropagation(); |
91 }, | 91 }, |
92 | 92 |
93 /** | 93 /** |
94 * Set the favicon image, based on the URL of the history item. | 94 * Set the favicon image, based on the URL of the history item. |
95 * @private | 95 * @private |
96 */ | 96 */ |
97 showIcon_: function() { | 97 showIcon_: function() { |
98 this.$.icon.style.backgroundImage = | 98 this.$.icon.style.backgroundImage = cr.icon.getFavicon(this.item.url); |
99 cr.icon.getFaviconImageSet(this.item.url); | |
100 }, | 99 }, |
101 | 100 |
102 selectionNotAllowed_: function() { | 101 selectionNotAllowed_: function() { |
103 return !loadTimeData.getBoolean('allowDeletingHistory'); | 102 return !loadTimeData.getBoolean('allowDeletingHistory'); |
104 }, | 103 }, |
105 | 104 |
106 /** | 105 /** |
107 * Generates the title for this history card. | 106 * Generates the title for this history card. |
108 * @param {number} numberOfItems The number of items in the card. | 107 * @param {number} numberOfItems The number of items in the card. |
109 * @param {string} search The search term associated with these results. | 108 * @param {string} search The search term associated with these results. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 148 |
150 if (searchedTerm) | 149 if (searchedTerm) |
151 return currentItem.dateShort != nextItem.dateShort; | 150 return currentItem.dateShort != nextItem.dateShort; |
152 | 151 |
153 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 152 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
154 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 153 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
155 }; | 154 }; |
156 | 155 |
157 return { HistoryItem: HistoryItem }; | 156 return { HistoryItem: HistoryItem }; |
158 }); | 157 }); |
OLD | NEW |