Chromium Code Reviews| Index: chrome/browser/resources/ntp4/apps_page.js |
| diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js |
| index 751d9cea2eb6ea8bf3da40ac9e91a8173e6a0616..a425ab09a42409f3f6a4e4fe4688f597e8bc14a1 100644 |
| --- a/chrome/browser/resources/ntp4/apps_page.js |
| +++ b/chrome/browser/resources/ntp4/apps_page.js |
| @@ -50,7 +50,7 @@ cr.define('ntp', function() { |
| menu.appendChild(cr.ui.MenuItem.createSeparator()); |
| this.launchRegularTab_ = this.appendMenuItem_('applaunchtyperegular'); |
| this.launchPinnedTab_ = this.appendMenuItem_('applaunchtypepinned'); |
| - if (loadTimeData.getBoolean('enableNewBookmarkApps') || !cr.isMac) |
| + if (loadTimeData.getBoolean('hostedAppsInWindowsEnabled')) |
| this.launchNewWindow_ = this.appendMenuItem_('applaunchtypewindow'); |
| this.launchFullscreen_ = this.appendMenuItem_('applaunchtypefullscreen'); |
| @@ -136,16 +136,25 @@ cr.define('ntp', function() { |
| this.launch_.textContent = app.appData.title; |
| var launchTypeWindow = this.launchNewWindow_; |
| + var hasLaunchType = false; |
| this.forAllLaunchTypes_(function(launchTypeButton, id) { |
| launchTypeButton.disabled = false; |
| launchTypeButton.checked = app.appData.launch_type == id; |
| - // If bookmark apps are enabled, only show the "Open as window" button. |
| + // There are three cases when a launch type is hidden: |
| + // 1. packaged apps hide all launch types |
| + // 2. hostedAppsInWindowsEnabled is false and type is launchTypeWindow |
| + // 3. enableNewBookmarkApps is true and type is anything except |
| + // launchTypeWindow |
| launchTypeButton.hidden = app.appData.packagedApp || |
| + (!loadTimeData.getBoolean('hostedAppsInWindowsEnabled') && |
| + launchTypeButton == launchTypeWindow) || |
| (loadTimeData.getBoolean('enableNewBookmarkApps') && |
| launchTypeButton != launchTypeWindow); |
| + hasLaunchType = hasLaunchType || !launchTypeButton.hidden; |
|
Dan Beam
2015/08/20 18:25:57
if (!launchTypeButton.hidden) hasLaunchType = true
dominickn
2015/08/20 22:07:44
Done.
|
| }); |
| - this.launchTypeMenuSeparator_.hidden = app.appData.packagedApp; |
| + this.launchTypeMenuSeparator_.hidden = |
| + app.appData.packagedApp || !hasLaunchType; |
| this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; |
| if (this.details_) |