Commit 81c60a84 authored by erg@chromium.org's avatar erg@chromium.org

GTK: Make bookmarks droped from different profiles copy the bookmark.

This moves us to the same cross platform utility methods as views and
cocoa, and fixes a DCHECK().

BUG=102772
TEST=none


Review URL: http://codereview.chromium.org/8917029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114292 0039d316-1c4b-4281-b951-d872f2087c98
parent c6f0ea41
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
#include "grit/ui_resources.h" #include "grit/ui_resources.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/gtk_dnd_util.h" #include "ui/base/dragdrop/gtk_dnd_util.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
...@@ -1273,18 +1274,15 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget, ...@@ -1273,18 +1274,15 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget,
switch (target_type) { switch (target_type) {
case ui::CHROME_BOOKMARK_ITEM: { case ui::CHROME_BOOKMARK_ITEM: {
std::vector<const BookmarkNode*> nodes = Pickle pickle(reinterpret_cast<char*>(selection_data->data),
bookmark_utils::GetNodesFromSelection(context, selection_data, selection_data->length);
target_type, BookmarkNodeData drag_data;
browser_->profile(), DCHECK(drag_data.ReadFromPickle(&pickle));
&delete_selection_data, dnd_success = bookmark_utils::PerformBookmarkDrop(
&dnd_success); browser_->profile(),
DCHECK(!nodes.empty()); drag_data,
for (std::vector<const BookmarkNode*>::iterator it = nodes.begin(); dest_node,
it != nodes.end(); ++it) { index) != ui::DragDropTypes::DRAG_NONE;
model_->Move(*it, dest_node, index);
index = dest_node->GetIndexOf(*it) + 1;
}
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment