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

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: Rename closure type 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: String, 10 device: String,
(...skipping 22 matching lines...) Expand all
33 // Whether the card is open. 33 // Whether the card is open.
34 cardOpen_: {type: Boolean, value: true}, 34 cardOpen_: {type: Boolean, value: true},
35 35
36 searchTerm: String, 36 searchTerm: String,
37 37
38 // Internal identifier for the device. 38 // Internal identifier for the device.
39 sessionTag: String, 39 sessionTag: String,
40 }, 40 },
41 41
42 /** 42 /**
43 * @param {TapEvent} e 43 * Open a single synced tab. Listens to 'click' rather than 'tap'
44 * to determine what modifier keys were pressed.
45 * @param {DomRepeatClickEvent} e
44 * @private 46 * @private
45 */ 47 */
46 openTab_: function(e) { 48 openTab_: function(e) {
47 var tab = /** @type {ForeignSessionTab} */(e.model.tab); 49 var tab = /** @type {ForeignSessionTab} */(e.model.tab);
48 var srcEvent = /** @type {Event} */(e.detail.sourceEvent);
49 md_history.BrowserService.getInstance().openForeignSessionTab( 50 md_history.BrowserService.getInstance().openForeignSessionTab(
50 this.sessionTag, tab.windowId, tab.sessionId, srcEvent); 51 this.sessionTag, tab.windowId, tab.sessionId, e);
51 e.preventDefault(); 52 e.preventDefault();
52 }, 53 },
53 54
54 /** 55 /**
55 * Toggles the dropdown display of synced tabs for each device card. 56 * Toggles the dropdown display of synced tabs for each device card.
56 */ 57 */
57 toggleTabCard: function() { 58 toggleTabCard: function() {
58 this.$.collapse.toggle(); 59 this.$.collapse.toggle();
59 this.$['dropdown-indicator'].icon = 60 this.$['dropdown-indicator'].icon =
60 this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more'; 61 this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more';
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * @private 96 * @private
96 */ 97 */
97 onMenuButtonTap_: function(e) { 98 onMenuButtonTap_: function(e) {
98 this.fire('toggle-menu', { 99 this.fire('toggle-menu', {
99 target: Polymer.dom(e).localTarget, 100 target: Polymer.dom(e).localTarget,
100 tag: this.sessionTag 101 tag: this.sessionTag
101 }); 102 });
102 e.stopPropagation(); // Prevent iron-collapse. 103 e.stopPropagation(); // Prevent iron-collapse.
103 }, 104 },
104 }); 105 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698