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

Unified Diff: chrome/browser/resources/md_bookmarks/command_manager.js

Issue 2929053004: MD Bookmarks: Make shortcuts for select all/deselect all global (Closed)
Patch Set: Fix test flub Created 3 years, 6 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 | chrome/browser/resources/md_bookmarks/constants.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e50b808d63d4a1c38c1976778c6bac951a6d51b4..243958299d6a8fa5f289746fa09faa8a0b069b5b 100644
--- a/chrome/browser/resources/md_bookmarks/command_manager.js
+++ b/chrome/browser/resources/md_bookmarks/command_manager.js
@@ -75,6 +75,9 @@ cr.define('bookmarks', function() {
this.addShortcut_(Command.UNDO, 'Ctrl|z', 'Meta|z');
this.addShortcut_(Command.REDO, 'Ctrl|y Ctrl|Shift|Z', 'Meta|Shift|Z');
+
+ this.addShortcut_(Command.SELECT_ALL, 'Ctrl|a', 'Meta|a');
+ this.addShortcut_(Command.DESELECT_ALL, 'Escape');
},
detached: function() {
@@ -129,6 +132,9 @@ cr.define('bookmarks', function() {
case Command.UNDO:
case Command.REDO:
return this.globalCanEdit_;
+ case Command.SELECT_ALL:
+ case Command.DESELECT_ALL:
+ return true;
default:
return this.isCommandVisible_(command, itemIds) &&
this.isCommandEnabled_(command, itemIds);
@@ -246,6 +252,13 @@ cr.define('bookmarks', function() {
this.openUrls_(this.expandUrls_(itemIds), command);
}
break;
+ case Command.SELECT_ALL:
+ var displayedIds = bookmarks.util.getDisplayedList(state);
+ this.dispatch(bookmarks.actions.selectAll(displayedIds, state));
+ break;
+ case Command.DESELECT_ALL:
+ this.dispatch(bookmarks.actions.deselectItems());
+ break;
default:
assert(false);
}
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/constants.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698