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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js

Issue 10566022: Click on empty space clears selection in single selection list on Mac and Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js b/chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js
index 7b45629a62875e59976de517661aa61c62932a60..ecaa3e8c6450f51806cdc182d5ab6f656bb1217e 100644
--- a/chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js
+++ b/chrome/browser/resources/shared/js/cr/ui/list_selection_controller.js
@@ -129,10 +129,9 @@ cr.define('cr.ui', function() {
// On Mac we always clear the selection if the user clicks a blank area.
// On Windows, we only clear the selection if neither Shift nor Ctrl are
// pressed.
- if (cr.isMac) {
+ if (cr.isMac || cr.isChromeOS) {
sm.leadIndex = sm.anchorIndex = -1;
- if (sm.multiple)
- sm.unselectAll();
+ sm.unselectAll();
} else if (!isDown && !e.shiftKey && !e.ctrlKey)
// Keep anchor and lead indexes. Note that this is intentionally
// different than on the Mac.
@@ -264,7 +263,7 @@ cr.define('cr.ui', function() {
} else {
sm.selectRange(anchorIndex, newIndex);
}
- } else if (e.ctrlKey && !cr.isMac) {
+ } else if (e.ctrlKey && !cr.isMac && !cr.isChromeOS) {
// Setting the lead index is done above.
// Mac does not allow you to change the lead.
} else {
« 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