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

Unified 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: Pass --enable-app-shims through to NPT Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
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 852887d79efd671f1b2e53c2e230620d9d6811b6..f7f076a8276d032765ebae8f18f572d80a51855e 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -39,6 +39,12 @@ cr.define('ntp', function() {
cr.addSingletonGetter(AppContextMenu);
AppContextMenu.prototype = {
+ /**
+ * If true, the "Create shortcuts" context menu entry will be hidden.
+ * @type {boolean}
+ */
+ disableCreateAppShortcut: false,
tapted 2013/05/30 05:32:24 pretty sure this should be in initialize(), with a
+
initialize: function() {
var menu = new cr.ui.Menu;
cr.ui.decorate(menu, cr.ui.Menu);
@@ -73,7 +79,7 @@ cr.define('ntp', function() {
this.uninstall_.addEventListener('activate',
this.onUninstall_.bind(this));
- if (!(cr.isChromeOS || cr.isMac)) {
+ if (!cr.isChromeOS) {
this.createShortcutSeparator_ =
menu.appendChild(cr.ui.MenuItem.createSeparator());
this.createShortcut_ = this.appendMenuItem_('appcreateshortcut');
@@ -140,12 +146,12 @@ cr.define('ntp', function() {
this.details_.disabled = !app.appData.detailsUrl;
this.uninstall_.disabled = !app.appData.mayDisable;
- if (this.createShortcut_ && cr.isMac) {
+ if (cr.isMac) {
// On Windows and Linux, these should always be visible. On ChromeOS,
// they are never created. On Mac, shortcuts can only be created for
// new-style packaged apps, so hide the menu item.
this.createShortcutSeparator_.hidden = this.createShortcut_.hidden =
- !app.appData.packagedApp;
+ !app.appData.packagedApp || this.disableCreateAppShortcut;
}
},
@@ -549,6 +555,13 @@ cr.define('ntp', function() {
},
/**
+ * Disable the "Create shortcut" context menu item.
+ */
+ disableCreateAppShortcut: function() {
+ AppContextMenu.getInstance().disableCreateAppShortcut = true;
+ },
+
+ /**
* Highlight a newly installed app as it's added to the NTP.
* @param {Object} appData The data object that describes the app.
*/

Powered by Google App Engine
This is Rietveld 408576698