| 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 | 143 |
| 144 this.launchTypeMenuSeparator_.hidden = app.appData.packagedApp; | 144 this.launchTypeMenuSeparator_.hidden = app.appData.packagedApp; |
| 145 | 145 |
| 146 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; | 146 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; |
| 147 this.details_.disabled = !app.appData.detailsUrl; | 147 this.details_.disabled = !app.appData.detailsUrl; |
| 148 this.uninstall_.disabled = !app.appData.mayDisable; | 148 this.uninstall_.disabled = !app.appData.mayDisable; |
| 149 | 149 |
| 150 if (cr.isMac) { | 150 if (cr.isMac) { |
| 151 // On Windows and Linux, these should always be visible. On ChromeOS, | 151 // On Windows and Linux, these should always be visible. On ChromeOS, |
| 152 // they are never created. On Mac, shortcuts can only be created for | 152 // they are never created. On Mac, shortcuts can only be created for |
| 153 // new-style packaged apps, so hide the menu item. Also check if | 153 // new-style packaged apps, so hide the menu item. |
| 154 // loadTimeData explicitly disables this as the feature is not yet | |
| 155 // enabled by default on Mac. | |
| 156 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = | 154 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = |
| 157 !app.appData.packagedApp || | 155 !app.appData.packagedApp; |
| 158 loadTimeData.getBoolean('disableCreateAppShortcut'); | |
| 159 } | 156 } |
| 160 }, | 157 }, |
| 161 | 158 |
| 162 /** | 159 /** |
| 163 * Handlers for menu item activation. | 160 * Handlers for menu item activation. |
| 164 * @param {Event} e The activation event. | 161 * @param {Event} e The activation event. |
| 165 * @private | 162 * @private |
| 166 */ | 163 */ |
| 167 onLaunch_: function(e) { | 164 onLaunch_: function(e) { |
| 168 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]); | 165 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 function launchAppAfterEnable(appId) { | 766 function launchAppAfterEnable(appId) { |
| 770 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); | 767 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); |
| 771 } | 768 } |
| 772 | 769 |
| 773 return { | 770 return { |
| 774 APP_LAUNCH: APP_LAUNCH, | 771 APP_LAUNCH: APP_LAUNCH, |
| 775 AppsPage: AppsPage, | 772 AppsPage: AppsPage, |
| 776 launchAppAfterEnable: launchAppAfterEnable, | 773 launchAppAfterEnable: launchAppAfterEnable, |
| 777 }; | 774 }; |
| 778 }); | 775 }); |
| OLD | NEW |