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

Side by Side Diff: chrome/browser/resources/md_history/history_item.js

Issue 2207323002: [MD History] Factor out a common HistoryListBehavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 isCardStart: {type: Boolean, reflectToAttribute: true}, 24 isCardStart: {type: Boolean, reflectToAttribute: true},
25 25
26 isCardEnd: {type: Boolean, reflectToAttribute: true}, 26 isCardEnd: {type: Boolean, reflectToAttribute: true},
27 27
28 // True if the item is being displayed embedded in another element and 28 // True if the item is being displayed embedded in another element and
29 // should not manage its own borders or size. 29 // should not manage its own borders or size.
30 embedded: {type: Boolean, reflectToAttribute: true}, 30 embedded: {type: Boolean, reflectToAttribute: true},
31 31
32 hasTimeGap: {type: Boolean}, 32 hasTimeGap: {type: Boolean},
33 33
34 numberOfItems: {type: Number} 34 numberOfItems: {type: Number},
35
36 // The path of this history item inside its parent.
37 path: String,
35 }, 38 },
36 39
37 /** 40 /**
38 * When a history-item is selected the toolbar is notified and increases 41 * When a history-item is selected the toolbar is notified and increases
39 * or decreases its count of selected items accordingly. 42 * or decreases its count of selected items accordingly.
40 * @private 43 * @private
41 */ 44 */
42 onCheckboxSelected_: function() { 45 onCheckboxSelected_: function() {
43 this.fire('history-checkbox-select', { 46 this.fire('history-checkbox-select', {
tsergeant 2016/08/05 01:39:09 I think we should consider making this fire on sel
calamity 2016/08/09 02:56:00 Yeah, I agree. Added a TODO.
47 element: this,
44 countAddition: this.$.checkbox.checked ? 1 : -1 48 countAddition: this.$.checkbox.checked ? 1 : -1
45 }); 49 });
46 }, 50 },
47 51
48 /** 52 /**
49 * Remove bookmark of current item when bookmark-star is clicked. 53 * Remove bookmark of current item when bookmark-star is clicked.
50 * @private 54 * @private
51 */ 55 */
52 onRemoveBookmarkTap_: function() { 56 onRemoveBookmarkTap_: function() {
53 if (this.$['bookmark-star'] == this.root.activeElement) 57 if (this.$['bookmark-star'] == this.root.activeElement)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 135
132 if (searchedTerm) 136 if (searchedTerm)
133 return currentItem.dateShort != nextItem.dateShort; 137 return currentItem.dateShort != nextItem.dateShort;
134 138
135 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && 139 return currentItem.time - nextItem.time > BROWSING_GAP_TIME &&
136 currentItem.dateRelativeDay == nextItem.dateRelativeDay; 140 currentItem.dateRelativeDay == nextItem.dateRelativeDay;
137 }; 141 };
138 142
139 return { HistoryItem: HistoryItem }; 143 return { HistoryItem: HistoryItem };
140 }); 144 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698