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

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

Issue 1928243002: MD History: Only load needed paper-icon-buttons instead of whole set of icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change more icons Created 4 years, 7 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 for (var i = 0; i < this.tabs.length; i++) 44 for (var i = 0; i < this.tabs.length; i++)
45 window.open(this.tabs[i].url, '_blank'); 45 window.open(this.tabs[i].url, '_blank');
46 }, 46 },
47 47
48 /** 48 /**
49 * Toggles the dropdown display of synced tabs for each device card. 49 * Toggles the dropdown display of synced tabs for each device card.
50 */ 50 */
51 toggleTabCard: function() { 51 toggleTabCard: function() {
52 this.$.collapse.toggle(); 52 this.$.collapse.toggle();
53 this.$['dropdown-indicator'].icon = 53 this.$['dropdown-indicator'].icon =
54 this.$.collapse.opened ? 'expand-less' : 'expand-more'; 54 this.$.collapse.opened ? 'cr:expand-less' : 'cr:expand-more';
55 }, 55 },
56 56
57 /** 57 /**
58 * When the synced tab information is set, the icon associated with the tab 58 * When the synced tab information is set, the icon associated with the tab
59 * website is also set. 59 * website is also set.
60 * @private 60 * @private
61 */ 61 */
62 updateIcons_: function() { 62 updateIcons_: function() {
63 this.async(function() { 63 this.async(function() {
64 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon'); 64 var icons = Polymer.dom(this.root).querySelectorAll('.website-icon');
65 65
66 for (var i = 0; i < this.tabs.length; i++) { 66 for (var i = 0; i < this.tabs.length; i++) {
67 icons[i].style.backgroundImage = 67 icons[i].style.backgroundImage =
68 cr.icon.getFaviconImageSet(this.tabs[i].url); 68 cr.icon.getFaviconImageSet(this.tabs[i].url);
69 } 69 }
70 }); 70 });
71 } 71 }
72 }); 72 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/synced_device_card.html ('k') | ui/webui/resources/cr_elements/icons.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698