| Index: chrome/browser/resources/md_bookmarks/command_manager.js
|
| diff --git a/chrome/browser/resources/md_bookmarks/command_manager.js b/chrome/browser/resources/md_bookmarks/command_manager.js
|
| index aef8c5ae9f941b70e76dec863e453070faf347f5..e2f84cd9f4501248710c8da247eb99e3decb0128 100644
|
| --- a/chrome/browser/resources/md_bookmarks/command_manager.js
|
| +++ b/chrome/browser/resources/md_bookmarks/command_manager.js
|
| @@ -92,6 +92,7 @@ cr.define('bookmarks', function() {
|
| },
|
|
|
| closeCommandMenu: function() {
|
| + this.menuIds_ = new Set();
|
| /** @type {!CrActionMenuElement} */ (this.$.dropdown).close();
|
| },
|
|
|
| @@ -154,8 +155,11 @@ cr.define('bookmarks', function() {
|
| switch (command) {
|
| case Command.OPEN_NEW_TAB:
|
| case Command.OPEN_NEW_WINDOW:
|
| - case Command.OPEN_INCOGNITO:
|
| return this.expandUrls_(itemIds).length > 0;
|
| + case Command.OPEN_INCOGNITO:
|
| + return this.expandUrls_(itemIds).length > 0 &&
|
| + this.getState().prefs.incognitoAvailability !=
|
| + IncognitoAvailability.DISABLED;
|
| default:
|
| return true;
|
| }
|
| @@ -326,8 +330,8 @@ cr.define('bookmarks', function() {
|
| * @private
|
| */
|
| onCommandClick_: function(e) {
|
| - this.closeCommandMenu();
|
| this.handle(e.target.getAttribute('command'), assert(this.menuIds_));
|
| + this.closeCommandMenu();
|
| },
|
|
|
| /**
|
| @@ -363,7 +367,7 @@ cr.define('bookmarks', function() {
|
| if (e.path[0] != this.$.dropdown)
|
| return;
|
|
|
| - this.$.dropdown.close();
|
| + this.closeCommandMenu();
|
| },
|
|
|
| /**
|
| @@ -379,7 +383,7 @@ cr.define('bookmarks', function() {
|
| var label;
|
| switch (command) {
|
| case Command.EDIT:
|
| - if (this.menuIds_.size > 1)
|
| + if (this.menuIds_.size != 1)
|
| return '';
|
|
|
| var id = Array.from(this.menuIds_)[0];
|
|
|