Index: chrome/browser/resources/bookmark_manager/js/main.js |
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js |
index 626994851e710e66b40ffaaa26332354a4fd98df..c48bb1307b2782bc8e61b45a7aa7430d10dbd6c9 100644 |
--- a/chrome/browser/resources/bookmark_manager/js/main.js |
+++ b/chrome/browser/resources/bookmark_manager/js/main.js |
@@ -1259,7 +1259,7 @@ function getFilteredSelectedBookmarkIds(opt_target) { |
*/ |
function handleCommand(e) { |
var command = e.command; |
- var target; |
+ var target = assertInstanceof(e.target, HTMLElement); |
switch (command.id) { |
case 'import-menu-command': |
recordUserAction('Import'); |
@@ -1288,27 +1288,24 @@ function handleCommand(e) { |
case 'open-in-new-tab-command': |
case 'open-in-background-tab-command': |
recordUserAction('OpenInNewTab'); |
- openBookmarks(LinkKind.BACKGROUND_TAB, |
- assertInstanceof(e.target, HTMLElement)); |
+ openBookmarks(LinkKind.BACKGROUND_TAB, target); |
break; |
case 'open-in-new-window-command': |
recordUserAction('OpenInNewWindow'); |
- openBookmarks(LinkKind.WINDOW, |
- assertInstanceof(e.target, HTMLElement)); |
+ openBookmarks(LinkKind.WINDOW, target); |
break; |
case 'open-incognito-window-command': |
recordUserAction('OpenIncognito'); |
- openBookmarks(LinkKind.INCOGNITO, |
- assertInstanceof(e.target, HTMLElement)); |
+ openBookmarks(LinkKind.INCOGNITO, target); |
break; |
case 'delete-from-folders-menu-command': |
target = bmm.tree; |
case 'delete-command': |
recordUserAction('Delete'); |
- deleteBookmarks(target || assertInstanceof(e.target, HTMLElement)); |
+ deleteBookmarks(target); |
break; |
case 'copy-from-folders-menu-command': |
@@ -1347,12 +1344,11 @@ function handleCommand(e) { |
chrome.bookmarkManagerPrivate.sortChildren(bmm.list.parentId); |
break; |
- case 'rename-folder-command': |
- editItem(assertInstanceof(e.target, HTMLElement)); |
- break; |
case 'rename-folder-from-folders-menu-command': |
- editItem(bmm.tree); |
+ target = bmm.tree; |
+ case 'rename-folder-command': |
+ editItem(target); |
break; |
case 'edit-command': |