Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 7764013: ntp4: fix app load/unload race condition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/tile_page.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/tile_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698