| Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
|
| index 2af9ff76ed467ab907cb502f0aa1e8240b902ea7..d087151cf78f348a636954f8122cbd96b3f88c05 100644
|
| --- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
|
| @@ -324,7 +324,8 @@ void WriteBookmarksToSelection(const std::vector<const BookmarkNode*>& nodes,
|
| Pickle pickle;
|
| data.WriteToPickle(profile, &pickle);
|
|
|
| - gtk_selection_data_set(selection_data, selection_data->target,
|
| + gtk_selection_data_set(selection_data,
|
| + gtk_selection_data_get_target(selection_data),
|
| kBitsInAByte,
|
| static_cast<const guchar*>(pickle.data()),
|
| pickle.size());
|
| @@ -335,7 +336,7 @@ void WriteBookmarksToSelection(const std::vector<const BookmarkNode*>& nodes,
|
| std::string utf8_text = nodes[0]->url().spec() + "\n" +
|
| UTF16ToUTF8(nodes[0]->GetTitle());
|
| gtk_selection_data_set(selection_data,
|
| - selection_data->target,
|
| + gtk_selection_data_get_target(selection_data),
|
| kBitsInAByte,
|
| reinterpret_cast<const guchar*>(utf8_text.c_str()),
|
| utf8_text.length());
|
| @@ -394,22 +395,26 @@ std::vector<const BookmarkNode*> GetNodesFromSelection(
|
| if (dnd_success)
|
| *dnd_success = FALSE;
|
|
|
| - if (selection_data && selection_data->length > 0) {
|
| - if (context && delete_selection_data && context->action == GDK_ACTION_MOVE)
|
| - *delete_selection_data = TRUE;
|
| -
|
| - switch (target_type) {
|
| - case ui::CHROME_BOOKMARK_ITEM: {
|
| - if (dnd_success)
|
| - *dnd_success = TRUE;
|
| - Pickle pickle(reinterpret_cast<char*>(selection_data->data),
|
| - selection_data->length);
|
| - BookmarkNodeData drag_data;
|
| - drag_data.ReadFromPickle(&pickle);
|
| - return drag_data.GetNodes(profile);
|
| - }
|
| - default: {
|
| - DLOG(ERROR) << "Unsupported drag received type: " << target_type;
|
| + if (selection_data) {
|
| + gint length = gtk_selection_data_get_length(selection_data);
|
| + if (length > 0) {
|
| + if (context && delete_selection_data &&
|
| + context->action == GDK_ACTION_MOVE)
|
| + *delete_selection_data = TRUE;
|
| +
|
| + switch (target_type) {
|
| + case ui::CHROME_BOOKMARK_ITEM: {
|
| + if (dnd_success)
|
| + *dnd_success = TRUE;
|
| + Pickle pickle(reinterpret_cast<const char*>(
|
| + gtk_selection_data_get_data(selection_data)), length);
|
| + BookmarkNodeData drag_data;
|
| + drag_data.ReadFromPickle(&pickle);
|
| + return drag_data.GetNodes(profile);
|
| + }
|
| + default: {
|
| + DLOG(ERROR) << "Unsupported drag received type: " << target_type;
|
| + }
|
| }
|
| }
|
| }
|
|
|