| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_ |
| 7 |
| 8 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 9 |
| 10 class BookmarkNode; |
| 11 class Profile; |
| 12 |
| 13 namespace views { |
| 14 class DropTargetEvent; |
| 15 } |
| 16 |
| 17 // Functions used in managing bookmark drag and drop. These functions are |
| 18 // used by both the bookmark bar and bookmark manager. |
| 19 namespace bookmark_drag_utils { |
| 20 |
| 21 // Calculates the drop operation given the event and supported set of |
| 22 // operations. This prefers the following ordering: COPY, LINK then MOVE. |
| 23 int PreferredDropOperation(const views::DropTargetEvent& event, |
| 24 int operation); |
| 25 |
| 26 // Returns true if the bookmark data can be dropped on |drop_parent| at |
| 27 // |index|. A drop from a separate profile is always allowed, where as |
| 28 // a drop from the same profile is only allowed if none of the nodes in |
| 29 // |data| are an ancestor of |drop_parent| and one of the nodes isn't already |
| 30 // a child of |drop_parent| at |index|. |
| 31 bool IsValidDropLocation(Profile* profile, |
| 32 const BookmarkDragData& data, |
| 33 BookmarkNode* drop_parent, |
| 34 int index); |
| 35 |
| 36 // Clones drag data, adding newly created nodes to |parent| starting at |
| 37 // |index_to_add_at|. |
| 38 void CloneDragData(BookmarkModel* model, |
| 39 const std::vector<BookmarkDragData::Element>& elements, |
| 40 BookmarkNode* parent, |
| 41 int index_to_add_at); |
| 42 |
| 43 } |
| 44 |
| 45 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_ |
| OLD | NEW |