OLD | NEW |
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 /** | 5 /** |
6 * @fileoverview 'cr-profile-avatar-selector' is an element that displays | 6 * @fileoverview 'cr-profile-avatar-selector' is an element that displays |
7 * profile avatar icons and allows an avatar to be selected. | 7 * profile avatar icons and allows an avatar to be selected. |
8 */ | 8 */ |
9 | 9 |
10 /** @typedef {{url: string, label: string}} */ | 10 /** @typedef {{url: string, label: string}} */ |
11 var AvatarIcon; | 11 var AvatarIcon; |
12 | 12 |
13 Polymer({ | 13 Polymer({ |
14 is: 'cr-profile-avatar-selector', | 14 is: 'cr-profile-avatar-selector', |
15 | 15 |
16 properties: { | 16 properties: { |
17 /** | 17 /** |
18 * The list of profile avatar URLs and labels. | 18 * The list of profile avatar URLs and labels. |
19 * @type {!Array<!AvatarIcon>} | 19 * @type {!Array<!AvatarIcon>} |
20 */ | 20 */ |
21 avatars: { | 21 avatars: {type: Array, value: function() { return []; }}, |
22 type: Array, | |
23 value: function() { return []; } | |
24 }, | |
25 | 22 |
26 /** | 23 /** |
27 * The currently selected profile avatar URL. May be a data URI. | 24 * The currently selected profile avatar URL. May be a data URI. |
28 * @type {string} | 25 * @type {string} |
29 */ | 26 */ |
30 selectedAvatarUrl: { | 27 selectedAvatarUrl: {type: String, notify: true}, |
31 type: String, | |
32 notify: true | |
33 }, | |
34 | 28 |
35 ignoreModifiedKeyEvents: { | 29 ignoreModifiedKeyEvents: { |
36 type: Boolean, | 30 type: Boolean, |
37 value: false, | 31 value: false, |
38 }, | 32 }, |
39 }, | 33 }, |
40 | 34 |
41 /** | 35 /** |
42 * @param {string} iconUrl | 36 * @param {string} iconUrl |
43 * @return {string} A CSS imageset for multiple scale factors. | 37 * @return {string} A CSS imageset for multiple scale factors. |
44 * @private | 38 * @private |
45 */ | 39 */ |
46 getIconImageset_: function(iconUrl) { | 40 getIconImageset_: function(iconUrl) { return cr.icon.getImage(iconUrl); }, |
47 return cr.icon.getImage(iconUrl); | |
48 }, | |
49 }); | 41 }); |
OLD | NEW |