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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/file_grid.js

Issue 962103002: Files.app: Introduce check-select mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove remaining debug log. Created 5 years, 10 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: ui/file_manager/file_manager/foreground/js/ui/file_grid.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
index 572469c239b32274f52e2e8b40ed511d4ead4634..db001f078038eca50e5ad20caf488987df4eac70 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
@@ -115,6 +115,13 @@ FileGrid.prototype.mergeItems = function(beginIndex, endIndex) {
};
/**
+ * @override
+ */
+FileGrid.prototype.createSelectionController = function(sm) {
+ return new FileGridSelectionController(assert(sm), this);
+};
+
+/**
* Updates items to reflect metadata changes.
* @param {string} type Type of metadata changed.
* @param {Array.<Entry>} entries Entries whose metadata changed.
@@ -195,10 +202,6 @@ FileGrid.decorateThumbnail_ = function(
var checkmark = li.ownerDocument.createElement('div');
checkmark.className = 'checkmark';
- checkmark.addEventListener(
- 'mouseup', util.repeatMouseEventWithCtrlKey.bind(null, li));
- checkmark.addEventListener(
- 'mousedown', util.repeatMouseEventWithCtrlKey.bind(null, li));
frame.appendChild(checkmark);
var bottom = li.ownerDocument.createElement('div');
@@ -439,3 +442,31 @@ FileGrid.prototype.getHitElements = function(x, y, opt_width, opt_height) {
}
return currentSelection;
};
+
+/**
+ * Selection controller for the file grid.
+ * @param {!cr.ui.ListSelectionModel} selectionModel The selection model to
+ * interact with.
+ * @param {!cr.ui.Grid} grid The grid to interact with.
+ * @constructor
+ * @extends {cr.ui.GridSelectionController}
+ * @struct
+ * @suppress {checkStructDictInheritance}
+ */
+function FileGridSelectionController(selectionModel, grid) {
+ cr.ui.GridSelectionController.call(this, selectionModel, grid);
+}
+
+FileGridSelectionController.prototype = /** @struct */ {
+ __proto__: cr.ui.GridSelectionController.prototype
+};
+
+/** @override */
+FileGridSelectionController.prototype.handlePointerDownUp = function(e, index) {
+ filelist.handlePointerDownUp.call(this, e, index);
+};
+
+/** @override */
+FileGridSelectionController.prototype.handleKeyDown = function(e) {
+ filelist.handleKeyDown.call(this, e);
+};

Powered by Google App Engine
This is Rietveld 408576698