Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 * or decreases its count of selected items accordingly. | 35 * or decreases its count of selected items accordingly. |
| 36 * @private | 36 * @private |
| 37 */ | 37 */ |
| 38 onCheckboxSelected_: function() { | 38 onCheckboxSelected_: function() { |
| 39 this.fire('history-checkbox-select', { | 39 this.fire('history-checkbox-select', { |
| 40 countAddition: this.$.checkbox.checked ? 1 : -1 | 40 countAddition: this.$.checkbox.checked ? 1 : -1 |
| 41 }); | 41 }); |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Remove bookmark of current item when bookmark-star is clicked. | |
| 46 * @private | |
| 47 */ | |
| 48 onRemoveBookmarkTap_: function() { | |
| 49 chrome.send('removeBookmark', [this.item.url]); | |
|
calamity
2016/06/29 07:36:05
Consider moving this into a method in browser_serv
tsergeant
2016/06/30 01:41:10
Sure, sgtm.
lshang
2016/07/01 01:15:16
Done.
| |
| 50 this.fire('remove-bookmark-stars', this.item.url); | |
| 51 }, | |
| 52 | |
| 53 /** | |
| 45 * Fires a custom event when the menu button is clicked. Sends the details | 54 * Fires a custom event when the menu button is clicked. Sends the details |
| 46 * of the history item and where the menu should appear. | 55 * of the history item and where the menu should appear. |
| 47 */ | 56 */ |
| 48 onMenuButtonTap_: function(e) { | 57 onMenuButtonTap_: function(e) { |
| 49 this.fire('toggle-menu', { | 58 this.fire('toggle-menu', { |
| 50 target: Polymer.dom(e).localTarget, | 59 target: Polymer.dom(e).localTarget, |
| 51 item: this.item, | 60 item: this.item, |
| 52 }); | 61 }); |
| 53 | 62 |
| 54 // Stops the 'tap' event from closing the menu when it opens. | 63 // Stops the 'tap' event from closing the menu when it opens. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 | 111 |
| 103 if (searchedTerm) | 112 if (searchedTerm) |
| 104 return currentItem.dateShort != nextItem.dateShort; | 113 return currentItem.dateShort != nextItem.dateShort; |
| 105 | 114 |
| 106 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 115 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
| 107 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 116 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
| 108 }; | 117 }; |
| 109 | 118 |
| 110 return { HistoryItem: HistoryItem }; | 119 return { HistoryItem: HistoryItem }; |
| 111 }); | 120 }); |
| OLD | NEW |