Index: chrome/browser/resources/ntp4/apps_page.js |
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js |
index cd4b0845aa7ae308d818af815ffc7801622fb640..5cd2b5d747e33592a34988c2ea7dab0a6c47abbc 100644 |
--- a/chrome/browser/resources/ntp4/apps_page.js |
+++ b/chrome/browser/resources/ntp4/apps_page.js |
@@ -403,6 +403,17 @@ cr.define('ntp4', function() { |
this.appendTile(new App(appData), animate); |
}, |
+ /** @inheritdoc */ |
+ doDragOver: function(e) { |
+ var tile = ntp4.getCurrentlyDraggingTile(); |
+ if (!tile.querySelector('.app')) { |
+ e.preventDefault(); |
+ e.dataTransfer.dropEffect = 'copy'; |
+ } else { |
+ TilePage.prototype.doDragOver.call(this, e); |
+ } |
+ }, |
+ |
/** @inheritDoc */ |
shouldAcceptDrag: function(e) { |
return ntp4.getCurrentlyDraggingTile() || |
@@ -419,7 +430,7 @@ cr.define('ntp4', function() { |
currentlyDraggingTile, |
this.tileElements_[index]); |
this.tileMoved(currentlyDraggingTile); |
- } else if (tileContents.classList.contains('most-visited')) { |
+ } else if (currentlyDraggingTile.querySelector('.most-visited')) { |
this.generateAppForLink(tileContents.data); |
} |
} else { |
@@ -473,7 +484,8 @@ cr.define('ntp4', function() { |
generateAppForLink: function(data) { |
assert(data.url != undefined); |
assert(data.title != undefined); |
- chrome.send('generateAppForLink', [data.url, data.title]); |
+ var pageIndex = ntp4.getAppsPageIndex(this); |
+ chrome.send('generateAppForLink', [data.url, data.title, pageIndex]); |
}, |
/** @inheritDoc */ |