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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; | 143 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; |
144 this.details_.disabled = !app.appData.detailsUrl; | 144 this.details_.disabled = !app.appData.detailsUrl; |
145 this.uninstall_.disabled = !app.appData.mayDisable; | 145 this.uninstall_.disabled = !app.appData.mayDisable; |
146 | 146 |
147 this.disableNotifications_.hidden = true; | 147 this.disableNotifications_.hidden = true; |
148 var notificationsDisabled = app.appData.notifications_disabled; | 148 var notificationsDisabled = app.appData.notifications_disabled; |
149 if (typeof notificationsDisabled != 'undefined') { | 149 if (typeof notificationsDisabled != 'undefined') { |
150 this.disableNotifications_.hidden = false; | 150 this.disableNotifications_.hidden = false; |
151 this.disableNotifications_.checked = notificationsDisabled; | 151 this.disableNotifications_.checked = notificationsDisabled; |
152 } | 152 } |
153 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = | 153 if (cr.isMac) { |
154 !app.appData.packagedApp; | 154 // On Windows and Linux, these should always be visible. On ChromeOS, |
| 155 // they are never created. On Mac, shortcuts can only be created for |
| 156 // new-style packaged apps, so hide the menu item. |
| 157 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = |
| 158 !app.appData.packagedApp; |
| 159 } |
155 }, | 160 }, |
156 | 161 |
157 /** | 162 /** |
158 * Handlers for menu item activation. | 163 * Handlers for menu item activation. |
159 * @param {Event} e The activation event. | 164 * @param {Event} e The activation event. |
160 * @private | 165 * @private |
161 */ | 166 */ |
162 onLaunch_: function(e) { | 167 onLaunch_: function(e) { |
163 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]); | 168 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]); |
164 }, | 169 }, |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 app.setupNotification_(notification); | 899 app.setupNotification_(notification); |
895 } | 900 } |
896 | 901 |
897 return { | 902 return { |
898 APP_LAUNCH: APP_LAUNCH, | 903 APP_LAUNCH: APP_LAUNCH, |
899 appNotificationChanged: appNotificationChanged, | 904 appNotificationChanged: appNotificationChanged, |
900 AppsPage: AppsPage, | 905 AppsPage: AppsPage, |
901 launchAppAfterEnable: launchAppAfterEnable, | 906 launchAppAfterEnable: launchAppAfterEnable, |
902 }; | 907 }; |
903 }); | 908 }); |
OLD | NEW |