| 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_;
|
| +}
|
|
|