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 1729263005: MD History: Display synced tabs history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mdh_shared_styles
Patch Set: address_comments Created 4 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 Polymer({
6 is: 'history-synced-device-card',
7
8 properties: {
9 // Name of the synced device.
10 device: {
11 type: String,
12 value: ''
13 },
14
15 // When the device information was last updated.
16 lastUpdateTime: {
17 type: String,
18 value: ''
19 },
20
21 /**
22 * The list of tabs open for this device.
23 * @type {!Array<!ForeignSessionTab>}
24 */
25 tabs: {
26 type: Array,
27 value: function() { return []; },
28 observer: 'updateIcons_'
29 },
30
31 // Whether the card is open.
32 cardOpen_: {
33 type: Boolean,
34 value: true
35 },
36 },
37
38 /**
39 * Opens all the tabs displayed on the device in separate tabs.
40 * @private
41 */
42 openAllTabs_: function() {
43 // TODO(calamity): add a warning if an excessive number of tabs will open.
44 for (var i = 0; i < this.tabs.length; i++)
45 window.open(this.tabs[i].url, '_blank');
46 },
47
48 /**
49 * Toggles the dropdown display of synced tabs for each device card.
50 */
51 toggleTabCard: function() {
52 this.$.collapse.toggle();
53 this.$['dropdown-indicator'].icon =
54 this.$.collapse.opened ? 'expand-less' : 'expand-more';
55 },
56
57 /**
58 * When the synced tab information is set, the icon associated with the tab
59 * website is also set.
60 * @private
61 */
62 updateIcons_: function() {
63 this.async(function() {
64 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon');
65
66 for (var i = 0; i < this.tabs.length; i++) {
67 icons[i].style.backgroundImage =
68 getFaviconImageSet(this.tabs[i].url);
69 }
70 });
71 }
72 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698