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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc

Issue 8917029: GTK: Make bookmarks droped from different profiles copy the bookmark. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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/ui/gtk/bookmarks/bookmark_bar_gtk.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
index dade1abee6e930f30655e9191b7482c833966fdf..f22769e8cb6616d7b2e84fa97381fbb9c2b3b374 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
@@ -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;
}
« 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