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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js

Issue 2566753003: DevTools: Sources: Use URL over content for drag and drop on files. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
index defaecff994b2c1d717901d77ef06bd9189e65f7..11df66e283ecde9216ef2bb4bcdc2baf324f5298 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
@@ -943,22 +943,9 @@ Sources.NavigatorSourceTreeElement = class extends TreeElement {
this.listItemElement.draggable = true;
this.listItemElement.addEventListener('click', this._onclick.bind(this), false);
this.listItemElement.addEventListener('contextmenu', this._handleContextMenuEvent.bind(this), false);
- this.listItemElement.addEventListener('mousedown', this._onmousedown.bind(this), false);
this.listItemElement.addEventListener('dragstart', this._ondragstart.bind(this), false);
}
- _onmousedown(event) {
- if (event.which === 1) // Warm-up data for drag'n'drop
- this._uiSourceCode.requestContent().then(callback.bind(this));
- /**
- * @param {?string} content
- * @this {Sources.NavigatorSourceTreeElement}
- */
- function callback(content) {
- this._warmedUpContent = content;
- }
- }
-
_shouldRenameOnMouseDown() {
if (!this._uiSourceCode.canRename())
return false;
@@ -985,10 +972,12 @@ Sources.NavigatorSourceTreeElement = class extends TreeElement {
}
}
+ /**
+ * @param {!DragEvent} event
+ */
_ondragstart(event) {
- event.dataTransfer.setData('text/plain', this._warmedUpContent);
+ event.dataTransfer.setData('text/plain', this._uiSourceCode.url());
event.dataTransfer.effectAllowed = 'copy';
- return true;
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698