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: {type: Array, value: function() { return []; }}, | 21 avatars: { |
| 22 type: Array, |
| 23 value: function() { |
| 24 return []; |
| 25 } |
| 26 }, |
22 | 27 |
23 /** | 28 /** |
24 * The currently selected profile avatar URL. May be a data URI. | 29 * The currently selected profile avatar URL. May be a data URI. |
25 * @type {string} | 30 * @type {string} |
26 */ | 31 */ |
27 selectedAvatarUrl: {type: String, notify: true}, | 32 selectedAvatarUrl: {type: String, notify: true}, |
28 | 33 |
29 ignoreModifiedKeyEvents: { | 34 ignoreModifiedKeyEvents: { |
30 type: Boolean, | 35 type: Boolean, |
31 value: false, | 36 value: false, |
32 }, | 37 }, |
33 }, | 38 }, |
34 | 39 |
35 /** | 40 /** |
36 * @param {string} iconUrl | 41 * @param {string} iconUrl |
37 * @return {string} A CSS imageset for multiple scale factors. | 42 * @return {string} A CSS imageset for multiple scale factors. |
38 * @private | 43 * @private |
39 */ | 44 */ |
40 getIconImageset_: function(iconUrl) { return cr.icon.getImage(iconUrl); }, | 45 getIconImageset_: function(iconUrl) { |
| 46 return cr.icon.getImage(iconUrl); |
| 47 }, |
41 }); | 48 }); |
OLD | NEW |