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

Side by Side Diff: Source/devtools/front_end/ui/DropTarget.js

Issue 1113813002: [DevTools] Rename View to Widget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ui/Dialog.js ('k') | Source/devtools/front_end/ui/EmptyView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!Element} element 7 * @param {!Element} element
8 * @param {!Array.<string>} transferTypes 8 * @param {!Array.<string>} transferTypes
9 * @param {string} messageText 9 * @param {string} messageText
10 * @param {function(!DataTransfer)} handleDrop 10 * @param {function(!DataTransfer)} handleDrop
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 _onDragOver: function(event) 62 _onDragOver: function(event)
63 { 63 {
64 if (!this._enabled || !this._hasMatchingType(event)) 64 if (!this._enabled || !this._hasMatchingType(event))
65 return; 65 return;
66 event.dataTransfer.dropEffect = "copy"; 66 event.dataTransfer.dropEffect = "copy";
67 event.consume(true); 67 event.consume(true);
68 if (this._dragMaskElement) 68 if (this._dragMaskElement)
69 return; 69 return;
70 this._dragMaskElement = this._element.createChild("div", ""); 70 this._dragMaskElement = this._element.createChild("div", "");
71 var shadowRoot = this._dragMaskElement.createShadowRoot(); 71 var shadowRoot = this._dragMaskElement.createShadowRoot();
72 shadowRoot.appendChild(WebInspector.View.createStyleElement("ui/dropTarg et.css")); 72 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/dropTa rget.css"));
73 shadowRoot.createChild("div", "drop-target-message").textContent = this. _messageText; 73 shadowRoot.createChild("div", "drop-target-message").textContent = this. _messageText;
74 this._dragMaskElement.addEventListener("drop", this._onDrop.bind(this), true); 74 this._dragMaskElement.addEventListener("drop", this._onDrop.bind(this), true);
75 this._dragMaskElement.addEventListener("dragleave", this._onDragLeave.bi nd(this), true); 75 this._dragMaskElement.addEventListener("dragleave", this._onDragLeave.bi nd(this), true);
76 }, 76 },
77 77
78 /** 78 /**
79 * @param {!Event} event 79 * @param {!Event} event
80 */ 80 */
81 _onDrop: function(event) 81 _onDrop: function(event)
82 { 82 {
(...skipping 11 matching lines...) Expand all
94 event.consume(true); 94 event.consume(true);
95 this._removeMask(); 95 this._removeMask();
96 }, 96 },
97 97
98 _removeMask: function() 98 _removeMask: function()
99 { 99 {
100 this._dragMaskElement.remove(); 100 this._dragMaskElement.remove();
101 delete this._dragMaskElement; 101 delete this._dragMaskElement;
102 } 102 }
103 } 103 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Dialog.js ('k') | Source/devtools/front_end/ui/EmptyView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698