| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 this.launch_ = this.appendMenuItem_(); | 48 this.launch_ = this.appendMenuItem_(); |
| 49 this.launch_.addEventListener('activate', this.onLaunch_.bind(this)); | 49 this.launch_.addEventListener('activate', this.onLaunch_.bind(this)); |
| 50 | 50 |
| 51 menu.appendChild(cr.ui.MenuItem.createSeparator()); | 51 menu.appendChild(cr.ui.MenuItem.createSeparator()); |
| 52 if (loadTimeData.getBoolean('enableStreamlinedHostedApps')) | 52 if (loadTimeData.getBoolean('enableStreamlinedHostedApps')) |
| 53 this.launchRegularTab_ = this.appendMenuItem_('applaunchtypetab'); | 53 this.launchRegularTab_ = this.appendMenuItem_('applaunchtypetab'); |
| 54 else | 54 else |
| 55 this.launchRegularTab_ = this.appendMenuItem_('applaunchtyperegular'); | 55 this.launchRegularTab_ = this.appendMenuItem_('applaunchtyperegular'); |
| 56 this.launchPinnedTab_ = this.appendMenuItem_('applaunchtypepinned'); | 56 this.launchPinnedTab_ = this.appendMenuItem_('applaunchtypepinned'); |
| 57 if (!cr.isMac) | 57 this.launchNewWindow_ = this.appendMenuItem_('applaunchtypewindow'); |
| 58 this.launchNewWindow_ = this.appendMenuItem_('applaunchtypewindow'); | |
| 59 this.launchFullscreen_ = this.appendMenuItem_('applaunchtypefullscreen'); | 58 this.launchFullscreen_ = this.appendMenuItem_('applaunchtypefullscreen'); |
| 60 | 59 |
| 61 var self = this; | 60 var self = this; |
| 62 this.forAllLaunchTypes_(function(launchTypeButton, id) { | 61 this.forAllLaunchTypes_(function(launchTypeButton, id) { |
| 63 launchTypeButton.addEventListener('activate', | 62 launchTypeButton.addEventListener('activate', |
| 64 self.onLaunchTypeChanged_.bind(self)); | 63 self.onLaunchTypeChanged_.bind(self)); |
| 65 }); | 64 }); |
| 66 | 65 |
| 67 this.launchTypeMenuSeparator_ = cr.ui.MenuItem.createSeparator(); | 66 this.launchTypeMenuSeparator_ = cr.ui.MenuItem.createSeparator(); |
| 68 menu.appendChild(this.launchTypeMenuSeparator_); | 67 menu.appendChild(this.launchTypeMenuSeparator_); |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 function launchAppAfterEnable(appId) { | 769 function launchAppAfterEnable(appId) { |
| 771 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); | 770 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); |
| 772 } | 771 } |
| 773 | 772 |
| 774 return { | 773 return { |
| 775 APP_LAUNCH: APP_LAUNCH, | 774 APP_LAUNCH: APP_LAUNCH, |
| 776 AppsPage: AppsPage, | 775 AppsPage: AppsPage, |
| 777 launchAppAfterEnable: launchAppAfterEnable, | 776 launchAppAfterEnable: launchAppAfterEnable, |
| 778 }; | 777 }; |
| 779 }); | 778 }); |
| OLD | NEW |