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

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

Issue 2251323002: MD History: Synced Tabs fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@history_css_shuffle
Patch Set: Review comment, revulcanize 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 13 matching lines...) Expand all
24 24
25 /** 25 /**
26 * The indexes where a window separator should be shown. The use of a 26 * The indexes where a window separator should be shown. The use of a
27 * separate array here is necessary for window separators to appear 27 * separate array here is necessary for window separators to appear
28 * correctly in search. See http://crrev.com/2022003002 for more details. 28 * correctly in search. See http://crrev.com/2022003002 for more details.
29 * @type {!Array<number>} 29 * @type {!Array<number>}
30 */ 30 */
31 separatorIndexes: Array, 31 separatorIndexes: Array,
32 32
33 // Whether the card is open. 33 // Whether the card is open.
34 cardOpen_: {type: Boolean, value: true}, 34 opened: Boolean,
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 * Open a single synced tab. Listens to 'click' rather than 'tap' 43 * Open a single synced tab. Listens to 'click' rather than 'tap'
44 * to determine what modifier keys were pressed. 44 * to determine what modifier keys were pressed.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 }); 77 });
78 }, 78 },
79 79
80 /** @private */ 80 /** @private */
81 isWindowSeparatorIndex_: function(index, separatorIndexes) { 81 isWindowSeparatorIndex_: function(index, separatorIndexes) {
82 return this.separatorIndexes.indexOf(index) != -1; 82 return this.separatorIndexes.indexOf(index) != -1;
83 }, 83 },
84 84
85 /** 85 /**
86 * @param {boolean} cardOpen 86 * @param {boolean} opened
87 * @return {string} 87 * @return {string}
88 * @private
88 */ 89 */
89 getCollapseTitle_: function(cardOpen) { 90 getCollapseIcon_: function(opened) {
90 return cardOpen ? loadTimeData.getString('collapseSessionButton') : 91 return opened ? 'cr:expand-less' : 'cr:expand-more';
91 loadTimeData.getString('expandSessionButton');
92 }, 92 },
93 93
94 /** 94 /**
95 * @param {boolean} opened
96 * @return {string}
97 * @private
98 */
99 getCollapseTitle_: function(opened) {
100 return opened ? loadTimeData.getString('collapseSessionButton') :
101 loadTimeData.getString('expandSessionButton');
102 },
103
104 /**
95 * @param {CustomEvent} e 105 * @param {CustomEvent} e
96 * @private 106 * @private
97 */ 107 */
98 onMenuButtonTap_: function(e) { 108 onMenuButtonTap_: function(e) {
99 this.fire('toggle-menu', { 109 this.fire('toggle-menu', {
100 target: Polymer.dom(e).localTarget, 110 target: Polymer.dom(e).localTarget,
101 tag: this.sessionTag 111 tag: this.sessionTag
102 }); 112 });
103 e.stopPropagation(); // Prevent iron-collapse. 113 e.stopPropagation(); // Prevent iron-collapse.
104 }, 114 },
105 }); 115 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698