summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Wu <rob@robwu.nl>2015-01-06 22:26:08 +0100
committerRob Wu <rob@robwu.nl>2015-01-06 21:27:12 +0000
commit9cf3ff79a7779820bc6c77a4d378d7bd98b5fadb (patch)
tree2832b75b78ef1d47b9b5bb44503543f6f432346e
parentc3412213890aa0124bd4ce6d4fa75ad9d90b0f3b (diff)
downloadchromium_src-9cf3ff79a7779820bc6c77a4d378d7bd98b5fadb.zip
chromium_src-9cf3ff79a7779820bc6c77a4d378d7bd98b5fadb.tar.gz
chromium_src-9cf3ff79a7779820bc6c77a4d378d7bd98b5fadb.tar.bz2
Drag and drop: Only hide the current overlay if it is the drop target
BUG=445918 R=finnur@chromium.org Review URL: https://codereview.chromium.org/831053002 Cr-Commit-Position: refs/heads/master@{#309909} (cherry picked from commit a8016a4e080a7531d967a1dc82574fe6e9714a8e) Review URL: https://codereview.chromium.org/814713004 Cr-Commit-Position: refs/branch-heads/2214@{#389} Cr-Branched-From: 03655fd3f6d72165dc3c9bd2c89807305316fe6c-refs/heads/master@{#303346}
-rw-r--r--chrome/browser/resources/extensions/extensions.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/resources/extensions/extensions.js b/chrome/browser/resources/extensions/extensions.js
index 42ad4a4..45c1caa 100644
--- a/chrome/browser/resources/extensions/extensions.js
+++ b/chrome/browser/resources/extensions/extensions.js
@@ -55,7 +55,7 @@ cr.define('extensions', function() {
},
/** @override */
doDragLeave: function() {
- ExtensionSettings.showOverlay(null);
+ this.hideDropTargetOverlay_();
chrome.send('stopDrag');
},
/** @override */
@@ -64,7 +64,7 @@ cr.define('extensions', function() {
},
/** @override */
doDrop: function(e) {
- ExtensionSettings.showOverlay(null);
+ this.hideDropTargetOverlay_();
if (e.dataTransfer.files.length != 1)
return;
@@ -89,6 +89,16 @@ cr.define('extensions', function() {
e.preventDefault();
chrome.send(toSend);
}
+ },
+
+ /**
+ * Hide the current overlay if it is the drop target overlay.
+ * @private
+ */
+ hideDropTargetOverlay_: function() {
+ var currentOverlay = ExtensionSettings.getCurrentOverlay();
+ if (currentOverlay && currentOverlay.id === 'drop-target-overlay')
+ ExtensionSettings.showOverlay(null);
}
};