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

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: Fix string order Created 4 years, 6 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') | chrome/browser/ui/webui/history_ui.cc » ('J')
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 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/history_ui.cc » ('j') | chrome/browser/ui/webui/history_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698