OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_drag.h" |
| 6 |
| 7 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
| 8 |
| 9 namespace { |
| 10 |
| 11 const GdkDragAction kBookmarkDragAction = |
| 12 static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_MOVE); |
| 13 |
| 14 } // namespace |
| 15 |
| 16 // static |
| 17 void BookmarkDrag::BeginDrag(Profile* profile, |
| 18 const std::vector<const BookmarkNode*>& nodes) { |
| 19 new BookmarkDrag(profile, nodes); |
| 20 } |
| 21 |
| 22 BookmarkDrag::BookmarkDrag(Profile* profile, |
| 23 const std::vector<const BookmarkNode*>& nodes) |
| 24 : CustomDrag(NULL, GetCodeMask(false), kBookmarkDragAction), |
| 25 profile_(profile), |
| 26 nodes_(nodes) {} |
| 27 |
| 28 BookmarkDrag::~BookmarkDrag() {} |
| 29 |
| 30 void BookmarkDrag::OnDragDataGet(GtkWidget* widget, |
| 31 GdkDragContext* context, |
| 32 GtkSelectionData* selection_data, |
| 33 guint target_type, |
| 34 guint time) { |
| 35 WriteBookmarksToSelection(nodes_, selection_data, target_type, profile_); |
| 36 } |
OLD | NEW |