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

Unified Diff: chrome/browser/resources/md_history/history_item.js

Issue 2239623002: [MD History] Add shift-selection to the history lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reshadow
Patch Set: rebase, fix closure compile Created 4 years, 4 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
Index: chrome/browser/resources/md_history/history_item.js
diff --git a/chrome/browser/resources/md_history/history_item.js b/chrome/browser/resources/md_history/history_item.js
index 4e4adf9ed2bb0f0c447a058ff95d47cc4735fce4..b6b6603dfd28f920c4b07f74edfe8b5a1e6d983c 100644
--- a/chrome/browser/resources/md_history/history_item.js
+++ b/chrome/browser/resources/md_history/history_item.js
@@ -37,14 +37,26 @@ cr.define('md_history', function() {
/**
* When a history-item is selected the toolbar is notified and increases
* or decreases its count of selected items accordingly.
+ * @param {MouseEvent} e
* @private
*/
- onCheckboxSelected_: function() {
+ onCheckboxSelected_: function(e) {
// TODO(calamity): Fire this event whenever |selected| changes.
this.fire('history-checkbox-select', {
element: this,
- countAddition: this.$.checkbox.checked ? 1 : -1
+ shiftKey: e.shiftKey,
});
+ e.preventDefault();
+ },
+
+ /**
+ * @param {MouseEvent} e
+ * @private
+ */
+ onCheckboxMousedown_: function(e) {
+ // Prevent shift clicking a checkbox from selecting text.
+ if (e.shiftKey)
+ e.preventDefault();
},
/**
« no previous file with comments | « chrome/browser/resources/md_history/history_item.html ('k') | chrome/browser/resources/md_history/history_list_behavior.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698