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

Unified Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 1097873002: Copy and Cut option of the context menu is not working via keyboard in chrome://bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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':
« 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