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

Unified Diff: chrome/browser/resources/md_history/synced_device_card.js

Issue 2172563002: [MD History] Use openForeignSession message to open foreign session tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_menu_up
Patch Set: 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
Index: chrome/browser/resources/md_history/synced_device_card.js
diff --git a/chrome/browser/resources/md_history/synced_device_card.js b/chrome/browser/resources/md_history/synced_device_card.js
index f58cec9b879a49fbe0ea21c0c047470168aa99c3..6bbc0aa4c71414a062a1112cfefd07a8c5915381 100644
--- a/chrome/browser/resources/md_history/synced_device_card.js
+++ b/chrome/browser/resources/md_history/synced_device_card.js
@@ -34,16 +34,30 @@ Polymer({
cardOpen_: {type: Boolean, value: true},
searchTerm: String,
+
+ windowId: Number,
tsergeant 2016/07/22 03:21:17 Nit: Newline between these
calamity 2016/07/27 05:22:07 Done.
+ sessionTag: String,
},
/**
* Opens all the tabs displayed on the device in separate tabs.
+ * @param {Event} e
+ * @private
+ */
+ openAllTabs_: function(e) {
tsergeant 2016/07/22 03:21:17 e is unused, you can get rid of it
calamity 2016/07/27 05:22:06 Done.
+ md_history.BrowserService.getInstance().openForeignSessionAllTabs(
+ this.sessionTag);
+ },
+
+ /**
+ * @param {Event} e
* @private
*/
- openAllTabs_: function() {
- // TODO(calamity): add a warning if an excessive number of tabs will open.
- for (var i = 0; i < this.tabs.length; i++)
- window.open(this.tabs[i].url, '_blank');
+ openTab_: function(e) {
+ var currentTarget = e.currentTarget;
tsergeant 2016/07/22 03:21:17 You should be able to use `e.model` to avoid stick
calamity 2016/07/27 05:22:07 Done.
+ md_history.BrowserService.getInstance().openForeignSessionTab(
+ this.sessionTag, currentTarget.windowId, currentTarget.sessionId, e);
+ e.preventDefault();
},
/**

Powered by Google App Engine
This is Rietveld 408576698