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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_win.cc

Issue 125111: Do not write a profile path on a BookmarkDragData object... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents_view_win.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents_view_win.cc (revision 18152)
+++ chrome/browser/tab_contents/tab_contents_view_win.cc (working copy)
@@ -144,7 +144,8 @@
if (drop_data.url.SchemeIs(chrome::kJavaScriptScheme)) {
// We don't want to allow javascript URLs to be dragged to the desktop,
// but we do want to allow them to be added to the bookmarks bar
- // (bookmarklets).
+ // (bookmarklets). So we create a fake bookmark entry (BookmarkDragData
+ // object) which explorer.exe cannot handle, and write the entry to data.
BookmarkDragData::Element bm_elt;
bm_elt.is_url = true;
bm_elt.url = drop_data.url;
@@ -153,7 +154,9 @@
BookmarkDragData bm_drag_data;
bm_drag_data.elements.push_back(bm_elt);
- bm_drag_data.Write(tab_contents()->profile(), data);
+ // Pass in NULL as the profile so that the bookmark always adds the url
+ // rather than trying to move an existing url.
+ bm_drag_data.Write(NULL, data);
} else {
data->SetURL(drop_data.url, drop_data.url_title);
}
« 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