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 Thumbnail = ntp.Thumbnail; | 8 var Thumbnail = ntp.Thumbnail; |
9 var ThumbnailPage = ntp.ThumbnailPage; | 9 var ThumbnailPage = ntp.ThumbnailPage; |
10 | 10 |
11 /** | 11 /** |
12 * Creates a new Most Visited object for tiling. | 12 * Creates a new Most Visited object for tiling. |
13 * @param {Object} opt_data The data representing the most visited page. | |
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 {Thumbnail} | 15 * @extends {Thumbnail} |
15 * @extends {HTMLAnchorElement} | 16 * @extends {HTMLAnchorElement} |
16 */ | 17 */ |
17 function MostVisited() { | 18 function MostVisited(opt_data) { |
18 var el = cr.doc.createElement('a'); | 19 var el = cr.doc.createElement('a'); |
19 el.__proto__ = MostVisited.prototype; | 20 el.__proto__ = MostVisited.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 MostVisited.prototype = { | 29 MostVisited.prototype = { |
26 __proto__: Thumbnail.prototype, | 30 __proto__: Thumbnail.prototype, |
27 | 31 |
28 /** | 32 /** |
29 * Initializes a MostVisited Thumbnail. | 33 * Initializes a MostVisited Thumbnail. |
30 */ | 34 */ |
31 initialize: function() { | 35 initialize: function() { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 chrome.send('mostVisitedSelected'); | 233 chrome.send('mostVisitedSelected'); |
230 } | 234 } |
231 }; | 235 }; |
232 | 236 |
233 return { | 237 return { |
234 MostVisitedPage: MostVisitedPage, | 238 MostVisitedPage: MostVisitedPage, |
235 }; | 239 }; |
236 }); | 240 }); |
237 | 241 |
238 document.addEventListener('ntpLoaded', ntp.MostVisitedPage.onLoaded); | 242 document.addEventListener('ntpLoaded', ntp.MostVisitedPage.onLoaded); |
OLD | NEW |