Chromium Code Reviews| OLD | NEW |
|---|---|
| 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: { | 10 device: { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 /** | 21 /** |
| 22 * The list of tabs open for this device. | 22 * The list of tabs open for this device. |
| 23 * @type {!Array<!ForeignSessionTab>} | 23 * @type {!Array<!ForeignSessionTab>} |
| 24 */ | 24 */ |
| 25 tabs: { | 25 tabs: { |
| 26 type: Array, | 26 type: Array, |
| 27 value: function() { return []; }, | 27 value: function() { return []; }, |
| 28 observer: 'updateIcons_' | 28 observer: 'updateIcons_' |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 /** | |
| 32 * The indexes where a window separator should be shown. | |
|
tsergeant
2016/06/02 07:12:53
Nit: It would be nice to try and explain why this
calamity
2016/06/02 08:20:44
Done.
For those wondering, this was done to remov
| |
| 33 * @type {!Array<number>} | |
| 34 */ | |
| 35 separatorIndexes: Array, | |
| 36 | |
| 31 // Whether the card is open. | 37 // Whether the card is open. |
| 32 cardOpen_: { | 38 cardOpen_: { |
| 33 type: Boolean, | 39 type: Boolean, |
| 34 value: true | 40 value: true |
| 35 }, | 41 }, |
| 36 }, | 42 }, |
| 37 | 43 |
| 38 /** | 44 /** |
| 39 * Opens all the tabs displayed on the device in separate tabs. | 45 * Opens all the tabs displayed on the device in separate tabs. |
| 40 * @private | 46 * @private |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 61 */ | 67 */ |
| 62 updateIcons_: function() { | 68 updateIcons_: function() { |
| 63 this.async(function() { | 69 this.async(function() { |
| 64 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon'); | 70 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon'); |
| 65 | 71 |
| 66 for (var i = 0; i < this.tabs.length; i++) { | 72 for (var i = 0; i < this.tabs.length; i++) { |
| 67 icons[i].style.backgroundImage = | 73 icons[i].style.backgroundImage = |
| 68 cr.icon.getFaviconImageSet(this.tabs[i].url); | 74 cr.icon.getFaviconImageSet(this.tabs[i].url); |
| 69 } | 75 } |
| 70 }); | 76 }); |
| 77 }, | |
| 78 | |
| 79 isWindowSeparatorIndex: function(index, separatorIndexes) { | |
|
tsergeant
2016/06/02 07:12:53
Nit: Make this a private function.
calamity
2016/06/02 08:20:44
Done.
| |
| 80 return this.separatorIndexes.indexOf(index) != -1; | |
| 71 } | 81 } |
| 72 }); | 82 }); |
| OLD | NEW |