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 * @constructor | 6 * @constructor |
7 * @extends {HTMLSpanElement} | 7 * @extends {HTMLSpanElement} |
8 */ | 8 */ |
9 UI.Icon = class extends HTMLSpanElement { | 9 UI.Icon = class extends HTMLSpanElement { |
10 constructor() { | 10 constructor() { |
11 super(); | 11 super(); |
12 throw new Error('icon must be created via factory method.'); | 12 throw new Error('icon must be created via factory method.'); |
13 } | 13 } |
14 | 14 |
15 /** | 15 /** |
16 * @param {string=} iconType | 16 * @param {string=} iconType |
17 * @param {string=} className | 17 * @param {string=} className |
18 * @return {!UI.Icon} | 18 * @return {!UI.Icon} |
19 */ | 19 */ |
20 static create(iconType, className) { | 20 static create(iconType, className) { |
21 if (!UI.Icon._constructor) | 21 if (!UI.Icon._constructor) |
22 UI.Icon._constructor = registerCustomElement('span', 'ui-icon', UI.Icon.pr
ototype); | 22 UI.Icon._constructor = UI.registerCustomElement('span', 'ui-icon', UI.Icon
.prototype); |
23 | 23 |
24 var icon = /** @type {!UI.Icon} */ (new UI.Icon._constructor()); | 24 var icon = /** @type {!UI.Icon} */ (new UI.Icon._constructor()); |
25 if (className) | 25 if (className) |
26 icon.className = className; | 26 icon.className = className; |
27 if (iconType) | 27 if (iconType) |
28 icon.setIconType(iconType); | 28 icon.setIconType(iconType); |
29 return icon; | 29 return icon; |
30 } | 30 } |
31 | 31 |
32 /** | 32 /** |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 }, | 210 }, |
211 'largeicon-navigator-file': {x: -224, y: -72, width: 32, height: 24, spriteshe
et: 'largeicons', isMask: true}, | 211 'largeicon-navigator-file': {x: -224, y: -72, width: 32, height: 24, spriteshe
et: 'largeicons', isMask: true}, |
212 'largeicon-navigator-file-sync': {x: -160, y: -24, width: 32, height: 24, spri
tesheet: 'largeicons', isMask: true}, | 212 'largeicon-navigator-file-sync': {x: -160, y: -24, width: 32, height: 24, spri
tesheet: 'largeicons', isMask: true}, |
213 'badge-navigator-file-sync': {x: -320, y: -72, width: 32, height: 24, spritesh
eet: 'largeicons'}, | 213 'badge-navigator-file-sync': {x: -320, y: -72, width: 32, height: 24, spritesh
eet: 'largeicons'}, |
214 'largeicon-navigator-folder': {x: -64, y: -120, width: 32, height: 24, sprites
heet: 'largeicons', isMask: true}, | 214 'largeicon-navigator-folder': {x: -64, y: -120, width: 32, height: 24, sprites
heet: 'largeicons', isMask: true}, |
215 'largeicon-navigator-domain': {x: -160, y: -144, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, | 215 'largeicon-navigator-domain': {x: -160, y: -144, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, |
216 'largeicon-navigator-frame': {x: -256, y: -144, width: 32, height: 24, sprites
heet: 'largeicons', isMask: true}, | 216 'largeicon-navigator-frame': {x: -256, y: -144, width: 32, height: 24, sprites
heet: 'largeicons', isMask: true}, |
217 'largeicon-navigator-worker': {x: -320, y: -144, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, | 217 'largeicon-navigator-worker': {x: -320, y: -144, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, |
218 'largeicon-navigator-snippet': {x: -224, y: -96, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, | 218 'largeicon-navigator-snippet': {x: -224, y: -96, width: 32, height: 24, sprite
sheet: 'largeicons', isMask: true}, |
219 }; | 219 }; |
OLD | NEW |