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

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

Issue 1607403004: MD History: Display synced tabs history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@second_patch
Patch Set: Changed switching between pages & addressed comments Created 4 years, 10 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: 'synced-device-card',
7
8 properties: {
9 // Synced device.
calamity 2016/02/11 00:23:31 // Name of the synced device?
yingran 2016/02/11 02:06:36 Done.
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 // The list of tabs open for this device.
22 tabs: {
23 type: Array,
24 value: function() { return []; },
25 observer: 'updateIcons_'
26 },
27
28 // Whether the card is open.
29 cardOpen: {
30 type: Boolean,
31 value: true
32 }
33 },
34
35 /**
36 * Opens all the tabs displayed on the synced device card in separate tabs on
37 * the user's browser.
38 * @private
39 */
40 openAllTabs_: function() {
41 for (var i = 0; i < this.tabs.length; i++) {
42 window.open(this.tabs[i].url, '_blank');
43 }
44 },
45
46 /**
47 * Toggles the dropdown display of synced tabs for each device card.
48 */
49 toggleTabCard: function() {
50 this.$.collapse.toggle();
51 this.$$('#dropdown-indicator').icon =
52 (this.$.collapse.opened ? 'expand-less' : 'expand-more');
53 },
54
55 /**
56 * When the synced tab information is set, the icon associated with the tab
57 * website is also set.
58 * @private
59 */
60 updateIcons_: function() {
61 this.async(function() {
62 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon');
63
64 for (var i = 0; i < this.tabs.length; i++) {
65 icons[i].style.backgroundImage =
66 getFaviconImageSet(this.tabs[i].url);
67 }
68 });
69 }
70 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698