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

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: fix nits 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() {
46 // TODO(calamity): Fire this event whenever |selected| changes.
43 this.fire('history-checkbox-select', { 47 this.fire('history-checkbox-select', {
48 element: this,
44 countAddition: this.$.checkbox.checked ? 1 : -1 49 countAddition: this.$.checkbox.checked ? 1 : -1
45 }); 50 });
46 }, 51 },
47 52
48 /** 53 /**
49 * Remove bookmark of current item when bookmark-star is clicked. 54 * Remove bookmark of current item when bookmark-star is clicked.
50 * @private 55 * @private
51 */ 56 */
52 onRemoveBookmarkTap_: function() { 57 onRemoveBookmarkTap_: function() {
53 if (this.$['bookmark-star'] == this.root.activeElement) 58 if (this.$['bookmark-star'] == this.root.activeElement)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 136
132 if (searchedTerm) 137 if (searchedTerm)
133 return currentItem.dateShort != nextItem.dateShort; 138 return currentItem.dateShort != nextItem.dateShort;
134 139
135 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && 140 return currentItem.time - nextItem.time > BROWSING_GAP_TIME &&
136 currentItem.dateRelativeDay == nextItem.dateRelativeDay; 141 currentItem.dateRelativeDay == nextItem.dateRelativeDay;
137 }; 142 };
138 143
139 return { HistoryItem: HistoryItem }; 144 return { HistoryItem: HistoryItem };
140 }); 145 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/grouped_list.js ('k') | chrome/browser/resources/md_history/history_list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698