Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9321)

Unified Diff: chrome/browser/resources/md_history/history-card.js

Issue 1574063003: MD History: Add basic material design history cards and history items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..79035eac759fdc2e03ef99ce670549435c014f37
--- /dev/null
+++ b/chrome/browser/resources/md_history/history-card.js
@@ -0,0 +1,33 @@
+// 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',
Dan Beam 2016/01/16 02:54:36 nit: \n
yingran 2016/01/18 05:40:29 Done.
+ properties: {
+ // The date of these history items.
+ historyDate: {
+ type: String,
+ value: ''
+ },
+ // The list of history results that were accessed for a particular day in
+ // reverse chronological order.
+ historyItems: {
+ type: Array,
+ value: []
Dan Beam 2016/01/16 02:54:36 this should be: value: function() { return [];
yingran 2016/01/18 05:40:29 Done.
+ }
+ },
+
+ /**
+ * 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));
Dan Beam 2016/01/16 02:54:36 isn't this equivalent to return index + 1 < items
yingran 2016/01/18 05:40:29 yep
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698