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 var APP_LAUNCH = ntp.APP_LAUNCH; | 10 var APP_LAUNCH = ntp.APP_LAUNCH; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 onUninstall_: function(e) { | 178 onUninstall_: function(e) { |
179 chrome.send('uninstallApp', [this.app_.data.id]); | 179 chrome.send('uninstallApp', [this.app_.data.id]); |
180 }, | 180 }, |
181 onCreateShortcut_: function(e) { | 181 onCreateShortcut_: function(e) { |
182 chrome.send('createAppShortcut', [this.app_.data.id]); | 182 chrome.send('createAppShortcut', [this.app_.data.id]); |
183 }, | 183 }, |
184 }; | 184 }; |
185 | 185 |
186 /** | 186 /** |
187 * Creates a new App object. | 187 * Creates a new App object. |
188 * @param {Object} opt_data The data representing the app. | |
Dan Beam
2012/12/14 18:28:13
@param {Object=}
pedro (no code reviews)
2012/12/14 18:54:10
Done.
| |
188 * @constructor | 189 * @constructor |
189 * @extends {HTMLDivElement} | 190 * @extends {HTMLDivElement} |
190 */ | 191 */ |
191 function App(data) { | 192 function App(opt_data) { |
192 var el = cr.doc.createElement('div'); | 193 var el = cr.doc.createElement('div'); |
193 el.__proto__ = App.prototype; | 194 el.__proto__ = App.prototype; |
194 el.initialize_(); | 195 el.initialize_(); |
195 el.data = data; | 196 |
197 if (opt_data) | |
198 el.data = opt_data; | |
196 | 199 |
197 return el; | 200 return el; |
198 } | 201 } |
199 | 202 |
200 App.prototype = Tile.subclass({ | 203 App.prototype = Tile.subclass({ |
201 __proto__: HTMLDivElement.prototype, | 204 __proto__: HTMLDivElement.prototype, |
202 | 205 |
203 /** | 206 /** |
204 * Initialize the app object. | 207 * Initialize the app object. |
205 * @private | 208 * @private |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
739 if (app && !app.data.notifications_disabled) | 742 if (app && !app.data.notifications_disabled) |
740 app.setupNotification_(notification); | 743 app.setupNotification_(notification); |
741 } | 744 } |
742 | 745 |
743 return { | 746 return { |
744 appNotificationChanged: appNotificationChanged, | 747 appNotificationChanged: appNotificationChanged, |
745 AppsPage: AppsPage, | 748 AppsPage: AppsPage, |
746 launchAppAfterEnable: launchAppAfterEnable, | 749 launchAppAfterEnable: launchAppAfterEnable, |
747 }; | 750 }; |
748 }); | 751 }); |
OLD | NEW |