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

Unified Diff: chrome/browser/resources/options/browser_options_startup_page_list.js

Issue 47033003: Fix "Set pages" drop crash by changing outside drags to simply add a new URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/startup_page_list_browsertest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/browser_options_startup_page_list.js
diff --git a/chrome/browser/resources/options/browser_options_startup_page_list.js b/chrome/browser/resources/options/browser_options_startup_page_list.js
index 23f7c1a43a5cabf4863f2c27c6fa1c6f370adb71..6afed9a081d37c0c334ef8b5359b47948022d6b3 100644
--- a/chrome/browser/resources/options/browser_options_startup_page_list.js
+++ b/chrome/browser/resources/options/browser_options_startup_page_list.js
@@ -246,8 +246,19 @@ cr.define('options.browser_options', function() {
if (this.dropPos == 'below')
newIndex += 1;
- chrome.send('dragDropStartupPage',
- [newIndex, this.selectionModel.selectedIndexes]);
+ // If there are selected indexes, it was a re-order.
+ if (this.selectionModel.selectedIndexes.length > 0) {
+ chrome.send('dragDropStartupPage',
+ [newIndex, this.selectionModel.selectedIndexes]);
+ return;
+ }
+
+ // Otherwise it was potentially a drop of new data (e.g. a bookmark).
+ var url = e.dataTransfer.getData('url');
+ if (url) {
+ e.preventDefault();
+ chrome.send('addStartupPage', [url, newIndex]);
+ }
},
/**
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/startup_page_list_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698