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

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

Issue 13722009: Disable 'Create Shortcut' menu item on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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) { 76 if (!(cr.isChromeOS || cr.isMac)) {
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 (cr.isMac) { 143 if (this.createShortcut_ && cr.isMac) {
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.
147 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden = 147 this.createShortcutSeparator_.hidden = this.createShortcut_.hidden =
148 !app.appData.packagedApp; 148 !app.appData.packagedApp;
149 } 149 }
150 }, 150 },
151 151
152 /** 152 /**
153 * Handlers for menu item activation. 153 * Handlers for menu item activation.
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 function launchAppAfterEnable(appId) { 749 function launchAppAfterEnable(appId) {
750 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); 750 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]);
751 } 751 }
752 752
753 return { 753 return {
754 APP_LAUNCH: APP_LAUNCH, 754 APP_LAUNCH: APP_LAUNCH,
755 AppsPage: AppsPage, 755 AppsPage: AppsPage,
756 launchAppAfterEnable: launchAppAfterEnable, 756 launchAppAfterEnable: launchAppAfterEnable,
757 }; 757 };
758 }); 758 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698