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() {
16 function Trash(trash) {
17 trash.__proto__ = Trash.prototype;
23 __proto__: HTMLDivElement.prototype,
25 initialize: function(element) {
26 this.dragWrapper_ = new cr.ui.DragWrapper(this, this);
30 * Determines whether we are interested in the drag data for |e|.
31 * @param {Event} e The event from drag enter.
32 * @return {boolean} True if we are interested in the drag data for |e|.
34 shouldAcceptDrag: function(e) {
35 var tile = ntp.getCurrentlyDraggingTile();
39 return tile.firstChild.canBeRemoved();
44 * @param {Event} e The drag event.
46 doDragOver: function(e) {
47 ntp.getCurrentlyDraggingTile().dragClone.classList.add(
49 ntp.setCurrentDropEffect(e.dataTransfer, 'move');
55 * @param {Event} e The drag event.
57 doDragEnter: function(e) {
63 * @param {Event} e The drag event.
68 var tile = ntp.getCurrentlyDraggingTile();
69 tile.firstChild.removeFromChrome();
70 tile.landedOnTrash = true;
75 * @param {Event} e The drag event.
77 doDragLeave: function(e) {
78 ntp.getCurrentlyDraggingTile().dragClone.classList.remove(