Chromium Code Reviews| 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 7dbf8d0761bdc5483eb2c99414124e2efad14d2a..f7d29ca20de2c05dde9e93ca290bd5cd16f7a1f8 100644 |
| --- a/chrome/browser/resources/md_bookmarks/command_manager.js |
| +++ b/chrome/browser/resources/md_bookmarks/command_manager.js |
| @@ -89,6 +89,7 @@ cr.define('bookmarks', function() { |
| }, |
| closeCommandMenu: function() { |
| + this.menuIds_ = new Set(); |
|
calamity
2017/05/29 06:52:27
Does this functionally change anything, or is it j
tsergeant
2017/05/30 00:18:21
Menu item bindings are based entirely on the menuI
calamity
2017/06/01 04:07:44
I see. So menu items that have enable conditions t
tsergeant
2017/06/01 05:27:16
Yup, exactly.
|
| /** @type {!CrActionMenuElement} */ (this.$.dropdown).close(); |
| }, |
| @@ -148,8 +149,10 @@ 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.incognito != IncognitoAvailability.DISABLED; |
| default: |
| return true; |
| } |
| @@ -314,8 +317,8 @@ cr.define('bookmarks', function() { |
| * @private |
| */ |
| onCommandClick_: function(e) { |
| - this.closeCommandMenu(); |
| this.handle(e.target.getAttribute('command'), assert(this.menuIds_)); |
| + this.closeCommandMenu(); |
| }, |
| /** |
| @@ -351,7 +354,7 @@ cr.define('bookmarks', function() { |
| if (e.path[0] != this.$.dropdown) |
| return; |
| - this.$.dropdown.close(); |
| + this.closeCommandMenu(); |
| }, |
| /** |
| @@ -367,7 +370,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]; |