Chromium Code Reviews| OLD | NEW |
|---|---|
| 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('ntp', function() { | 5 cr.define('ntp', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 var Tile = ntp.Tile; | 8 var Tile = ntp.Tile; |
| 9 var TilePage = ntp.TilePage; | 9 var TilePage = ntp.TilePage; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * Creates a new Thumbnail object for tiling. | 12 * Creates a new Thumbnail object for tiling. |
| 13 * @param {Object} opt_data The data representing the thumbnail. | |
|
Dan Beam
2012/12/14 18:28:13
* @param {Object=}
pedro (no code reviews)
2012/12/14 18:54:10
Done.
| |
| 13 * @constructor | 14 * @constructor |
| 14 * @extends {Tile} | 15 * @extends {Tile} |
| 15 * @extends {HTMLAnchorElement} | 16 * @extends {HTMLAnchorElement} |
| 16 */ | 17 */ |
| 17 function Thumbnail() { | 18 function Thumbnail(opt_data) { |
| 18 var el = cr.doc.createElement('a'); | 19 var el = cr.doc.createElement('a'); |
| 19 el.__proto__ = Thumbnail.prototype; | 20 el.__proto__ = Thumbnail.prototype; |
| 20 el.initialize(); | 21 el.initialize(); |
| 21 | 22 |
| 23 if (opt_data) | |
| 24 el.data = opt_data; | |
| 25 | |
| 22 return el; | 26 return el; |
| 23 } | 27 } |
| 24 | 28 |
| 25 Thumbnail.prototype = Tile.subclass({ | 29 Thumbnail.prototype = Tile.subclass({ |
| 26 __proto__: HTMLAnchorElement.prototype, | 30 __proto__: HTMLAnchorElement.prototype, |
| 27 | 31 |
| 28 /** | 32 /** |
| 29 * Initializes a Thumbnail. | 33 * Initializes a Thumbnail. |
| 30 */ | 34 */ |
| 31 initialize: function() { | 35 initialize: function() { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 shouldAcceptDrag: function(e) { | 174 shouldAcceptDrag: function(e) { |
| 171 return false; | 175 return false; |
| 172 }, | 176 }, |
| 173 }; | 177 }; |
| 174 | 178 |
| 175 return { | 179 return { |
| 176 Thumbnail: Thumbnail, | 180 Thumbnail: Thumbnail, |
| 177 ThumbnailPage: ThumbnailPage, | 181 ThumbnailPage: ThumbnailPage, |
| 178 }; | 182 }; |
| 179 }); | 183 }); |
| OLD | NEW |