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

Unified Diff: chrome/browser/resources/history/other_devices.js

Issue 2069183002: [Sync] Add option to remove device from "Other devices" on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Dan's comments. Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c69f68222b0f43dc5ee21f30ce0f62e34d5f7d39..cc362b499b7c41b2894b75af7c8d7e19d337f172 100644
--- a/chrome/browser/resources/history/other_devices.js
+++ b/chrome/browser/resources/history/other_devices.js
@@ -67,9 +67,10 @@ DeviceContextMenuController.prototype.initialize = function() {
this.expandItem_ = this.appendMenuItem_('expandSessionMenuItemText');
this.expandItem_.addEventListener('activate',
this.onCollapseOrExpand_.bind(this));
- this.openAllItem_ = this.appendMenuItem_('restoreSessionMenuItemText');
- this.openAllItem_.addEventListener('activate',
- this.onOpenAll_.bind(this));
+ var openAllItem = this.appendMenuItem_('restoreSessionMenuItemText');
+ openAllItem.addEventListener('activate', this.onOpenAll_.bind(this));
+ var deleteItem = this.appendMenuItem_('deleteSessionMenuItemText');
+ deleteItem.addEventListener('activate', this.onDeleteSession_.bind(this));
};
/**
@@ -127,6 +128,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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698