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

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

Issue 2503513003: Show a label to describe some invalid drag-drop operations in Files app. (Closed)
Patch Set: Fix test failure of FileManagerJsTest.DirectoryTreeTest. Created 4 years 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/drop_effect_and_label.js
diff --git a/ui/file_manager/file_manager/foreground/js/drop_effect_and_label.js b/ui/file_manager/file_manager/foreground/js/drop_effect_and_label.js
new file mode 100644
index 0000000000000000000000000000000000000000..2347e1d203c09be9de10b847cded186e034a6959
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/js/drop_effect_and_label.js
@@ -0,0 +1,50 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * Drop effect names supported as a value of DataTransfer.dropEffect.
+ * @enum {string}
+ */
+const DropEffectType = {
+ NONE: 'none',
+ COPY: 'copy',
+ MOVE: 'move',
+ LINK: 'link'
+};
+
+/**
+ * Represents a drop effect and a label to describe it.
+ *
+ * @param {!DropEffectType} dropEffect
+ * @param {?string} label
+ * @constructor
+ * @struct
+ */
+function DropEffectAndLabel(dropEffect, label) {
+ /**
+ * @private {string}
+ */
+ this.dropEffect_ = dropEffect;
+
+ /**
+ * Optional description why the drop opeartion is (not) permitted.
+ *
+ * @private {?string}
+ */
+ this.label_ = label;
+}
+
+/**
+ * @return {string} Returns the type of the drop effect.
+ */
+DropEffectAndLabel.prototype.getDropEffect = function() {
+ return this.dropEffect_;
+}
+
+/**
+ * @return {?string} Returns the label. |none| if a label should not appear.
+ */
+DropEffectAndLabel.prototype.getLabel = function() {
+ return this.label_;
+}

Powered by Google App Engine
This is Rietveld 408576698