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

Side by Side Diff: chrome/browser/resources/options/browser_options_profile_list.js

Issue 1919183005: Cleanup: Extract icon related methods outside of util.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename favicon.html to icon.html 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 cr.define('options.browser_options', function() { 5 cr.define('options.browser_options', function() {
6 /** @const */ var DeletableItem = options.DeletableItem; 6 /** @const */ var DeletableItem = options.DeletableItem;
7 /** @const */ var DeletableItemList = options.DeletableItemList; 7 /** @const */ var DeletableItemList = options.DeletableItemList;
8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; 8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
9 9
10 /** 10 /**
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 decorate: function() { 43 decorate: function() {
44 DeletableItem.prototype.decorate.call(this); 44 DeletableItem.prototype.decorate.call(this);
45 45
46 var profileInfo = this.profileInfo_; 46 var profileInfo = this.profileInfo_;
47 47
48 var containerEl = this.ownerDocument.createElement('div'); 48 var containerEl = this.ownerDocument.createElement('div');
49 containerEl.className = 'profile-container'; 49 containerEl.className = 'profile-container';
50 50
51 var iconEl = this.ownerDocument.createElement('img'); 51 var iconEl = this.ownerDocument.createElement('img');
52 iconEl.className = 'profile-img'; 52 iconEl.className = 'profile-img';
53 iconEl.style.content = getProfileAvatarIcon(profileInfo.iconURL); 53 iconEl.style.content = cr.icon.getProfileAvatarIcon(
54 profileInfo.iconURL);
54 iconEl.alt = ''; 55 iconEl.alt = '';
55 containerEl.appendChild(iconEl); 56 containerEl.appendChild(iconEl);
56 57
57 var nameEl = this.ownerDocument.createElement('div'); 58 var nameEl = this.ownerDocument.createElement('div');
58 nameEl.className = 'profile-name'; 59 nameEl.className = 'profile-name';
59 if (profileInfo.isCurrentProfile) 60 if (profileInfo.isCurrentProfile)
60 nameEl.classList.add('profile-item-current'); 61 nameEl.classList.add('profile-item-current');
61 containerEl.appendChild(nameEl); 62 containerEl.appendChild(nameEl);
62 63
63 var displayName = profileInfo.name; 64 var displayName = profileInfo.name;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 * If false, items in this list will not be deletable. 133 * If false, items in this list will not be deletable.
133 * @private 134 * @private
134 */ 135 */
135 canDeleteItems_: true, 136 canDeleteItems_: true,
136 }; 137 };
137 138
138 return { 139 return {
139 ProfileList: ProfileList 140 ProfileList: ProfileList
140 }; 141 };
141 }); 142 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698