1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * This is the class for the trash can that appears when dragging an app.
10 cr.define('ntp', function() {
13 function Trash(trash) {
14 trash.__proto__ = Trash.prototype;
20 __proto__: HTMLDivElement.prototype,
22 initialize: function(element) {
23 this.dragWrapper_ = new cr.ui.DragWrapper(this, this);
27 * Determines whether we are interested in the drag data for |e|.
28 * @param {Event} e The event from drag enter.
29 * @return {boolean} True if we are interested in the drag data for |e|.
31 shouldAcceptDrag: function(e) {
32 var tile = ntp.getCurrentlyDraggingTile();
36 return tile.firstChild.canBeRemoved();
41 * @param {Event} e The drag event.
43 doDragOver: function(e) {
44 ntp.getCurrentlyDraggingTile().dragClone.classList.add(
46 ntp.setCurrentDropEffect(e.dataTransfer, 'move');
52 * @param {Event} e The drag event.
54 doDragEnter: function(e) {
60 * @param {Event} e The drag event.
65 var tile = ntp.getCurrentlyDraggingTile();
66 tile.firstChild.removeFromChrome();
67 tile.landedOnTrash = true;
72 * @param {Event} e The drag event.
74 doDragLeave: function(e) {
75 ntp.getCurrentlyDraggingTile().dragClone.classList.remove(