OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * @fileoverview New tab page | 6 * @fileoverview New tab page |
7 * This is the main code for the new tab page used by touch-enabled Chrome | 7 * This is the main code for the new tab page used by touch-enabled Chrome |
8 * browsers. For now this is still a prototype. | 8 * browsers. For now this is still a prototype. |
9 */ | 9 */ |
10 | 10 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 logEvent('apps.layout: ' + (Date.now() - startTime)); | 328 logEvent('apps.layout: ' + (Date.now() - startTime)); |
329 } | 329 } |
330 | 330 |
331 /** | 331 /** |
332 * Called by chrome when a new app has been added to chrome. | 332 * Called by chrome when a new app has been added to chrome. |
333 * @param {Object} app A data structure full of relevant information for the | 333 * @param {Object} app A data structure full of relevant information for the |
334 * app. | 334 * app. |
335 */ | 335 */ |
336 function appAdded(app) { | 336 function appAdded(app) { |
337 var pageIndex = app.page_index || 0; | 337 var pageIndex = app.page_index || 0; |
338 assert(pageIndex == 0, 'pageIndex != 0 not implemented'); | |
339 | |
340 var page = appsPages[pageIndex]; | 338 var page = appsPages[pageIndex]; |
341 cardSlider.selectCardByValue(page); | 339 cardSlider.selectCardByValue(page); |
342 page.appendApp(app, true); | 340 page.appendApp(app, true); |
343 } | 341 } |
344 | 342 |
345 /** | 343 /** |
346 * Called by chrome when an existing app has been removed/uninstalled from | 344 * Called by chrome when an existing app has been removed/uninstalled from |
347 * chrome. | 345 * chrome. |
348 * @param {Object} appData A data structure full of relevant information for | 346 * @param {Object} appData A data structure full of relevant information for |
349 * the app. | 347 * the app. |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // TODO(estade): update the content handlers to use ntp namespace instead of | 738 // TODO(estade): update the content handlers to use ntp namespace instead of |
741 // making these global. | 739 // making these global. |
742 var assert = ntp4.assert; | 740 var assert = ntp4.assert; |
743 var getAppsCallback = ntp4.getAppsCallback; | 741 var getAppsCallback = ntp4.getAppsCallback; |
744 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 742 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
745 var themeChanged = ntp4.themeChanged; | 743 var themeChanged = ntp4.themeChanged; |
746 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 744 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
747 var setMostVisitedPages = ntp4.setMostVisitedPages; | 745 var setMostVisitedPages = ntp4.setMostVisitedPages; |
748 | 746 |
749 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 747 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
OLD | NEW |