Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: chrome/browser/resources/ntp4/apps_page.js

Issue 16191003: Add enable-app-shims to chrome://flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Need #if defined(OS_MACOSX) in ntp_resource_cache.cc Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 this.options_ = this.appendMenuItem_('appoptions'); 66 this.options_ = this.appendMenuItem_('appoptions');
67 this.details_ = this.appendMenuItem_('appdetails'); 67 this.details_ = this.appendMenuItem_('appdetails');
68 this.uninstall_ = this.appendMenuItem_('appuninstall'); 68 this.uninstall_ = this.appendMenuItem_('appuninstall');
69 this.options_.addEventListener('activate', 69 this.options_.addEventListener('activate',
70 this.onShowOptions_.bind(this)); 70 this.onShowOptions_.bind(this));
71 this.details_.addEventListener('activate', 71 this.details_.addEventListener('activate',
72 this.onShowDetails_.bind(this)); 72 this.onShowDetails_.bind(this));
73 this.uninstall_.addEventListener('activate', 73 this.uninstall_.addEventListener('activate',
74 this.onUninstall_.bind(this)); 74 this.onUninstall_.bind(this));
75 75
76 if (!(cr.isChromeOS || cr.isMac)) { 76 if (!cr.isChromeOS) {
77 this.createShortcutSeparator_ = 77 this.createShortcutSeparator_ =
78 menu.appendChild(cr.ui.MenuItem.createSeparator()); 78 menu.appendChild(cr.ui.MenuItem.createSeparator());
79 this.createShortcut_ = this.appendMenuItem_('appcreateshortcut'); 79 this.createShortcut_ = this.appendMenuItem_('appcreateshortcut');
80 this.createShortcut_.addEventListener( 80 this.createShortcut_.addEventListener(
81 'activate', this.onCreateShortcut_.bind(this)); 81 'activate', this.onCreateShortcut_.bind(this));
82 } 82 }
83 83
84 document.body.appendChild(menu); 84 document.body.appendChild(menu);
85 }, 85 },
86 86
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 launchTypeButton.checked = app.appData.launch_type == id; 133 launchTypeButton.checked = app.appData.launch_type == id;
134 launchTypeButton.hidden = app.appData.packagedApp; 134 launchTypeButton.hidden = app.appData.packagedApp;
135 }); 135 });
136 136
137 this.launchTypeMenuSeparator_.hidden = app.appData.packagedApp; 137 this.launchTypeMenuSeparator_.hidden = app.appData.packagedApp;
138 138
139 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled; 139 this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled;
140 this.details_.disabled = !app.appData.detailsUrl; 140 this.details_.disabled = !app.appData.detailsUrl;
141 this.uninstall_.disabled = !app.appData.mayDisable; 141 this.uninstall_.disabled = !app.appData.mayDisable;
142 142
143 if (this.createShortcut_ && cr.isMac) { 143 if (cr.isMac) {
Dan Beam 2013/05/30 22:19:25 what changed about this property being present?
jackhou1 2013/05/30 23:07:18 Previously, this line would never be true due to l
144 // On Windows and Linux, these should always be visible. On ChromeOS, 144 // On Windows and Linux, these should always be visible. On ChromeOS,
145 // they are never created. On Mac, shortcuts can only be created for 145 // they are never created. On Mac, shortcuts can only be created for
146 // new-style packaged apps, so hide the menu item. 146 // new-style packaged apps, so hide the menu item.
Dan Beam 2013/05/30 22:19:25 ^ does this comment need to be updated?
jackhou1 2013/05/30 23:07:18 Done.
147 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = 147 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden =
148 !app.appData.packagedApp; 148 !app.appData.packagedApp ||
149 loadTimeData.getBoolean('disableCreateAppShortcut');
149 } 150 }
150 }, 151 },
151 152
152 /** 153 /**
153 * Handlers for menu item activation. 154 * Handlers for menu item activation.
154 * @param {Event} e The activation event. 155 * @param {Event} e The activation event.
155 * @private 156 * @private
156 */ 157 */
157 onLaunch_: function(e) { 158 onLaunch_: function(e) {
158 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]); 159 chrome.send('launchApp', [this.app_.appId, APP_LAUNCH.NTP_APPS_MENU]);
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 function launchAppAfterEnable(appId) { 750 function launchAppAfterEnable(appId) {
750 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); 751 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]);
751 } 752 }
752 753
753 return { 754 return {
754 APP_LAUNCH: APP_LAUNCH, 755 APP_LAUNCH: APP_LAUNCH,
755 AppsPage: AppsPage, 756 AppsPage: AppsPage,
756 launchAppAfterEnable: launchAppAfterEnable, 757 launchAppAfterEnable: launchAppAfterEnable,
757 }; 758 };
758 }); 759 });
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698