| 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 /** | 5 /** |
| 6 * @fileoverview PageListView implementation. | 6 * @fileoverview PageListView implementation. |
| 7 * PageListView manages page list, dot list, switcher buttons and handles apps | 7 * PageListView manages page list, dot list, switcher buttons and handles apps |
| 8 * pages callbacks from backend. | 8 * pages callbacks from backend. |
| 9 * | 9 * |
| 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. | 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 * @param {Object} appData The data for the app. This contains page and | 261 * @param {Object} appData The data for the app. This contains page and |
| 262 * position indices. | 262 * position indices. |
| 263 */ | 263 */ |
| 264 appMoved: function(appData) { | 264 appMoved: function(appData) { |
| 265 assert(loadTimeData.getBoolean('showApps')); | 265 assert(loadTimeData.getBoolean('showApps')); |
| 266 | 266 |
| 267 var app = $(appData.id); | 267 var app = $(appData.id); |
| 268 assert(app, 'trying to move an app that doesn\'t exist'); | 268 assert(app, 'trying to move an app that doesn\'t exist'); |
| 269 app.remove(false); | 269 app.remove(false); |
| 270 | 270 |
| 271 this.appsPages[appData.page_index].insertApp(appData); | 271 this.appsPages[appData.page_index].insertApp(appData, false); |
| 272 }, | 272 }, |
| 273 | 273 |
| 274 /** | 274 /** |
| 275 * Called by chrome when an existing app has been disabled or | 275 * Called by chrome when an existing app has been disabled or |
| 276 * removed/uninstalled from chrome. | 276 * removed/uninstalled from chrome. |
| 277 * @param {Object} appData A data structure full of relevant information for | 277 * @param {Object} appData A data structure full of relevant information for |
| 278 * the app. | 278 * the app. |
| 279 * @param {boolean} isUninstall True if the app is being uninstalled; | 279 * @param {boolean} isUninstall True if the app is being uninstalled; |
| 280 * false if the app is being disabled. | 280 * false if the app is being disabled. |
| 281 * @param {boolean} fromPage True if the removal was from the current page. | 281 * @param {boolean} fromPage True if the removal was from the current page. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 true); | 435 true); |
| 436 } | 436 } |
| 437 this.updateSliderCards(); | 437 this.updateSliderCards(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 var page = this.appsPages[pageIndex]; | 440 var page = this.appsPages[pageIndex]; |
| 441 var app = $(appData.id); | 441 var app = $(appData.id); |
| 442 if (app) | 442 if (app) |
| 443 app.replaceAppData(appData); | 443 app.replaceAppData(appData); |
| 444 else | 444 else |
| 445 page.insertApp(appData, opt_highlight); | 445 page.insertApp(appData, !!opt_highlight); |
| 446 }, | 446 }, |
| 447 | 447 |
| 448 /** | 448 /** |
| 449 * Callback invoked by chrome whenever an app preference changes. | 449 * Callback invoked by chrome whenever an app preference changes. |
| 450 * @param {Object} data An object with all the data on available | 450 * @param {Object} data An object with all the data on available |
| 451 * applications. | 451 * applications. |
| 452 */ | 452 */ |
| 453 appsPrefChangedCallback: function(data) { | 453 appsPrefChangedCallback: function(data) { |
| 454 assert(loadTimeData.getBoolean('showApps')); | 454 assert(loadTimeData.getBoolean('showApps')); |
| 455 | 455 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 if (page.navigationDot) | 729 if (page.navigationDot) |
| 730 page.navigationDot.remove(opt_animate); | 730 page.navigationDot.remove(opt_animate); |
| 731 this.cardSlider.removeCard(page); | 731 this.cardSlider.removeCard(page); |
| 732 }, | 732 }, |
| 733 }; | 733 }; |
| 734 | 734 |
| 735 return { | 735 return { |
| 736 PageListView: PageListView | 736 PageListView: PageListView |
| 737 }; | 737 }; |
| 738 }); | 738 }); |
| OLD | NEW |