| 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 cr.define('ntp', function() { | 5 cr.define('ntp', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 var APP_LAUNCH = { | 8 var APP_LAUNCH = { |
| 9 // The histogram buckets (keep in sync with extension_constants.h). | 9 // The histogram buckets (keep in sync with extension_constants.h). |
| 10 NTP_APPS_MAXIMIZED: 0, | 10 NTP_APPS_MAXIMIZED: 0, |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 this.insertApp(appData, true); | 661 this.insertApp(appData, true); |
| 662 }, | 662 }, |
| 663 | 663 |
| 664 /** | 664 /** |
| 665 * Similar to appendApp, but it respects the app_launch_ordinal field of | 665 * Similar to appendApp, but it respects the app_launch_ordinal field of |
| 666 * |appData|. | 666 * |appData|. |
| 667 * @param {Object} appData The data that describes the app. | 667 * @param {Object} appData The data that describes the app. |
| 668 * @param {boolean} animate Whether to animate the insertion. | 668 * @param {boolean} animate Whether to animate the insertion. |
| 669 */ | 669 */ |
| 670 insertApp: function(appData, animate) { | 670 insertApp: function(appData, animate) { |
| 671 // Don't show the web store icon if policy so dictates. |
| 672 if (appData.is_webstore && |
| 673 loadTimeData.getBoolean('isWebStoreIconHidden')) { |
| 674 return; |
| 675 } |
| 676 |
| 671 var index = this.tileElements_.length; | 677 var index = this.tileElements_.length; |
| 672 for (var i = 0; i < this.tileElements_.length; i++) { | 678 for (var i = 0; i < this.tileElements_.length; i++) { |
| 673 if (appData.app_launch_ordinal < | 679 if (appData.app_launch_ordinal < |
| 674 this.tileElements_[i].firstChild.appData.app_launch_ordinal) { | 680 this.tileElements_[i].firstChild.appData.app_launch_ordinal) { |
| 675 index = i; | 681 index = i; |
| 676 break; | 682 break; |
| 677 } | 683 } |
| 678 } | 684 } |
| 679 | 685 |
| 680 this.addTileAt(new App(appData), index, animate); | 686 this.addTileAt(new App(appData), index, animate); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 app.setupNotification_(notification); | 900 app.setupNotification_(notification); |
| 895 } | 901 } |
| 896 | 902 |
| 897 return { | 903 return { |
| 898 APP_LAUNCH: APP_LAUNCH, | 904 APP_LAUNCH: APP_LAUNCH, |
| 899 appNotificationChanged: appNotificationChanged, | 905 appNotificationChanged: appNotificationChanged, |
| 900 AppsPage: AppsPage, | 906 AppsPage: AppsPage, |
| 901 launchAppAfterEnable: launchAppAfterEnable, | 907 launchAppAfterEnable: launchAppAfterEnable, |
| 902 }; | 908 }; |
| 903 }); | 909 }); |
| OLD | NEW |