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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 assert(this.appsPages.length == origPageCount + 1, | 386 assert(this.appsPages.length == origPageCount + 1, |
387 'expected new page'); | 387 'expected new page'); |
388 } | 388 } |
389 | 389 |
390 if (app.id == this.highlightAppId) | 390 if (app.id == this.highlightAppId) |
391 highlightApp = app; | 391 highlightApp = app; |
392 else | 392 else |
393 this.appsPages[pageIndex].insertApp(app, false); | 393 this.appsPages[pageIndex].insertApp(app, false); |
394 } | 394 } |
395 | 395 |
396 ntp.AppsPage.setPromo(data.showPromo ? data : null); | |
397 | |
398 this.cardSlider.currentCard = prevCurrentCard; | 396 this.cardSlider.currentCard = prevCurrentCard; |
399 | 397 |
400 if (highlightApp) | 398 if (highlightApp) |
401 this.appAdded(highlightApp, true); | 399 this.appAdded(highlightApp, true); |
402 | 400 |
403 logEvent('apps.layout: ' + (Date.now() - startTime)); | 401 logEvent('apps.layout: ' + (Date.now() - startTime)); |
404 | 402 |
405 // Tell the slider about the pages and mark the current page. | 403 // Tell the slider about the pages and mark the current page. |
406 this.updateSliderCards(); | 404 this.updateSliderCards(); |
407 this.cardSlider.currentCardValue.navigationDot.classList.add('selected'); | 405 this.cardSlider.currentCardValue.navigationDot.classList.add('selected'); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 if (page.navigationDot) | 756 if (page.navigationDot) |
759 page.navigationDot.remove(opt_animate); | 757 page.navigationDot.remove(opt_animate); |
760 this.cardSlider.removeCard(page); | 758 this.cardSlider.removeCard(page); |
761 }, | 759 }, |
762 }; | 760 }; |
763 | 761 |
764 return { | 762 return { |
765 PageListView: PageListView | 763 PageListView: PageListView |
766 }; | 764 }; |
767 }); | 765 }); |
OLD | NEW |