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

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

Issue 1729263005: MD History: Display synced tabs history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mdh_shared_styles
Patch Set: rebase 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 // 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: {
tsergeant 2016/03/09 04:36:50 Can this one be private?
calamity 2016/03/10 04:18:24 Done.
30 type: Boolean,
31 value: true
32 },
33 },
34
35 /**
36 * Opens all the tabs displayed on the device in separate tabs.
37 * @private
38 */
39 openAllTabs_: function() {
40 for (var i = 0; i < this.tabs.length; i++)
41 window.open(this.tabs[i].url, '_blank');
42 },
43
44 /**
45 * Toggles the dropdown display of synced tabs for each device card.
46 */
47 toggleTabCard: function() {
48 this.$.collapse.toggle();
49 this.$['dropdown-indicator'].icon =
50 this.$.collapse.opened ? 'expand-less' : 'expand-more';
51 },
52
53 /**
54 * When the synced tab information is set, the icon associated with the tab
55 * website is also set.
56 * @private
57 */
58 updateIcons_: function() {
59 this.async(function() {
60 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon');
61
62 for (var i = 0; i < this.tabs.length; i++) {
63 icons[i].style.backgroundImage =
64 getFaviconImageSet(this.tabs[i].url);
65 }
66 });
67 }
68 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698