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

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: Set => Array 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 3ece41158a275254a9ce1c6082bfbcd9587f5850..b0f869a6ddc0b47eb4c11a3477151bad63004093 100644
--- a/chrome/browser/resources/md_history/history_item.js
+++ b/chrome/browser/resources/md_history/history_item.js
@@ -37,14 +37,25 @@ 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.
+ e.preventDefault();
tsergeant 2016/08/15 04:49:50 You should probably only preventDefault when shift
calamity 2016/08/15 07:18:40 Done.
},
/**

Powered by Google App Engine
This is Rietveld 408576698