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

Side by Side Diff: chrome/browser/resources/md_history/synced_device_card.js

Issue 2219753002: MD History: Fix crash when opening Synced Tab links with touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite patch to listen to click event, add regression test Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'history-synced-device-card', 6 is: 'history-synced-device-card',
7 7
8 properties: { 8 properties: {
9 // Name of the synced device. 9 // Name of the synced device.
10 device: {type: String, value: ''}, 10 device: {type: String, value: ''},
(...skipping 30 matching lines...) Expand all
41 /** 41 /**
42 * Opens all the tabs displayed on the device in separate tabs. 42 * Opens all the tabs displayed on the device in separate tabs.
43 * @private 43 * @private
44 */ 44 */
45 openAllTabs_: function() { 45 openAllTabs_: function() {
46 md_history.BrowserService.getInstance().openForeignSessionAllTabs( 46 md_history.BrowserService.getInstance().openForeignSessionAllTabs(
47 this.sessionTag); 47 this.sessionTag);
48 }, 48 },
49 49
50 /** 50 /**
51 * @param {TapEvent} e 51 * Open a single synced tab. Listens to 'click' rather than 'tap'
52 * to determine what modifier keys were pressed.
53 * @param {RepeatClickEvent} e
52 * @private 54 * @private
53 */ 55 */
54 openTab_: function(e) { 56 openTab_: function(e) {
55 var tab = /** @type {ForeignSessionTab} */(e.model.tab); 57 var tab = /** @type {ForeignSessionTab} */(e.model.tab);
56 var srcEvent = /** @type {Event} */(e.detail.sourceEvent);
57 md_history.BrowserService.getInstance().openForeignSessionTab( 58 md_history.BrowserService.getInstance().openForeignSessionTab(
58 this.sessionTag, tab.windowId, tab.sessionId, srcEvent); 59 this.sessionTag, tab.windowId, tab.sessionId, e);
59 e.preventDefault(); 60 e.preventDefault();
60 }, 61 },
61 62
62 /** 63 /**
63 * Toggles the dropdown display of synced tabs for each device card. 64 * Toggles the dropdown display of synced tabs for each device card.
64 */ 65 */
65 toggleTabCard: function() { 66 toggleTabCard: function() {
66 this.$.collapse.toggle(); 67 this.$.collapse.toggle();
67 this.$['dropdown-indicator'].icon = 68 this.$['dropdown-indicator'].icon =
68 this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more'; 69 this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more';
(...skipping 22 matching lines...) Expand all
91 92
92 /** 93 /**
93 * @param {boolean} cardOpen 94 * @param {boolean} cardOpen
94 * @return {string} 95 * @return {string}
95 */ 96 */
96 getCollapseTitle_: function(cardOpen) { 97 getCollapseTitle_: function(cardOpen) {
97 return cardOpen ? loadTimeData.getString('collapseSessionButton') : 98 return cardOpen ? loadTimeData.getString('collapseSessionButton') :
98 loadTimeData.getString('expandSessionButton'); 99 loadTimeData.getString('expandSessionButton');
99 }, 100 },
100 }); 101 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698