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 @@
#include "grit/generated_resources.h"
#include "grit/theme_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/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
......@@ -1273,18 +1274,15 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget,
switch (target_type) {
case ui::CHROME_BOOKMARK_ITEM: {
std::vector<const BookmarkNode*> nodes =
bookmark_utils::GetNodesFromSelection(context, selection_data,
target_type,
browser_->profile(),
&delete_selection_data,
&dnd_success);
DCHECK(!nodes.empty());
for (std::vector<const BookmarkNode*>::iterator it = nodes.begin();
it != nodes.end(); ++it) {
model_->Move(*it, dest_node, index);
index = dest_node->GetIndexOf(*it) + 1;
}
Pickle pickle(reinterpret_cast<char*>(selection_data->data),
selection_data->length);
BookmarkNodeData drag_data;
DCHECK(drag_data.ReadFromPickle(&pickle));
dnd_success = bookmark_utils::PerformBookmarkDrop(
browser_->profile(),
drag_data,
dest_node,
index) != ui::DragDropTypes::DRAG_NONE;
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