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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 | 406 |
407 // Tell the slider about the pages and mark the current page. | 407 // Tell the slider about the pages and mark the current page. |
408 this.updateSliderCards(); | 408 this.updateSliderCards(); |
409 this.cardSlider.currentCardValue.navigationDot.classList.add('selected'); | 409 this.cardSlider.currentCardValue.navigationDot.classList.add('selected'); |
410 | 410 |
411 if (!this.appsLoaded_) { | 411 if (!this.appsLoaded_) { |
412 this.appsLoaded_ = true; | 412 this.appsLoaded_ = true; |
413 cr.dispatchSimpleEvent(document, 'sectionready', true, true); | 413 cr.dispatchSimpleEvent(document, 'sectionready', true, true); |
414 } | 414 } |
415 this.updateAppLauncherPromoHiddenState_(); | 415 this.updateAppLauncherPromoHiddenState_(); |
416 | |
417 if (data.disableCreateAppShortcut === true) { | |
tapted
2013/05/30 05:32:24
maybe this check should be before `sectionready` i
| |
418 this.appsPages[0].disableCreateAppShortcut(); | |
tapted
2013/05/30 05:32:24
this reads strangely -- it's only setting page[0],
| |
419 } | |
416 }, | 420 }, |
417 | 421 |
418 /** | 422 /** |
419 * Called by chrome when a new app has been added to chrome or has been | 423 * Called by chrome when a new app has been added to chrome or has been |
420 * enabled if previously disabled. | 424 * enabled if previously disabled. |
421 * @param {Object} appData A data structure full of relevant information for | 425 * @param {Object} appData A data structure full of relevant information for |
422 * the app. | 426 * the app. |
423 * @param {boolean=} opt_highlight Whether the app about to be added should | 427 * @param {boolean=} opt_highlight Whether the app about to be added should |
424 * be highlighted. | 428 * be highlighted. |
425 */ | 429 */ |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
803 if (page.navigationDot) | 807 if (page.navigationDot) |
804 page.navigationDot.remove(opt_animate); | 808 page.navigationDot.remove(opt_animate); |
805 this.cardSlider.removeCard(page); | 809 this.cardSlider.removeCard(page); |
806 }, | 810 }, |
807 }; | 811 }; |
808 | 812 |
809 return { | 813 return { |
810 PageListView: PageListView | 814 PageListView: PageListView |
811 }; | 815 }; |
812 }); | 816 }); |
OLD | NEW |