Chromium Code Reviews| Index: chrome/browser/resources/md_history/history_card.js |
| diff --git a/chrome/browser/resources/md_history/history_card.js b/chrome/browser/resources/md_history/history_card.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..542a6d9ecd8a8645bbd1ffc474d9d8b5d10d2510 |
| --- /dev/null |
| +++ b/chrome/browser/resources/md_history/history_card.js |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +Polymer({ |
| + is: 'history-card', |
| + |
| + properties: { |
| + // The date of these history items. |
| + historyDate: { |
| + type: String, |
| + value: '' |
| + }, |
|
Dan Beam
2016/01/27 03:07:30
nit: \n between props
yingran
2016/01/27 05:05:03
Done.
Dan Beam
2016/01/27 18:20:07
(not yet done)
yingran
2016/01/28 00:51:00
Done.
|
| + // The list of history results that were accessed for a particular day in |
| + // reverse chronological order. |
| + historyItems: { |
| + type: Array, |
| + value: function() { return []; } |
| + } |
| + }, |
| + |
| + /** |
| + * Check whether the time difference between the given historyItem and the |
| + * next one is large enough for a spacer to be required. |
| + * @param {number} index The index number of the first item being compared. |
| + * @return {boolean} Whether or not time gap separator is required. |
| + * @private |
| + */ |
| + needsTimeGap_: function(index) { |
| + var items = this.historyItems; |
| + return index + 1 < items.length && |
| + items[index].time - items[index + 1].time > BROWSING_GAP_TIME; |
| + } |
| +}); |