cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / options / profiles_icon_grid.js
blobf8e7b61d13b8c182522054c2ccf7037d9398e84f
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
3 // found in the LICENSE file.
5 cr.define('options', function() {
6 /** @const */ var ListItem = cr.ui.ListItem;
7 /** @const */ var Grid = cr.ui.Grid;
8 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel;
10 /**
11 * Creates a new profile icon grid item.
12 * @param {Object} iconURL The profile icon URL.
13 * @constructor
14 * @extends {cr.ui.GridItem}
16 function ProfilesIconGridItem(iconURL) {
17 var el = cr.doc.createElement('span');
18 el.iconURL_ = iconURL;
19 ProfilesIconGridItem.decorate(el);
20 return el;
23 /**
24 * Decorates an element as a profile grid item.
25 * @param {!HTMLElement} el The element to decorate.
27 ProfilesIconGridItem.decorate = function(el) {
28 el.__proto__ = ProfilesIconGridItem.prototype;
29 el.decorate();
32 ProfilesIconGridItem.prototype = {
33 __proto__: ListItem.prototype,
35 /** @override */
36 decorate: function() {
37 ListItem.prototype.decorate.call(this);
38 var imageEl = cr.doc.createElement('img');
39 imageEl.className = 'profile-icon';
40 imageEl.style.content = getProfileAvatarIcon(this.iconURL_);
41 this.appendChild(imageEl);
43 this.className = 'profile-icon-grid-item';
47 var ProfilesIconGrid = cr.ui.define('grid');
49 ProfilesIconGrid.prototype = {
50 __proto__: Grid.prototype,
52 /** @override */
53 decorate: function() {
54 Grid.prototype.decorate.call(this);
55 this.selectionModel = new ListSingleSelectionModel();
58 /** @override */
59 createItem: function(iconURL) {
60 return new ProfilesIconGridItem(iconURL);
64 return {
65 ProfilesIconGrid: ProfilesIconGrid
67 });