| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 /** | 371 /** |
| 372 * Called by chrome when an existing app has been removed/uninstalled from | 372 * Called by chrome when an existing app has been removed/uninstalled from |
| 373 * chrome. | 373 * chrome. |
| 374 * @param {Object} appData A data structure full of relevant information for | 374 * @param {Object} appData A data structure full of relevant information for |
| 375 * the app. | 375 * the app. |
| 376 */ | 376 */ |
| 377 function appRemoved(appData) { | 377 function appRemoved(appData) { |
| 378 var app = $(appData.id); | 378 var app = $(appData.id); |
| 379 assert(app, 'trying to remove an app that doesn\'t exist'); | 379 assert(app, 'trying to remove an app that doesn\'t exist'); |
| 380 | 380 app.remove(); |
| 381 var tile = findAncestorByClass(app, 'tile'); | |
| 382 tile.doRemove(); | |
| 383 } | 381 } |
| 384 | 382 |
| 385 /** | 383 /** |
| 386 * Given a theme resource name, construct a URL for it. | 384 * Given a theme resource name, construct a URL for it. |
| 387 * @param {string} resourceName The name of the resource. | 385 * @param {string} resourceName The name of the resource. |
| 388 * @return {string} A url which can be used to load the resource. | 386 * @return {string} A url which can be used to load the resource. |
| 389 */ | 387 */ |
| 390 function getThemeUrl(resourceName) { | 388 function getThemeUrl(resourceName) { |
| 391 return 'chrome://theme/' + resourceName; | 389 return 'chrome://theme/' + resourceName; |
| 392 } | 390 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 // TODO(estade): update the content handlers to use ntp namespace instead of | 785 // TODO(estade): update the content handlers to use ntp namespace instead of |
| 788 // making these global. | 786 // making these global. |
| 789 var assert = ntp4.assert; | 787 var assert = ntp4.assert; |
| 790 var getAppsCallback = ntp4.getAppsCallback; | 788 var getAppsCallback = ntp4.getAppsCallback; |
| 791 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 789 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
| 792 var themeChanged = ntp4.themeChanged; | 790 var themeChanged = ntp4.themeChanged; |
| 793 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 791 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
| 794 var setMostVisitedPages = ntp4.setMostVisitedPages; | 792 var setMostVisitedPages = ntp4.setMostVisitedPages; |
| 795 | 793 |
| 796 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 794 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
| OLD | NEW |