Chromium Code Reviews| Index: chrome/browser/resources/history/other_devices.js |
| diff --git a/chrome/browser/resources/history/other_devices.js b/chrome/browser/resources/history/other_devices.js |
| index 2f5b77d30f2aeaef8afb6483f513071bf5ecbd8f..edb99711d802bbd82024278b854f4b0c0f5c9b2c 100644 |
| --- a/chrome/browser/resources/history/other_devices.js |
| +++ b/chrome/browser/resources/history/other_devices.js |
| @@ -25,7 +25,8 @@ |
| EXPAND_SESSION: 7, |
| OPEN_ALL: 8, |
| HAS_FOREIGN_DATA: 9, |
| - LIMIT: 10 // Should always be the last one. |
| + HIDE_FOR_NOW: 10, |
| + LIMIT: 11 // Should always be the last one. |
| }; |
| /** |
| @@ -69,6 +70,9 @@ DeviceContextMenuController.prototype.initialize = function() { |
| this.openAllItem_ = this.appendMenuItem_('restoreSessionMenuItemText'); |
| this.openAllItem_.addEventListener('activate', |
| this.onOpenAll_.bind(this)); |
| + this.deleteItem_ = this.appendMenuItem_('deleteSessionMenuItemText'); |
|
Dan Beam
2016/07/30 00:54:08
why do we need to set to this.deleteItem_ rather t
pavely
2016/08/01 19:25:13
You are right, in contrast with collapseItem_ and
|
| + this.deleteItem_.addEventListener('activate', |
| + this.onDeleteSession_.bind(this)); |
| }; |
| /** |
| @@ -126,6 +130,16 @@ DeviceContextMenuController.prototype.onOpenAll_ = function(e) { |
| }; |
| /** |
| + * Handler for the 'Hide for now' menu item. |
| + * @param {Event} e The activation event. |
| + * @private |
| + */ |
| +DeviceContextMenuController.prototype.onDeleteSession_ = function(e) { |
| + chrome.send('deleteForeignSession', [this.session_.tag]); |
| + recordUmaEvent_(HISTOGRAM_EVENT.HIDE_FOR_NOW); |
| +}; |
| + |
| +/** |
| * Set the visibility of the Expand/Collapse menu items based on the state |
| * of the session that this menu is currently associated with. |
| * @private |