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. | |
| 33 * @type {!Array<number>} | |
| 34 */ | |
| 35 separatorIndexes: { | |
|
tsergeant
2016/06/01 08:00:35
Nit: can use the one line short-form.
calamity
2016/06/02 05:59:18
Done.
| |
| 36 type: Array, | |
| 37 }, | |
| 38 | |
| 31 // Whether the card is open. | 39 // Whether the card is open. |
| 32 cardOpen_: { | 40 cardOpen_: { |
| 33 type: Boolean, | 41 type: Boolean, |
| 34 value: true | 42 value: true |
| 35 }, | 43 }, |
| 36 }, | 44 }, |
| 37 | 45 |
| 38 /** | 46 /** |
| 39 * Opens all the tabs displayed on the device in separate tabs. | 47 * Opens all the tabs displayed on the device in separate tabs. |
| 40 * @private | 48 * @private |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 61 */ | 69 */ |
| 62 updateIcons_: function() { | 70 updateIcons_: function() { |
| 63 this.async(function() { | 71 this.async(function() { |
| 64 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon'); | 72 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon'); |
| 65 | 73 |
| 66 for (var i = 0; i < this.tabs.length; i++) { | 74 for (var i = 0; i < this.tabs.length; i++) { |
| 67 icons[i].style.backgroundImage = | 75 icons[i].style.backgroundImage = |
| 68 cr.icon.getFaviconImageSet(this.tabs[i].url); | 76 cr.icon.getFaviconImageSet(this.tabs[i].url); |
| 69 } | 77 } |
| 70 }); | 78 }); |
| 79 }, | |
| 80 | |
| 81 isWindowSeparatorIndex: function(index, separatorIndexes) { | |
| 82 return this.separatorIndexes.indexOf(index) != -1; | |
| 71 } | 83 } |
| 72 }); | 84 }); |
| OLD | NEW |